I am typesetting a mnemonic for remembering values of pi. For this I want the number of characters in the word to appear on the next line aligned with where word starts. I have tried both tabular
and align
but both of them do not preserve the spacing in the sentence structure as shown in MWE. The tabular gives sightly better results. Is there a way to typeset this so that sentence appears as in regular text and the numbers get alinged with them in the next line?
What is required:
MWE
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\text{May} & \text{I} & \text{have} & \text{a} & \text{large} & \text{container} & \text{of} & \text{coffee?} \\
3 & 1 & 4 & 1 & 5 & 9 & 2 & 6
\end{align*}
\begin{tabular}{llllllll}
May & I & have & a & large & container & of & coffee? \\
3 & 1 & 4 & 1 & 5 & 9 & 2 & 6\\
\end{tabular}
\end{document}
Best Answer
You only need the package
dvgloss
and use\gl{May I have}{3 1 4}
. A not so minimal example: