One of the requirements of our publisher for the book to be published is grid typesetting. Of course I already had a look into how to use \raggedbottom
and adjust all vertical lengths to achieve this. But there is one last thing where we need manual fiddling and I don't know where my error in thinking is.
So we have an image which originally is W267.0mm x H100.5mm
and because we have 20mm
margins on A4
paper, we scale the image to \textwidth
and now have W170.0mm x H63.99mm
or converted to Adobe Points W481.89p x H 181.39bp
. My thinking is, that to achieve typesetting according to the grid. I find the next mutliple of 12bp
which is 192bp
and the difference is 10.61bp
. If I apply this space, the text below the image should follow the grid again. Everything put in code it looks like this:
\documentclass[a4paper]{scrartcl}
\usepackage[left=20mm,right=20mm]{geometry}
\usepackage{lipsum,graphicx}
\setkomafont{caption}{\fontsize{10bp}{12bp}\selectfont}
\setkomafont{captionlabel}{\fontsize{10bp}{12bp}\selectfont}
\setlength{\textfloatsep}{0bp}
\setlength{\intextsep}{0bp}
\setlength{\abovecaptionskip}{10.61bp}
\setlength{\belowcaptionskip}{0bp}
\raggedbottom
\begin{document}
\fontsize{10bp}{12bp}\selectfont
\lipsum[1-3]
\begin{figure}[h]
\centering
\includegraphics[width=170mm,height=63.99mm]{example-image-A}
\caption{Just a test}
\end{figure}
\lipsum
\lipsum
\end{document}
However I prepared a visual check of this page and used LaTeX
for this as well, so I use the output of above and use it as Registerhaltigkeit.pdf
for the following code:
\documentclass[a4paper]{scrartcl}
\usepackage[absolute]{textpos}
\usepackage{graphicx,pgffor}
\pagestyle{empty}
\begin{document}
\foreach \x [evaluate=\x as \y using int(\x+1)] in {1}{
\newpage
\begin{textblock*}{105mm}[0,0](0mm,0mm)%
\noindent%
\includegraphics[page=\x,trim=0mm 0mm 105mm 0mm,width=105mm,clip]{Registerhaltigkeit.pdf}%
\end{textblock*}%
\begin{textblock*}{105mm}[0,0](105mm,0mm)%
\noindent%
\includegraphics[page=\y,trim=105mm 0mm 0mm 0mm,width=105mm,clip]{Registerhaltigkeit.pdf}%
\end{textblock*}%
~
}
\end{document}
And the final result looks reveals that up to the figure everything is in register, thereafter there is an offset between the two pages:
What am I doing wrong, which numbers am I'm messing up or which internals skips do I miss? Thanks for your support as always.
After comment of @barbara beeton
The comment of @barbara beeton brought me to the point that I wanted to answer just use article
instead of scrartcl
, it doesn't change a thing, but this is not true. Using scrbook
instead of scrartcl
is not really changing something, but using book
instead of scrbook
does.
So here is my new code, which uses the standard book
class and the caption
package:
%\documentclass[a4paper]{scrartcl}
\documentclass{book}
\usepackage[left=20mm,right=20mm,a4paper]{geometry}
\usepackage{lipsum,graphicx}
%\setkomafont{caption}{\fontsize{10bp}{12bp}\selectfont}
%\setkomafont{captionlabel}{\fontsize{10bp}{12bp}\selectfont}
\usepackage{caption}
\DeclareCaptionFont{MyFont}{\fontsize{10bp}{12bp}\selectfont}
\captionsetup[figure]{font=MyFont,labelfont=MyFont}
\setlength{\textfloatsep}{0bp}
\setlength{\intextsep}{0bp}
\setlength{\abovecaptionskip}{10.61bp}
\setlength{\belowcaptionskip}{0bp}
\raggedbottom
\begin{document}
\fontsize{10bp}{12bp}\selectfont
\lipsum[1-3]
\begin{figure}[h]
\centering
\includegraphics[width=170mm,height=63.99mm]{example-image-A}
\caption{Just a test}
\end{figure}
\lipsum
\lipsum
\end{document}
And now applying the second script, my result looks like this:
So you can see that after the figure now everything is set on grid, which means my calculation was right. However now I have some more questions:
- What extra spacing is added between the figure caption and the following text?
- Why does it match the vertical distance or where is this space taken from so the lines are matching afterwards again?
- What extra space is added by
KOMA-Script
that obviously messes up the vertical spacing?
Maybe you have some hints for me?
OK, I found a partial answer and here is an intermediate result, I will also post an answer in the next days:
scrbook
, however for the MWE it didn't really matter. Also the formatting of chapter/section/other titles was already solved by myself, so I didn't want to complicate the MWE. The final book contains no single formula and only one figure, this is why I am fine with a manual solution. Next time I will just use ConTeXt which seems to be the grid typesetting goto place. But I can't for this project. ;-)