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

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