ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* First line of larger font paragraph on grid
@ 2021-06-25 10:30 denis.maier
  2021-06-26 10:30 ` Garulfo
  2021-06-26 10:37 ` Garulfo
  0 siblings, 2 replies; 5+ messages in thread
From: denis.maier @ 2021-06-25 10:30 UTC (permalink / raw)
  To: ntg-context


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

Hi,

I have some text in a larger font where the first line should be on the grid. Therefore, I've tried to adapt the solution from the wiki: https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid

The interesting thing is that the section command indeed places the first line on the grid, but using \framed directly does not give the desired results.

I must be missing something obvious. Does anyone know a solution ?

Thanks for your help,
Denis

===================================
\setuplayout[grid=yes]
\showgrid

\definefont  [BigFont]  [Bold at 20pt] [24pt]

\unprotect
\unexpanded\def\section_command#1#2{%
  \framed [
       width=\textwidth,
                   frame=off,
                   rulethickness=0pt,
                   offset=0pt,
                   loffset=-0pt,
       before=,
       location=top,
       align=flushleft,]{#2}%
}


\setuphead [section] [
    style={\BigFont},
    after=,
   before={\blank[1*line]},
  command=\section_command,
]
\protect

\defineframed[myframed][
                   width=\textwidth,
                   frame=off,
                   rulethickness=0pt,
                   offset=0pt,
                   loffset=-0pt,
       before=,
       location=top,
       align=flushleft,]]

\starttext

\blank[force,3*line,depth]

\begingroup
\BigFont
\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing elit}
\endgroup

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
      asdf
\stopsection

\stoptext
=========================================




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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: First line of larger font paragraph on grid
  2021-06-25 10:30 First line of larger font paragraph on grid denis.maier
@ 2021-06-26 10:30 ` Garulfo
  2021-06-26 10:37 ` Garulfo
  1 sibling, 0 replies; 5+ messages in thread
From: Garulfo @ 2021-06-26 10:30 UTC (permalink / raw)
  To: ntg-context

A proposal

===================================

\setuplayout[grid=yes]
\showgrid

\definefont  [BigFont]  [Bold at 20pt] [28pt]

\unprotect
\unexpanded\def\section_command#1#2{%
   \framed [
        width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        before=,
        location=top,
        align=flushleft,]{#2}%
}


\setuphead [section] [
     style={\BigFont},
     after=,
    before={\blank[1*line]},
   command=\section_command,
]
\protect

\definefontsize[e]                          %   <==== added
\definebodyfontenvironment [12pt] [e=20pt]  %   <==== added

\defineframed[myframed][
                    width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        foregroundstyle=\bfe,                %   <==== added
        strut=yes,                           %   <==== added
        before=,
        location=top,
        align=flushleft,]                    %   <==== removed dupl "]"

\starttext

\blank[force,3*line,depth]

%\begingroup                                %   <==== removed
%\BigFont                                   %   <==== removed
\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem 
ipsum dolor sit amet consectetur adipisicing elit}
%\endgroup                                  %   <==== removed

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing 
elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
       asdf
\stopsection

\stoptext

Le 25/06/2021 à 12:30, denis.maier@unibe.ch a écrit :
> Hi,
> 
> I have some text in a larger font where the first line should be on the 
> grid. Therefore, I’ve tried to adapt the solution from the wiki: 
> https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid 
> <https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid>
> 
> The interesting thing is that the section command indeed places the 
> first line on the grid, but using \framed directly does not give the 
> desired results.
> 
> I must be missing something obvious. Does anyone know a solution ?
> 
> Thanks for your help,
> 
> Denis
> 
> ===================================
> 
> \setuplayout[grid=yes]
> 
> \showgrid
> 
> \definefont  [BigFont]  [Bold at 20pt] [24pt]
> 
> \unprotect
> 
> \unexpanded\def\section_command#1#2{%
> 
> \framed [
> 
>         width=\textwidth,
> 
>                     frame=off,
> 
>                     rulethickness=0pt,
> 
>                     offset=0pt,
> 
>                     loffset=-0pt,
> 
>         before=,
> 
>         location=top,
> 
>         align=flushleft,]{#2}%
> 
> }
> 
> \setuphead [section] [
> 
>      style={\BigFont},
> 
> after=,
> 
>     before={\blank[1*line]},
> 
>    command=\section_command,
> 
> ]
> 
> \protect
> 
> \defineframed[myframed][
> 
>                     width=\textwidth,
> 
>                     frame=off,
> 
>                     rulethickness=0pt,
> 
>                     offset=0pt,
> 
> loffset=-0pt,
> 
>         before=,
> 
>         location=top,
> 
> align=flushleft,]]
> 
> \starttext
> 
> \blank[force,3*line,depth]
> 
> \begingroup
> 
> \BigFont
> 
> \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem 
> ipsum dolor sit amet consectetur adipisicing elit}
> 
> \endgroup
> 
> asdfasdf
> 
> \page
> 
> \blank[force,3*line,depth]
> 
> \startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing 
> elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
> 
> asdf
> 
> \stopsection
> 
> \stoptext
> 
> =========================================
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 
___________________________________________________________________________________
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] 5+ messages in thread

* Re: First line of larger font paragraph on grid
  2021-06-25 10:30 First line of larger font paragraph on grid denis.maier
  2021-06-26 10:30 ` Garulfo
@ 2021-06-26 10:37 ` Garulfo
  2021-06-27 14:57   ` denis.maier
  1 sibling, 1 reply; 5+ messages in thread
From: Garulfo @ 2021-06-26 10:37 UTC (permalink / raw)
  To: ntg-context

To have the two pages similar

There is something linked with the use of \definefont.
Don't know if it properly impacts the interlinespace for example.

%----------------------------------------------

\setuplayout[grid=yes]
\showgrid

\definefont  [BigFont]  [Bold at 20pt] [28pt]

\definefontsize[e]                          %   <==== added
\definebodyfontenvironment [12pt] [e=20pt]  %   <==== added

\unprotect
\unexpanded\def\section_command#1#2{%
   \framed [
        width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        before=,
        location=top,
        align=flushleft,]{#2}%
}


\setuphead [section] [
     style=\bfe,
     after=,
    before={\blank[1*line]},
   command=\section_command,
]
\protect


\defineframed[myframed][
                    width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        foregroundstyle=\bfe,                %   <==== added
        strut=yes,                           %   <==== added
        before=,
        location=top,
        align=flushleft,]                    %   <==== removed dup "]"

\starttext

\blank[force,3*line,depth]

%\begingroup                                %   <==== removed
%\BigFont                                   %   <==== removed
\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem 
ipsum dolor sit amet consectetur adipisicing elit}
%\endgroup                                  %   <==== removed

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing 
elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
       asdf
\stopsection

\stoptext

%----------------------------------------------


Le 25/06/2021 à 12:30, denis.maier@unibe.ch a écrit :
> Hi,
> 
> I have some text in a larger font where the first line should be on the 
> grid. Therefore, I’ve tried to adapt the solution from the wiki: 
> https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid 
> <https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_grid>
> 
> The interesting thing is that the section command indeed places the 
> first line on the grid, but using \framed directly does not give the 
> desired results.
> 
> I must be missing something obvious. Does anyone know a solution ?
> 
> Thanks for your help,
> 
> Denis
> 
> ===================================
> 
> \setuplayout[grid=yes]
> 
> \showgrid
> 
> \definefont  [BigFont]  [Bold at 20pt] [24pt]
> 
> \unprotect
> 
> \unexpanded\def\section_command#1#2{%
> 
> \framed [
> 
>         width=\textwidth,
> 
>                     frame=off,
> 
>                     rulethickness=0pt,
> 
>                     offset=0pt,
> 
>                     loffset=-0pt,
> 
>         before=,
> 
>         location=top,
> 
>         align=flushleft,]{#2}%
> 
> }
> 
> \setuphead [section] [
> 
>      style={\BigFont},
> 
> after=,
> 
>     before={\blank[1*line]},
> 
>    command=\section_command,
> 
> ]
> 
> \protect
> 
> \defineframed[myframed][
> 
>                     width=\textwidth,
> 
>                     frame=off,
> 
>                     rulethickness=0pt,
> 
>                     offset=0pt,
> 
> loffset=-0pt,
> 
>         before=,
> 
>         location=top,
> 
> align=flushleft,]]
> 
> \starttext
> 
> \blank[force,3*line,depth]
> 
> \begingroup
> 
> \BigFont
> 
> \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem 
> ipsum dolor sit amet consectetur adipisicing elit}
> 
> \endgroup
> 
> asdfasdf
> 
> \page
> 
> \blank[force,3*line,depth]
> 
> \startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing 
> elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
> 
> asdf
> 
> \stopsection
> 
> \stoptext
> 
> =========================================
> 
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 
___________________________________________________________________________________
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] 5+ messages in thread

* Re: First line of larger font paragraph on grid
  2021-06-26 10:37 ` Garulfo
@ 2021-06-27 14:57   ` denis.maier
  2021-06-28 10:55     ` denis.maier
  0 siblings, 1 reply; 5+ messages in thread
From: denis.maier @ 2021-06-27 14:57 UTC (permalink / raw)
  To: ntg-context

Thanks, Garulfo. I don't use \definedfont in my real document so I should be able to port it to my use case. And now I've learned about foregroundstyle. (I was already a bit perplexed that \framed has no style key.)

Just out of curiousity, perhaps someone (Hans? Wolfgang?) knows more about the underlying issue?

Denis

> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Garulfo
> Gesendet: Samstag, 26. Juni 2021 12:37
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> 
> To have the two pages similar
> 
> There is something linked with the use of \definefont.
> Don't know if it properly impacts the interlinespace for example.
> 
> %----------------------------------------------
> 
> \setuplayout[grid=yes]
> \showgrid
> 
> \definefont  [BigFont]  [Bold at 20pt] [28pt]
> 
> \definefontsize[e]                          %   <==== added
> \definebodyfontenvironment [12pt] [e=20pt]  %   <==== added
> 
> \unprotect
> \unexpanded\def\section_command#1#2{%
>    \framed [
>         width=\textwidth,
>                     frame=off,
>                     rulethickness=0pt,
>                     offset=0pt,
>                     loffset=-0pt,
>         before=,
>         location=top,
>         align=flushleft,]{#2}%
> }
> 
> 
> \setuphead [section] [
>      style=\bfe,
>      after=,
>     before={\blank[1*line]},
>    command=\section_command,
> ]
> \protect
> 
> 
> \defineframed[myframed][
>                     width=\textwidth,
>                     frame=off,
>                     rulethickness=0pt,
>                     offset=0pt,
>                     loffset=-0pt,
>         foregroundstyle=\bfe,                %   <==== added
>         strut=yes,                           %   <==== added
>         before=,
>         location=top,
>         align=flushleft,]                    %   <==== removed dup "]"
> 
> \starttext
> 
> \blank[force,3*line,depth]
> 
> %\begingroup                                %   <==== removed
> %\BigFont                                   %   <==== removed
> \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem
> ipsum dolor sit amet consectetur adipisicing elit}
> %\endgroup                                  %   <==== removed
> 
> asdfasdf
> 
> \page
> \blank[force,3*line,depth]
> 
> \startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit
> Lorem ipsum dolor sit amet consectetur adipisicing elit]
>        asdf
> \stopsection
> 
> \stoptext
> 
> %----------------------------------------------
> 
> 
> Le 25/06/2021 à 12:30, denis.maier@unibe.ch a écrit :
> > Hi,
> >
> > I have some text in a larger font where the first line should be on
> > the grid. Therefore, I’ve tried to adapt the solution from the wiki:
> > https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the_
> > grid
> > <https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_the
> > _grid>
> >
> > The interesting thing is that the section command indeed places the
> > first line on the grid, but using \framed directly does not give the
> > desired results.
> >
> > I must be missing something obvious. Does anyone know a solution ?
> >
> > Thanks for your help,
> >
> > Denis
> >
> > ===================================
> >
> > \setuplayout[grid=yes]
> >
> > \showgrid
> >
> > \definefont  [BigFont]  [Bold at 20pt] [24pt]
> >
> > \unprotect
> >
> > \unexpanded\def\section_command#1#2{%
> >
> > \framed [
> >
> >         width=\textwidth,
> >
> >                     frame=off,
> >
> >                     rulethickness=0pt,
> >
> >                     offset=0pt,
> >
> >                     loffset=-0pt,
> >
> >         before=,
> >
> >         location=top,
> >
> >         align=flushleft,]{#2}%
> >
> > }
> >
> > \setuphead [section] [
> >
> >      style={\BigFont},
> >
> > after=,
> >
> >     before={\blank[1*line]},
> >
> >    command=\section_command,
> >
> > ]
> >
> > \protect
> >
> > \defineframed[myframed][
> >
> >                     width=\textwidth,
> >
> >                     frame=off,
> >
> >                     rulethickness=0pt,
> >
> >                     offset=0pt,
> >
> > loffset=-0pt,
> >
> >         before=,
> >
> >         location=top,
> >
> > align=flushleft,]]
> >
> > \starttext
> >
> > \blank[force,3*line,depth]
> >
> > \begingroup
> >
> > \BigFont
> >
> > \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit
> > Lorem ipsum dolor sit amet consectetur adipisicing elit}
> >
> > \endgroup
> >
> > asdfasdf
> >
> > \page
> >
> > \blank[force,3*line,depth]
> >
> > \startsection [title=Lorem ipsum dolor sit amet consectetur
> > adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing
> > elit]
> >
> > asdf
> >
> > \stopsection
> >
> > \stoptext
> >
> > =========================================
> >
> >
> >
> ________________________________________________________________
> ______
> > _____________ 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
> >
> ________________________________________________________________
> ______
> > _____________
> >
> ________________________________________________________________
> ___________________
> 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
> ________________________________________________________________
> ___________________
___________________________________________________________________________________
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] 5+ messages in thread

* Re: First line of larger font paragraph on grid
  2021-06-27 14:57   ` denis.maier
@ 2021-06-28 10:55     ` denis.maier
  0 siblings, 0 replies; 5+ messages in thread
From: denis.maier @ 2021-06-28 10:55 UTC (permalink / raw)
  To: ntg-context

Ok, I've now tried to adapt my real document to this (see below). But I'm running into some problems:

1. I'm not sure whether to use \setuplocalinterlinespace or \setupinterlinespace. With \setuphead, \setuplocalinterlinespace works, but it doesn't work with \framed... But even with \setuphead it leads to results I didn't expect: \blank[force,3*line,depth] -> four empty lines instead of three.

2. foregroundstyle={\bfe\setupinterlinespace[line=17.5pt]} works sort of with the default fonts, i.e. the visuals are ok, but with \showstruts enabled, you see that the struts are incorrect. Now, with the font I have to use (Noto Serif Semicondensed ExtraBold at 15pt, with linespacing 17.5pt, available at http://www.google.com/get/noto/#serif-lgc) this shows up even visually: The letters are placed a tiny bit below the baseline.

Any ideas? Hints?

TIA,
Denis

%-------------------------------------------------------------
\setuplayout[grid=yes]
\showgrid
\showstruts

\definefont  [BigFont]  [Bold at 20pt] [28pt]

\definefontsize[e]                          %   <==== added
\definebodyfontenvironment [12pt] [e=20pt]  %   <==== added

\definebodyfontenvironment [10pt] [e=15pt]  %   <==== added dm
\definebodyfontenvironment [10pt] [interlinespace=14pt]  %   <==== added dm
%\definefontfamily[mainface][rm][Noto Serif]
%			[tf=file:NotoSerif-SemiCondensed.ttf] % <==== added dm
			
\setupbodyfont[mainface,10pt] % <==== added dm

\unprotect
\unexpanded\def\section_command#1#2{%
   \framed [
        width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        before=,
        location=top,
        align=flushleft,]{#2}%
}


\setuphead [section] [
     style=\bfe,
     %style={\bfe\setupinterlinespace[line=17.5pt]},
     style={\bfe\setuplocalinterlinespace[line=17.5pt]},
     after=,
    before=,
   command=\section_command,
]
\protect


\defineframed[myframed][
                    width=\textwidth,
                    frame=off,
                    rulethickness=0pt,
                    offset=0pt,
                    loffset=-0pt,
        foregroundstyle=\bfe,                %   <==== added
        foregroundstyle={\bfe\setupinterlinespace[line=17.5pt]},                %   <==== dm, added; does work partially; struts are incorrect
        foregroundstyle={\bfe\setuplocalinterlinespace[line=17.5pt]},           %   <==== dm, added; does not work
        strut=yes,                           %   <==== added
        before=,
        location=top,
        align=flushleft,]                  

\starttext

\blank[force,3*line,depth]

\myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing elit}

