100 英文排版如何设置标点符号后的空白

发布于 2022-10-17 13:33:39

排版英文文档时,我想在标点符号后面增加一点点空白。用fontspec包设置字体时可用PunctuationSpace调整句点等符号后的空白,但对逗号不起作用。

\documentclass{article}
\usepackage{fontspec}
\begin{document}
  \fontspec[PunctuationSpace=2]{Latin Modern Roman}
  I can eat glass, it doesn't hurt me. I can eat glass, it doesn't hurt me.

  \fontspec[PunctuationSpace=10]{Latin Modern Roman}
  I can eat glass, it doesn't hurt me. I can eat glass, it doesn't hurt me.
\end{document}

image.png

如何统一调整标点符号后的空白?

查看更多

关注者
0
被浏览
2.9k
雾月
雾月 2022-10-17
这家伙很懒,什么也没写!

实际上,PunctuationSpace 设置的是 \fontdimen7 的值。只有两个词中间的 \spacefactor 大于等于 2000 时,才会使用到这个值(即增加设置的这个间距)。

但是,一般情况下,;, 的 space factor 都是小于 2000 的,所以它们并不会像其它标点一样增加间距。

只要设置它们的 space factor 大于等于 2000 即可。比如:

\sfcode`\;2500 \sfcode`\,2250 

如果整篇文章的标点都要增加额外的间距的话,最好是重定义 \nonfrechspacing

\DeclareRobustCommand\nonfrenchspacing{\sfcode`\.3000 \sfcode`\?3000
  \sfcode`\!3000 \sfcode`\:2750 \sfcode`\;2500 \sfcode`\,2250 }

image.png

\documentclass{article}
\usepackage{fontspec}

\DeclareRobustCommand\nonfrenchspacing{\sfcode`\.3000 \sfcode`\?3000
  \sfcode`\!3000 \sfcode`\:2750 \sfcode`\;2500 \sfcode`\,2250 }
\nonfrenchspacing

\begin{document}

I can eat glass, it doesn't hurt me. I can eat glass, it doesn't hurt me.

\fontspec[PunctuationSpace=2]{Latin Modern Roman}
I can eat glass, it doesn't hurt me. I can eat glass, it doesn't hurt me.

\fontspec[PunctuationSpace=10]{Latin Modern Roman}
I can eat glass, it doesn't hurt me. I can eat glass, it doesn't hurt me.

\end{document}

要注意的是,如果标点符号前是大写字母,且并非缩写(比如 B.C. 这种),则需正确设置标点符号前的 space factor:

It is NASA. It is NASA\@. 
It is nasa. It is nasa.

image.png

1 个回答

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览