7

Guys am working on a page title and I need align some text to grid in \definemakeup

MWE:

\showframe
\showgrid
\definemakeup[custom][headerstate=none,footerstate=none]
\setuplayout[custom][grid=yes,backspace=30mm]
\setuplayout[grid=yes,backspace=30mm]
\setupwhitespace[big]
\starttext
\startmakeup[custom]
\setupwhitespace[big]
\input ward\par
\input ward
\stopmakeup
\input ward\par
\input ward
\stoptext

As you can see, commands like backspace= are working when \setuplayout is used, but grid=yes.

EDIT: Thanks for the answers DG' and Aditya, the option grid=high is very close from what am looking for, but it fails when i use another font eg. sans serif. See the following MWE:

\showgrid

\definefontfamily [mainface][rm][TeX Gyre Pagella]
\definefontfamily [mainface][ss][TeX Gyre Heros]
\setupbodyfont[mainface,
sans,%<---
]

\setuplayout[grid=normal]

\definemakeup[titlepage][
headerstate=none,
footerstate=none,
]

\setuplayout[titlepage][
grid=high,
backspace=30mm,
]

\starttext
\startmakeup[titlepage]
\input ward\blank
\input ward
\stopmakeup

\input ward\blank
\input ward
\stoptext
  • 2
    The makeup environment doesn’t support grid snapping but this shouldn’t matter for a simple title page or full page chapter etc. title. Please describe what exactly you’re trying to achieve and we can provide you a solution. – Wolfgang Schuster Jul 21 '16 at 8:26
3

Makeup doesn't play well with grid, because basically it's a \vbox. In this case, internally there is a \dontleavhmode that adds a vertical space, and its effect can be compensate using the top option and guessing the value by try-and-error:

\showgrid
%
\definefontfamily [mainface][rm][TeX Gyre Pagella]
\definefontfamily [mainface][ss][TeX Gyre Heros]
\setupbodyfont[mainface,
sans,%<---
]
%
%
\setuplayout[grid=normal]
%
\definemakeup[titlepage][
headerstate=none,
footerstate=none,
]
\setupmakeup[titlepage][
top=\vskip-0.75em,
bottom=,]
\setuplayout[titlepage][
backspace=30mm,
]
\starttext
\startmakeup[titlepage]
\input ward\blank[line]
\input ward
\stopmakeup
\input ward\blank[line]
\input ward
\stoptext

You can also use top=\vskip-0.75em\vskip10\lineheight if you want to set the position of the box at 10 lines from the top of the text area.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.