I would like to adjust the relative vertical alignment (baseline) of stretches of text; I'm aware of \lower, \raise and \raisebox, but as far as I can see those commands require / represent boxes and, as such, inhibit line breaking and hyphenation. Is it possible to shift the baseline (like it is possible to change e.g. font color by issuing a color... command) for the entire text that remains within a group, without using a box?

If that should not be possible, what kind of solutions are there that do not affect line breaking?

I'M trying to remain compatible with xelatex and luatex... so I guess it's an option.
– flowDec 9 '15 at 21:38

You might be able to overlap two paragraphs with different baselines and use \color{white} and \color{black} to turn off portions of text. That would only inhibit page breaking.
– John KormyloDec 9 '15 at 22:04

1 Answer
1

Here I've used two minipages side by side so that you can tell by the end that the baselines have returned to normal. On the left the region between the !! is raised by 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}

Thanks a lot! Just to clarify, I found that {\pdfliteral{ 1 0 0 1 0 -2 cm} for luatex is equivalent to \special{pdf:literal 1 0 0 1 0 -2 cm} for xelatex. Now I'll google to find out what the numbers mean; especially puzzling is the cm which certainly can't mean 'centimeters', no?
– flowDec 9 '15 at 23:29