ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* shrink inter-line space
@ 2021-12-17 15:28 mf via ntg-context
  2021-12-17 19:17 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: mf via ntg-context @ 2021-12-17 15:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mf

Hello list,
here's a MWE to shrink the distance between two lines:

\starttext
\samplefile{ward}\par
\blank
\bgroup
\baselineskip=0pt
\samplefile{ward}\par
\egroup
\stoptext

How can I get lines closer, even overlapping?

Massi
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: shrink inter-line space
  2021-12-17 15:28 shrink inter-line space mf via ntg-context
@ 2021-12-17 19:17 ` Wolfgang Schuster via ntg-context
  2021-12-18  8:47   ` mf via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-12-17 19:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mf via ntg-context; +Cc: Wolfgang Schuster

mf via ntg-context schrieb am 17.12.2021 um 16:28:
> Hello list,
> here's a MWE to shrink the distance between two lines:
>
> \starttext
> \samplefile{ward}\par
> \blank
> \bgroup
> \baselineskip=0pt
> \samplefile{ward}\par
> \egroup
> \stoptext
>
> How can I get lines closer, even overlapping?

\starttext

\samplefile{ward}\par

\blank

\start \setupinterlinespace[line=12pt]
\samplefile{ward}\par
\stop

\stoptext

Wolfgang

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: shrink inter-line space
  2021-12-17 19:17 ` Wolfgang Schuster via ntg-context
@ 2021-12-18  8:47   ` mf via ntg-context
  2021-12-18 11:53     ` Hans Hagen via ntg-context
  2021-12-18 12:00     ` Wolfgang Schuster via ntg-context
  0 siblings, 2 replies; 7+ messages in thread
From: mf via ntg-context @ 2021-12-18  8:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mf

Il 17/12/21 20:17, Wolfgang Schuster ha scritto:> \starttext
 >
 > \samplefile{ward}\par
 >
 > \blank
 >
 > \start \setupinterlinespace[line=12pt]
 > \samplefile{ward}\par
 > \stop
 >
 > \stoptext
Yes, but you can't say \setupinterlinespace[line=6pt] and make lines 
overlap. At a certain point baselines don't get closer any more.

----------------------------------------------
\starttext

\samplefile{ward}\par

\blank

\start \setupinterlinespace[line=12pt]
\samplefile{ward}\par
\stop

\blank

\start \setupinterlinespace[line=6pt]
\samplefile{ward}\par
\stop

\stoptext
----------------------------------------------

You can do something like this:

----------------------------------------------
\starttext

\samplefile{ward}\par

\blank

\start \setupinterlinespace[line=12pt]
\samplefile{ward}\par
\stop

\blank

The Earth, as a habitat for animal life, is in old age and has a fatal 
illness.\vadjust{\kern-6pt}
Several, in fact. It would be happening whether humans had ever evolved 
or not.\vadjust{\kern-6pt}
But our presence is like the effect of an old-age patient who smokes 
many packs\vadjust{\kern-6pt}
of cigarettes per day—and we humans are the cigarettes.

\stoptext
----------------------------------------------

