不使用盒子是否可以垂直移动基线?

不使用盒子是否可以垂直移动基线?

我想调整文本段的相对垂直对齐(基线);我知道\lower\raise和,但据我所知,这些命令需要 / 代表框,因此会禁止换行和连字。是否可以在不使用框的情况下移动组内整个文本的\raisebox基线(例如,可以通过发出命令来更改字体颜色)?color...

如果这不可能的话,有哪些不影响换行的解决方案?

答案1

这使用 pdftex \pdfliteral,但你可以使用 xetex 的特殊版本

在此处输入图片描述

这里我并排使用了两个小页面,这样你最后就能看出基线已经恢复正常了。左边的区域!!升高了 2bp

\documentclass{article}
\begin{document}

\centering
\begin{minipage}[t]{.43\linewidth}
One two three four one two three four.
One two three four one two three four.
One two three four one two three four.
\pdfliteral{ 1 0  0 1 0 2 cm}%
!!One two three four one two three four.
One two three!!\pdfliteral{ 1 0  0 1 0 -2 cm} four one two three four.
One two three four one two three four.
One two three four one two three four.
One two three four one two three four.
\end{minipage}
\begin{minipage}[t]{.43\linewidth}
One two three four one two three four.
One two three four one two three four.
One two three four one two three four.
!!One two three four one two three four.
One two three!! four one two three four.
One two three four one two three four.
One two three four one two three four.
One two three four one two three four.
\end{minipage}

\end{document}

相关内容