ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to typeset a line as if it had zero height
@ 2016-08-02 20:16 Joseph Canedo
  2016-08-02 21:40 ` Henri Menke
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph Canedo @ 2016-08-02 20:16 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 652 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2500 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to typeset a line as if it had zero height
  2016-08-02 20:16 How to typeset a line as if it had zero height Joseph Canedo
@ 2016-08-02 21:40 ` Henri Menke
  2016-08-03 14:11   ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Henri Menke @ 2016-08-02 21:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
> ___________________________________________________________________________________
> 

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to typeset a line as if it had zero height
  2016-08-02 21:40 ` Henri Menke
@ 2016-08-03 14:11   ` Wolfgang Schuster
       [not found]     ` <57a24a76.47cbc20a.13c7.3dde@mx.google.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2016-08-03 14:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 777 bytes --]

> 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

[-- Attachment #1.2: Type: text/html, Size: 1869 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to typeset a line as if it had zero height
       [not found]     ` <57a24a76.47cbc20a.13c7.3dde@mx.google.com>
@ 2016-08-04  4:56       ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2016-08-04  4:56 UTC (permalink / raw)
  To: Joseph Canedo; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 561 bytes --]

> Joseph Canedo <mailto:josephcanedo@gmail.com>
> 3. August 2016 um 21:48
>
> Thanks Wolfgang, out of curiosity what does \GotoPar macro ? Is this 
> similar to \ignorespaces ?
>
The \GotoPar removes the following \par or empty line to ensure the 
previous and the following text stay on the same line.

%%%% begin example
\define\RuleOne{\dontleavehmode\blackrule[width=4cm,color=orange]}
\define\RuleTwo{\dontleavehmode\blackrule[width=4cm,color=yellow]\GotoPar}

\starttext

\RuleOne

\input ward

\RuleTwo

\input ward

\stoptext
%%%% end example

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2498 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-04  4:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 20:16 How to typeset a line as if it had zero height Joseph Canedo
2016-08-02 21:40 ` Henri Menke
2016-08-03 14:11   ` Wolfgang Schuster
     [not found]     ` <57a24a76.47cbc20a.13c7.3dde@mx.google.com>
2016-08-04  4:56       ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).