Am 09.07.10 13:13, schrieb Michael Murphy:
On 09/07/10 01:32, Michael Goerz wrote:
Hi everyone,
I'm trying to do some horizontal alignment, for typesetting poetry. How would you solve this kind of problem? I've considered defining a macro \BrokenLine[line1][line2] that does the above. But, there are also instances where there are two or more lines as a continuation of one previous line. Maybe there is a possibility to mark a horizontal position temporarily, and then jump to that position later?
Didn't know you were into ConTeXt...
Anyway, this is a crappy solution and you could probably make it better. As far as I'm aware, there is no way to get the current horizontal position across the page at any particular moment. The method below essentially just measures the length of the line that you want to enter, and sets this as the indent.
\dimendef\indentl=10
\def\savewidth#1{% \setbox0=\hbox{#1}% \copy0% \indentl=\wd0% }
\def\addtosavewidth#1{% \setbox0=\hbox{#1}% \mindent\copy0% \advance\indentl by \wd0% }
\def\mindent{\hskip\indentl}
Nice solution but you can improve it with a few context functions: \newdimen\indentleft \def\savewidth {\dowithnextbox {\indentleft\nextboxwd \copy\nextbox} \hbox} \def\addtosavewidth {\dowithnextbox {\mindent\copy\nextbox \advance\indentleft\nextboxwd} \hbox} \def\mindent{\hskip\indentleft} A different solution is to store the end of the last line in one run and reuse this value in the next: \def\SKIP {\doglobal\increment\SKIPcount \xypos{NP:\SKIPcount}% \par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax} \def\LASTSKIP {\par\hskip\dimexpr\MPx{NP:\SKIPcount}-\MPx{text:\realfolio}\relax} \starttext \startlines here we now see you ~~ already in grief as you see ~~ yourselves ~~ as the last of the lasts we are mirrors of your consciousness \SKIP as you see the end and you see us ~~ deep \SKIP in \SKIP the spring \LASTSKIP of the universe seeing you deep ~~ in the gravity well of the heat death \stoplines \stoptext Wolfgang