asdfasdf

\page
\blank[force,3*line,depth]

\startsection [title=Lorem ipsum dolor sit amet consectetur adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
       asdf
\stopsection

\stoptext%---------------------------------------------------------------------------------------------




> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von
> denis.maier@unibe.ch
> Gesendet: Sonntag, 27. Juni 2021 16:57
> An: ntg-context@ntg.nl
> Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> 
> Thanks, Garulfo. I don't use \definedfont in my real document so I should be
> able to port it to my use case. And now I've learned about foregroundstyle. (I
> was already a bit perplexed that \framed has no style key.)
> 
> Just out of curiousity, perhaps someone (Hans? Wolfgang?) knows more about
> the underlying issue?
> 
> Denis
> 
> > -----Ursprüngliche Nachricht-----
> > Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Garulfo
> > Gesendet: Samstag, 26. Juni 2021 12:37
> > An: ntg-context@ntg.nl
> > Betreff: Re: [NTG-context] First line of larger font paragraph on grid
> >
> > To have the two pages similar
> >
> > There is something linked with the use of \definefont.
> > Don't know if it properly impacts the interlinespace for example.
> >
> > %----------------------------------------------
> >
> > \setuplayout[grid=yes]
> > \showgrid
> >
> > \definefont  [BigFont]  [Bold at 20pt] [28pt]
> >
> > \definefontsize[e]                          %   <==== added
> > \definebodyfontenvironment [12pt] [e=20pt]  %   <==== added
> >
> > \unprotect
> > \unexpanded\def\section_command#1#2{%
> >    \framed [
> >         width=\textwidth,
> >                     frame=off,
> >                     rulethickness=0pt,
> >                     offset=0pt,
> >                     loffset=-0pt,
> >         before=,
> >         location=top,
> >         align=flushleft,]{#2}%
> > }
> >
> >
> > \setuphead [section] [
> >      style=\bfe,
> >      after=,
> >     before={\blank[1*line]},
> >    command=\section_command,
> > ]
> > \protect
> >
> >
> > \defineframed[myframed][
> >                     width=\textwidth,
> >                     frame=off,
> >                     rulethickness=0pt,
> >                     offset=0pt,
> >                     loffset=-0pt,
> >         foregroundstyle=\bfe,                %   <==== added
> >         strut=yes,                           %   <==== added
> >         before=,
> >         location=top,
> >         align=flushleft,]                    %   <==== removed dup "]"
> >
> > \starttext
> >
> > \blank[force,3*line,depth]
> >
> > %\begingroup                                %   <==== removed
> > %\BigFont                                   %   <==== removed
> > \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit
> > Lorem ipsum dolor sit amet consectetur adipisicing elit}
> > %\endgroup                                  %   <==== removed
> >
> > asdfasdf
> >
> > \page
> > \blank[force,3*line,depth]
> >
> > \startsection [title=Lorem ipsum dolor sit amet consectetur
> > adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing elit]
> >        asdf
> > \stopsection
> >
> > \stoptext
> >
> > %----------------------------------------------
> >
> >
> > Le 25/06/2021 à 12:30, denis.maier@unibe.ch a écrit :
> > > Hi,
> > >
> > > I have some text in a larger font where the first line should be on
> > > the grid. Therefore, I’ve tried to adapt the solution from the wiki:
> > > https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_th
> > > e_
> > > grid
> > > <https://wiki.contextgarden.net/Grid_typesetting#Placing_titles_on_t
> > > he
> > > _grid>
> > >
> > > The interesting thing is that the section command indeed places the
> > > first line on the grid, but using \framed directly does not give the
> > > desired results.
> > >
> > > I must be missing something obvious. Does anyone know a solution ?
> > >
> > > Thanks for your help,
> > >
> > > Denis
> > >
> > > ===================================
> > >
> > > \setuplayout[grid=yes]
> > >
> > > \showgrid
> > >
> > > \definefont  [BigFont]  [Bold at 20pt] [24pt]
> > >
> > > \unprotect
> > >
> > > \unexpanded\def\section_command#1#2{%
> > >
> > > \framed [
> > >
> > >         width=\textwidth,
> > >
> > >                     frame=off,
> > >
> > >                     rulethickness=0pt,
> > >
> > >                     offset=0pt,
> > >
> > >                     loffset=-0pt,
> > >
> > >         before=,
> > >
> > >         location=top,
> > >
> > >         align=flushleft,]{#2}%
> > >
> > > }
> > >
> > > \setuphead [section] [
> > >
> > >      style={\BigFont},
> > >
> > > after=,
> > >
> > >     before={\blank[1*line]},
> > >
> > >    command=\section_command,
> > >
> > > ]
> > >
> > > \protect
> > >
> > > \defineframed[myframed][
> > >
> > >                     width=\textwidth,
> > >
> > >                     frame=off,
> > >
> > >                     rulethickness=0pt,
> > >
> > >                     offset=0pt,
> > >
> > > loffset=-0pt,
> > >
> > >         before=,
> > >
> > >         location=top,
> > >
> > > align=flushleft,]]
> > >
> > > \starttext
> > >
> > > \blank[force,3*line,depth]
> > >
> > > \begingroup
> > >
> > > \BigFont
> > >
> > > \myframed{Lorem ipsum dolor sit amet consectetur adipisicing elit
> > > Lorem ipsum dolor sit amet consectetur adipisicing elit}
> > >
> > > \endgroup
> > >
> > > asdfasdf
> > >
> > > \page
> > >
> > > \blank[force,3*line,depth]
> > >
> > > \startsection [title=Lorem ipsum dolor sit amet consectetur
> > > adipisicing elit Lorem ipsum dolor sit amet consectetur adipisicing
> > > elit]
> > >
> > > asdf
> > >
> > > \stopsection
> > >
> > > \stoptext
> > >
> > > =========================================
> > >
> > >
> > >
> >
> ________________________________________________________________
> > ______
> > > _____________ 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
> > >
> >
> ________________________________________________________________
> > ______
> > > _____________
> > >
> >
> ________________________________________________________________
> > ___________________
> > 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
> >
> ________________________________________________________________
> > ___________________
> ________________________________________________________________
> ___________________
> 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
> ________________________________________________________________
> ___________________
___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2021-06-28 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 10:30 First line of larger font paragraph on grid denis.maier
2021-06-26 10:30 ` Garulfo
2021-06-26 10:37 ` Garulfo
2021-06-27 14:57   ` denis.maier
2021-06-28 10:55     ` denis.maier

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