所有单词间距相等

所有单词间距相等

我想创建一个可以手动注释的文档(即用铅笔在每个单词上方书写),但不幸的是,单词长度并不能很好地指示注释的长度。我希望将每个单词视为长度相同,以便一个单词的末尾和下一个单词的开头之间的空格下一个词是一样的。我希望我能说清楚这一点:

前:

Some sample text to indicate what I mean.

后:

     Some    sample    text      to       indicate       what         I          mean.

请注意,较短的单词(例如to和)I之间的空格要大得多,以弥补其较短的长度。感谢您的帮助。

答案1

因为单词间距相等,所以它们像数组一样排列,除非我打开\parindent\centering。我还添加了\doublespacingfrom setspace,因为整个想法是为了有注释的空间。

适用于各个段落。请勿在数学模式下尝试此操作。可选参数允许设置所需的字宽。

使用此解决方案,\fixlen将调用递归例程\fixlenpar,它将按每次筛选一个段落的数据,直到#1用完所有段落。它将每个段落传递给\fixlenword,这也是一个递归例程,按每次筛选一个单词的顺序筛选每个连续段落#1。对于每个单词,它将放置在固定宽度、居中的对齐中\makebox

\documentclass{article}
\newcommand\fixlen[2][10ex]{\def\fixwidth{#1}\fixlenpar#2\par\relax}
\long\def\fixlenpar#1\par#2\relax{%
  \fixlenword#1 \relax%
  \ifx\relax#2\relax\def\next{}\else\par\def\next{\fixlenpar#2\relax}\fi\next}
\def\fixlenword#1 #2\relax{%
  \makebox[\fixwidth][c]{#1}%
  \ifx\relax#2\relax\def\next{}\else\ \def\next{\fixlenword#2\relax}\fi\next}

\parindent0pt\relax
\parskip 1em\relax
\usepackage{setspace}
\doublespacing
\begin{document}
\fixlen{%
I want to create a document which I can annotate by hand (that is, write above each word in pencil), but, unfortunately, the word length isn't a good indicator of how long the annotation is. I would like to have each word treated as if they were all of the same length so that the space between the end of one word and the start of the next, next word is the same. I hope I can make this clear

Before:

Some sample text to indicate what I mean.

Note that shorter words, such as to and I have much larger spaces between the words to compensate for their shorter length. Thanks for any help.}

\end{document}

在此处输入图片描述

答案2

字间距由三个参数控制:(\fontdimen2正常字间距)、\fontdimen3(字间距的拉伸量)和\fontdimen4(收缩量)。因此,一种可能性是根据需要更改这些参数。

\documentclass{article}
\begin{document}

\spaceskip=8\fontdimen2\font plus 1.5\fontdimen3\font
minus 1.5\fontdimen4\font

Some sample text to indicate what I mean.

\end{document}

在此处输入图片描述

相关内容