but I had to insert all those \kern-6pt manually.
How can I obtain the same result automatically?
(please don't argue about the ugliness of the result ;) )

Massi
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: shrink inter-line space
  2021-12-18  8:47   ` mf via ntg-context
@ 2021-12-18 11:53     ` Hans Hagen via ntg-context
  2021-12-18 12:00     ` Wolfgang Schuster via ntg-context
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2021-12-18 11:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 12/18/2021 9:47 AM, mf via ntg-context wrote:
> Il 17/12/21 20:17, Wolfgang Schuster ha scritto:> \starttext
>  >
>  > \samplefile{ward}\par
>  >
>  > \blank
>  >
>  > \start \setupinterlinespace[line=12pt]
>  > \samplefile{ward}\par
>  > \stop
>  >
>  > \stoptext
> Yes, but you can't say \setupinterlinespace[line=6pt] and make lines 
> overlap. At a certain point baselines don't get closer any more.
> 
> ----------------------------------------------
> \starttext
> 
> \samplefile{ward}\par
> 
> \blank
> 
> \start \setupinterlinespace[line=12pt]
> \samplefile{ward}\par
> \stop
> 
> \blank
> 
> \start \setupinterlinespace[line=6pt]
> \samplefile{ward}\par
> \stop
> 
> \stoptext
> ----------------------------------------------
> 
> You can do something like this:
> 
> ----------------------------------------------
> \starttext
> 
> \samplefile{ward}\par
> 
> \blank
> 
> \start \setupinterlinespace[line=12pt]
> \samplefile{ward}\par
> \stop
> 
> \blank
> 
> The Earth, as a habitat for animal life, is in old age and has a fatal 
> illness.\vadjust{\kern-6pt}
> Several, in fact. It would be happening whether humans had ever evolved 
> or not.\vadjust{\kern-6pt}
> But our presence is like the effect of an old-age patient who smokes 
> many packs\vadjust{\kern-6pt}
> of cigarettes per day—and we humans are the cigarettes.
> 
> \stoptext
> ----------------------------------------------
> 
> but I had to insert all those \kern-6pt manually.
> How can I obtain the same result automatically?
> (please don't argue about the ugliness of the result ;) )

there is no real need to argue because it *is* ugly -)

so say that you choose 6pt interlinespace ... which means that all lines 
will likely touch

in that case tex will inject lineskip (assuming that you didn't disable it)

and as tex doesn't care about results being ugly (plenty of examples of 
that on the internet) it will happily insert a negative skip when you do 
this:

\start \setupinterlinespace[line=6pt]
\lineskip-6pt
\samplefile{ward}\par
\stop

now, of course, this will not be pretty when heights and depths differ 
per line so here's another way:

\start
     \setbox\scratchbox\vbox{\samplefile{ward}}
     \dorecurse {\boxlines\scratchbox} {
         \boxlineht\scratchbox#1 2pt % 4pt
         \boxlinedp\scratchbox#1 1pt % 2pt
         \nointerlineskip
         \boxline  \scratchbox#1
         \par
     }
\stop

so ... in tex there's always a way out

Hans



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: shrink inter-line space
  2021-12-18  8:47   ` mf via ntg-context
  2021-12-18 11:53     ` Hans Hagen via ntg-context
@ 2021-12-18 12:00     ` Wolfgang Schuster via ntg-context
  2021-12-20 11:06       ` definedfont vs switchtobodyfont (was "shrink inter-line space") mf via ntg-context
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-12-18 12:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mf via ntg-context; +Cc: Wolfgang Schuster

mf via ntg-context schrieb am 18.12.2021 um 09:47:
> Il 17/12/21 20:17, Wolfgang Schuster ha scritto:> \starttext
> >
> > \samplefile{ward}\par
> >
> > \blank
> >
> > \start \setupinterlinespace[line=12pt]
> > \samplefile{ward}\par
> > \stop
> >
> > \stoptext
> Yes, but you can't say \setupinterlinespace[line=6pt] and make lines 
> overlap. At a certain point baselines don't get closer any more.
>
> ----------------------------------------------
> \starttext
>
> \samplefile{ward}\par
>
> \blank
>
> \start \setupinterlinespace[line=12pt]
> \samplefile{ward}\par
> \stop
>
> \blank
>
> \start \setupinterlinespace[line=6pt]
> \samplefile{ward}\par
> \stop
>
> \stoptext
> ----------------------------------------------
>
> You can do something like this:
>
> ----------------------------------------------
> \starttext
>
> \samplefile{ward}\par
>
> \blank
>
> \start \setupinterlinespace[line=12pt]
> \samplefile{ward}\par
> \stop
>
> \blank
>
> The Earth, as a habitat for animal life, is in old age and has a fatal 
> illness.\vadjust{\kern-6pt}
> Several, in fact. It would be happening whether humans had ever 
> evolved or not.\vadjust{\kern-6pt}
> But our presence is like the effect of an old-age patient who smokes 
> many packs\vadjust{\kern-6pt}
> of cigarettes per day—and we humans are the cigarettes.
>
> \stoptext
> ----------------------------------------------
>
> but I had to insert all those \kern-6pt manually.
> How can I obtain the same result automatically?
> (please don't argue about the ugliness of the result ;) )


TeX prevents overlapping line but you cheat and modify the dimensions of 
all characters.

The following example set the height and depth to 0 ex for all character 
in the current font (I used \definedfont to keep it local to the group) 
and now you can change the interlinespace to whatever value you like.


\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
     \setupinterlinespace[line=5pt]
     \definedfont[Normal*default,tightlines]
     \samplefile{ward}\par
\stop

\stoptext

Wolfgang

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: definedfont vs switchtobodyfont (was "shrink inter-line space")
  2021-12-18 12:00     ` Wolfgang Schuster via ntg-context
@ 2021-12-20 11:06       ` mf via ntg-context
  2021-12-20 11:19         ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: mf via ntg-context @ 2021-12-20 11:06 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users; +Cc: mf

Il 18/12/21 13:00, Wolfgang Schuster ha scritto:
> \definefontfeature [tightlines] [dimensions={*,0,0}]
> 
> \starttext
> 
> \samplefile{ward}\par
> 
> \blank
> 
> \start
>      \setupinterlinespace[line=5pt]
>      \definedfont[Normal*default,tightlines]
>      \samplefile{ward}\par
> \stop
> 
> \stoptext
> 

Thanks Wolfgang.

I tried this:

\definefontfeature [tightlines] [dimensions={*,0,0}]

\starttext

\samplefile{ward}\par

\blank

\start
     \setupinterlinespace[line=5pt]
     \feature[+][tightlines]
     \samplefile{ward}\par
\stop

\stoptext

but it doesn't add the feature to the current font.
I understand I need a font switch.
Usually I use \switchtobodyfont. How is \definedfont different?

Massi
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: definedfont vs switchtobodyfont (was "shrink inter-line space")
  2021-12-20 11:06       ` definedfont vs switchtobodyfont (was "shrink inter-line space") mf via ntg-context
@ 2021-12-20 11:19         ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen via ntg-context @ 2021-12-20 11:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Wolfgang Schuster; +Cc: Hans Hagen

On 12/20/2021 12:06 PM, mf via ntg-context wrote:
> Il 18/12/21 13:00, Wolfgang Schuster ha scritto:
>> \definefontfeature [tightlines] [dimensions={*,0,0}]
>>
>> \starttext
>>
>> \samplefile{ward}\par
>>
>> \blank
>>
>> \start
>>      \setupinterlinespace[line=5pt]
>>      \definedfont[Normal*default,tightlines]
>>      \samplefile{ward}\par
>> \stop
>>
>> \stoptext
>>
> 
> Thanks Wolfgang.
> 
> I tried this:
> 
> \definefontfeature [tightlines] [dimensions={*,0,0}]
> 
> \starttext
> 
> \samplefile{ward}\par
> 
> \blank
> 
> \start
>      \setupinterlinespace[line=5pt]
>      \feature[+][tightlines]
>      \samplefile{ward}\par
> \stop
> 
> \stoptext
> 
> but it doesn't add the feature to the current font.
> I understand I need a font switch.
> Usually I use \switchtobodyfont. How is \definedfont different?
it's a 'permanent' one ... so when the font is loaded the dimensions are 
adapted so you need a new font definition

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-12-20 11:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-17 15:28 shrink inter-line space mf via ntg-context
2021-12-17 19:17 ` Wolfgang Schuster via ntg-context
2021-12-18  8:47   ` mf via ntg-context
2021-12-18 11:53     ` Hans Hagen via ntg-context
2021-12-18 12:00     ` Wolfgang Schuster via ntg-context
2021-12-20 11:06       ` definedfont vs switchtobodyfont (was "shrink inter-line space") mf via ntg-context
2021-12-20 11:19         ` Hans Hagen via ntg-context

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).