2

How can I have grid layout in Context, but it should not enforce strict grid typesetting for headings, figures, tables etc? Only paragraphs need to be always on the grid. How can I achieve that? Example below doesn't work.

\setuplayout[grid=yes]
\setuppagenumbering[alternative=doublesided,location=right]
\setuphead[section][grid=no]

\showgrid

\starttext

\startchapter[title=First chapter]
\input lorem
\startsection[title=First section]
\input lorem
\stopsection
\stopchapter

\stoptext

Screenshot of PDF output of code above

2
  • 2
    Hi and welcome to the site. I have no time to test things right now, but have you looked at the details document?
    – mickep
    Commented Dec 13, 2022 at 7:02
  • @mickep Yes, I've looked into this document, but I found it very unintuitive, so I asked here :)
    – erz
    Commented Dec 13, 2022 at 17:52

1 Answer 1

2

In my experience grid typesetting in TeX is difficult. There are simply too often one has to make manual tweaks. In your question, you ask for how to set up headings, figures, tables and so on to not use the grid. The thing is that one wants to get back to the grid, so how should one first go off grid and then return to it? What space to add/remove at the bottom and top?

In ConTeXt you have a rather complete grid system, but you still need to work a bit manually. There are several different values you can add to the grid key. As I mentioned in the comment, you should consider the details manual.

For headings, see one way to go in the example below (found in the manual). For figures, you should aim at having images that take the place of a fixed number of lines, for tables that usually happen (right?). For math, you have some options in the above mentioned details manual.

Here is an example where the spacing around the headings look. Something that you can play with. If you have more specific questions, it might be a good idea to ask a new question with exactly that problem showing (in this question you mentioned figures, tables, ... but only showed an example with headings).

\setuplayout[grid=both]
\showgrid

\setuphead[section][
    style=\bfb,
    before={\blank[2*line]},
    after={\blank[line]},
    grid=local:yes,
]

\starttext

\startbuffer
\section[title=A test]
\samplefile{knuth}
\section[title=Another test]
\samplefile{knuth}
\section[title=A third title that is so long that it breaks over two lines well now it is]
\samplefile{douglas}
\stopbuffer

\dorecurse{5}{
\getbuffer
}

\stoptext

on the grid

If you look at the example, the last line on the third page is empty. That is because there is a new section starting on the top of the next page.

I have started out a couple of times with the ambition to work on the grid, but then there was in the end too much manual tweaking that took the time from writing.

2
  • Thanks a lot. This is more understandable than the details manual :) What is your solution finally? Do you use something different for grid typesetting oder do you use Tex just without grids?
    – erz
    Commented Dec 13, 2022 at 17:54
  • Just TeX without grids.
    – mickep
    Commented Dec 13, 2022 at 20:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .