# Lowtech latex solution for simulated indentation?

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?

• Do you mean something like \hspace{\widthof{.....}}? – Michael Fraiman Jun 20 '17 at 13:27
• Thanks. This helps, too, though it is not as "local" as the anwer accepted, due to its use of the (otherwise useful) calc package. Related: tex.stackexchange.com/a/18577/133810 – Peter Heinig Jun 20 '17 at 18:07

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

perhaps one of these

\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}

• 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