假设我想定义\newcommand{\versesep}{\textbullet}
用于分隔圣经经文。建议用什么方法来定义字符前后的水平空间?
答案1
类似这样??与\kern
替代方案不同,\hspace
将在边缘处被吸收,从而实现正确的对齐/刷新。间隙的具体数字可以由 OP 选择。
因此,使用minus
(或plus
)定义间隙大小允许在间隙中建立一些间隙,这对于窄列文档尤其有用。
\documentclass{article}
\def\versegap{\hspace{1pt minus.5pt}}
\newcommand\versesep{\versegap\textbullet\versegap}
\textwidth3in
\begin{document}
God created the heavens and the earth,\versesep the earth was a formless void and
xxxGod created the heavens and the earth,\versesep the earth was a formless void and
xxxxxxGod created the heavens and the earth,\versesep the earth was a formless void and
\end{document}
如果您想要避免在项目符号后出现换行符,那么可以使用这种变体:
\documentclass{article}
\def\versegap{\hspace{1pt minus.5pt}}
\def\versekern{\kern\glueexpr1pt minus.5pt\relax}
\newcommand\versesep{\versegap\textbullet\versekern\nobreak}
\textwidth3in
\begin{document}
God created the heavens and the earth,\versesep the earth was a formless void and
xxxGod created the heavens and the earth,\versesep the earth was a formless void and
xxxxxxGod created the heavens and the earth,\versesep the earth was a formless void and
\end{document}