# Align text to grid in ConTeXt

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

MWE:

``````\showframe
\showgrid
\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][
footerstate=none,
]

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

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

\input ward\blank
\input ward
\stoptext
``````
• 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

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][
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.

Don't use `\par` after `\input ward`

Update: If you want to introduce blank lines between the paragraphs use `\blank`:

``````\showframe
\showgrid

\setuplayout
[grid=normal]

\definemakeup
[titlepage]
footerstate=none]

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

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

\input ward\blank
\input ward
\stoptext
``````

• Thanks for the answer DG', but that doesn't work for me because i need to separate the paragraphs – jl4c Jul 20 '16 at 14:10
• In that case use `\blank`, see update – DG' Jul 20 '16 at 14:39
• Thanks DG', this is a progress. Do you know why the text on the first page is not perfectly aligned like the second page? – jl4c Jul 20 '16 at 14:53
• `grid=high` will fix that – DG' Jul 20 '16 at 22:20
• You could also try setup whitespace[line] instead of big – Aditya Jul 20 '16 at 23:05