0

Vague open-ended question: it can be useful, at least temporarily and pragmatically, to "simulate" indentations and alignments with as little beginend-, command-, documentclass-, package- and command-overhead as possible.

What do you consider a "good", "robust" way to do so, in LaTeX?

More precise tweak to the question: what do you consider a simple and robust way to tell LaTeX "now insert a horizontal spaces of length precisely lengthof{textpossiblywithsomemathematicsinit}:?

Example of some sort of a solution, but not a good one, it seems to me, due to the use of \textcolor:

This is a line of text containing the greek letter $\pi$.\\
\textcolor{white}{This is a line of text containing the greek letter $\pi$.}And this is a text disjoint from the orthogonal projection of the preceding line of text.

It seems to be preferable to have something like "commandtotakethelengthof(This is a line of text containing the greek letter $\pi$.). Do you think there is a preferred simplest solution?

1 Answers1

2

Not really very clear what you want, but certainly don't use colour for this.

perhaps one of these

enter image description here

\documentclass{article}

\begin{document}

\csname @hangfrom\endcsname{This is a line of text containing the greek letter $\pi$. }%
And this is a text disjoint from the orthogonal projection of the preceding line of text.

\newcommand\zz[1]{\noindent\sbox0{#1}\usebox0\par\noindent\hspace*{\wd0}\ignorespaces}
\zz{This is a line of text containing the greek letter $\pi$.}
And this is a text disjoint from the orthogonal projection of the preceding line of text.


\end{document}
David Carlisle
  • 757,742
  • Many thanks, the second solution you give does what I was looking for; in particular, it does not use a special package, like calc, useful though this is. – Peter Heinig Jun 20 '17 at 18:05