How to typeset a line as if it had zero height
Dear all, I have this simple MWE : \starttext \startsection[title=Section] \startalignment[flushright]Line.\stopalignment %% how to make this « 0 height » ? \input knuth \stopsection \stoptext How can I, with ConTeXt or plain TeX, modify this simple example to typeset the text above as if the right aligned line (‘Line’ just below the section) had 0 height (ie the main paragraph with knuth quot is just after the section without blank line) ? By « 0 height » I mean it takes no vertical space but it is still typeset. I hope my question makes sense. Thanks a lot for any insiight. Best regards Joseph Canedo
Joseph, I have come up with this very plain TeXy solution. Cheers, Henri --- \starttext \startsection[title=Section] \dontleavehmode% manually start a paragraph (smash does not) \smash{% remove height \rlap{% remove width \raise \baselineskip \hbox to \textwidth{% shift one line back \rightaligned{Line}% typset right aligned }% }% }% \input knuth \stopsection \stoptext On 08/02/2016 10:16 PM, Joseph Canedo wrote:
Dear all,
I have this simple MWE :
\starttext
\startsection[title=Section]
\startalignment[flushright]Line.\stopalignment %% how to make this « 0 height » ?
\input knuth
\stopsection
\stoptext
How can I, with ConTeXt or plain TeX, modify this simple example to typeset the text above as if the right aligned line (‘Line’ just below the section) had 0 height (ie the main paragraph with knuth quot is just after the section without blank line) ? By « 0 height » I mean it takes no vertical space but it is still typeset.
I hope my question makes sense.
Thanks a lot for any insiight.
Best regards
Joseph Canedo
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Henri Menke mailto:henrimenke@gmail.com 2. August 2016 um 23:40 Joseph,
I have come up with this very plain TeXy solution.
Cheers, Henri
---
\starttext
\startsection[title=Section]
\dontleavehmode% manually start a paragraph (smash does not) \smash{% remove height \rlap{% remove width \raise \baselineskip \hbox to \textwidth{% shift one line back \rightaligned{Line}% typset right aligned }% }% }% \input knuth
\stopsection
\stoptext You can use \offset to shift the text to a different position.
\define[1]\MoveText {\dontleavehmode\offset[width=0pt,height=0pt,y=-\lineheight]{\rightaligned{#1}}\GotoPar} \starttext \startsection[title=Section] \MoveText{Line} \input knuth \stopsection \stoptext Wolfgang
participants (3)
-
Henri Menke
-
Joseph Canedo
-
Wolfgang Schuster