My publisher asked me to work with a grid because the book will have 1000 pages and very thin paper, so that the text from the next page won't shine through making the page all grey. I read about the difficulties with TeX and grids. (I can not change to ConTeXt). I am stuck with spacing the chapter and section commands which should fall in line with the grid.
There are two problems, of which this question addresses one:
When
\addchap
and\section
follow each other the grid is not kept any moreSometimes the section title is longer than a single line. (Possible follow up, but I would be glad if the other thing worked)
When I use this MWE, the grid is intact after \addchap
and \section
:
\documentclass[fontsize=10pt,headings=openany]{scrbook}
\usepackage[usenames]{xcolor}
\usepackage{scrlayer-scrpage}
\usepackage{fontspec}
\usepackage{blindtext}
\usepackage{eso-pic}
\usepackage[ngerman]{babel}
\usepackage[babel]{microtype}
\usepackage{tikz}
% baseline grid
\AddToShipoutPicture{%
\AtTextLowerLeft{
\begin{tikzpicture}[overlay,remember picture]%
\draw[blue!90!white,very thin]%
(current page.south west) grid[step=\baselineskip]%
(current page.north east);%
\end{tikzpicture}%
}%
}
\RedeclareSectionCommand[
beforeskip=22.89pt,
afterskip=12pt]{chapter}
\RedeclareSectionCommand[
beforeskip=17.99pt,
afterskip=12pt]{section}
\begin{document}
\addchap{1 EL}
1EL\blindtext
\section{1 EL}
1EL\blindtext
\addchap{1 EL}
\section{1 EL}
1EL\blindtext
\blindtext
\end{document}
Unfortunately it is off whenever \addchap
and \section
are adjacent. (For unknown reasons the image uploader does not accept my screenshot. I'll try to add the image later.) Which length is in charge of the space between chapter and section?
afterskip
of the chapter headings are considered in the adjacent case.