[NTG-context] Making \setupinterlinespace work with \switchtobodyfont

Pablo Rodriguez oinos at gmx.es
Thu Apr 30 16:10:32 CEST 2015


On 04/30/2015 02:18 PM, Pavneet Arora wrote:
> Hello,
> 
> I am trying to have inter-line space change according to the current 
> size of the body font, which I modify with \switchtobodyfont, but I 
> cannot seem to affect the desired change as per the MWE below.  
> \setupinterlinespace seems to take its lead from the original 
> \setupbodyfont directive in the document, and does not revise it even 
> when font size is changed.
> 
> Is there a prescribed method to properly use \setupinterlinespace (or 
> for that matter \setupwhitespace when switching font sizes?

Hi Paavnet,

yes, you need a paragraph to make \setupinterlinespace work.

Your improved sample:

    \setuppagenumbering[location=,state=stop]

    \definefontfamily[mainface][rm][Pagella]
    \definefontfamily[mainface][ss][Heros]
    \definefontfamily[mainface][mm][Latin Modern Math]
    \setupbodyfont[mainface,72pt]
    \setupinterlinespace

    \starttext
    \startalignment[center]
    The Title
    \blank
    {\switchtobodyfont[36pt]\setupinterlinespace%
    Subtitle line 1\\
    Subtitle line 2\par}
    \blank
    {\switchtobodyfont[18pt]\setupinterlinespace%
    Sub-subtitle line 1\\
    Sub-subtitle line 2\par}
    \stopalignment
    \stoptext

I hope it helps,


Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list