1

I have a PDF compiled with LaTeX that contains lists and quotes. My settings result in the lines not being on the same height when I view the PDF in double-page-mode as soon as I employ lists and quotes. E.g. I get this (from output-pages 6/7 of the MWE):

enter image description here

The line ›1. Lorem ipsum ...‹ on the right page is a bit too high. It should correspond to the line ›... Cum sociis natoque‹ on the left page. The vertical white space between the paragraph and the list that follows should be a bit larger. There are other occurences in the output-file.

As I have gathered from various questions, this has to do with lengths that include rubber-space or glue, such as \bigskipamount, to give TeX the maximum flexibility when building a page.

However, I would like to suppress the glue for this document regarding lists and quotes, to ensure that lines are, as far as this is achievable, always automatically on the same height when viewing the document in double-page-mode, without me having to check the vertical spacing and then adding or taking away a little.

This is what I have done so far:

\documentclass[paper=140mm:220mm]{scrbook}
\setkomafont{section}{\normalfont\bfseries}
\setkomafont{subsection}{\normalfont\bfseries}

\RedeclareSectionCommand[
 beforeskip=-\baselineskip,
 afterskip=.001\baselineskip
 ]{section}

\RedeclareSectionCommand[
 beforeskip=-\baselineskip,
 afterskip=.001\baselineskip
 ]{subsection}

\setlength{\bigskipamount}{12pt}
\setlength{\topsep}{9pt}
\setlength{\partopsep}{3pt}
\setlength{\parsep}{0pt}
\usepackage[indentfirst=false, noorphans, listvskip=true]{quoting}

\usepackage{lipsum}
\usepackage{enumitem}
\setlist{noitemsep}

\widowpenalty10000

\begin{document}
\raggedbottom

\chapter{One} \section{One} \lipsum[1-5]

\begin{quoting} \lipsum[1] \end{quoting}

\subsection{One} \lipsum[1-3]

\begin{itemize}\item{BlaBla} \item{\lipsum[1]} \item{BlaBla}    
\item{\lipsum[1]}\item{BlaBla}\end{itemize}

\begin{quoting} \lipsum[1] \end{quoting}
\begin{quoting} \lipsum[1] \end{quoting}

\section{Two} \lipsum[1-5]
\begin{enumerate} \item{\lipsum[1]} \item{\lipsum[1]} \item{BlaBla}      
\end{enumerate}

\begin{quoting} \lipsum[1] \end{quoting}

\end{document}

(The section-fontsizes are another topic. In the MWE example I set them so they don΄t affect the main issue further. quoting and its option listvskip=true allowed customizing the quote along the lines of the lists.)

These settings take out most instances, but ones depicted in the image still occur.

This means, to my understanding, that I haven’t tracked all instances of glue, yet. My question therefore regards the parameters of vertical spacing and the way to influence them when glue is involved:

Where is glue employed in lists and quotes, and how can I suppress it?

Kubo
  • 368
  • 2
    These "rubber-spaces" are called "glue" in TeX. A glue can be represented by <natural> plus <stretch> minus <shrink>. This glue has a <natural> size that can stretch by <stretch> and shrink by <shrink>. If you don't want it to stretch or shrink, you can give it only its <natural> size. For example, \setlength{\bigskipamount}{12pt} would remove its ability to stretch and shrink. But you have to know which parameter you want to modify to remove this flexibility. – Phelype Oleinik Sep 09 '18 at 13:10
  • I changed ›rubber-space‹ for ›glue‹ in the title. My question aims at finding out what you pointed out: What parameters are involved in vertical spacing of lists and quotes? I added that, too. – Kubo Sep 09 '18 at 13:29
  • 2
    you don't want to do \AtBeginEnvironment{itemize}{\bigskip} instead set the list parameters to be larger, latex goes to some effort not to for example add a double sized space if one list follows another but you are just unconditionally adding bigskipamount above and below each list even if there is already space there. – David Carlisle Sep 09 '18 at 13:37
  • 2
    Your question is not very clear, but if by your image you mean you do not want the white space after the list why are you forcing a \bigskip at that point???? – David Carlisle Sep 09 '18 at 13:39
  • I do want a white space, I just want the line on the right page (›Innerhalb der ...‹) to be at the exact same height as the corresponding line on the left page (›...erwies sich als falsch.‹). By using \bigskip I tried to make the white space exactly a line high every time, however, it was not high enough in the image. I get the issue with \AtBeginEnvironment and will try to reformulate the question to get rid of the confusion here. – Kubo Sep 09 '18 at 13:55
  • 2
    I think you are describing "grid typesetting". This is, in general, not too easy to achieve with latex, but there are some packages out there, as well as questions here. Have a look at https://tex.stackexchange.com/questions/1418/grid-system-in-latex – nox Sep 09 '18 at 14:29
  • 1
    you are adding additional space and forcing excessive space before and after lists with all those bigskip definitions. – David Carlisle Sep 09 '18 at 14:51
  • @DavidCarlisle: I have tried to adress the issue of bigskip in reformulating the question without making use of \bigskip I hope this is less confusing now. – Kubo Sep 09 '18 at 15:38
  • @nox: Yes, grids are what I had in mind. Maybe the linked packages can solve this issue. – Kubo Sep 09 '18 at 15:39
  • 1
    your question still isn't very clear where in the 8 pages of output is that image fragment? but you have no space between paragraphs in the main document but paragraphs inside lists get 4.5pt so push you off the grid because you have \setlength{\parsep}{4.5pt} – David Carlisle Sep 09 '18 at 15:43
  • @DavidCarlisle: Thanks for the patience. I reduced \parsep to zero and included the image from the MWE-output. The old image was from another document with the same settings as the effects of the setting were easier to see there. – Kubo Sep 09 '18 at 16:44

2 Answers2

4

I didn't try to adjust the chapter height but with the lists this should work:

Be aware that lots of things can destroy the grid, e.g. images, tabulars, math. Normally some manual tweaking can not be avoided.

\documentclass[paper=140mm:220mm]{scrbook}
\setkomafont{section}{\normalfont\bfseries}
\setkomafont{subsection}{\normalfont\bfseries}

\RedeclareSectionCommand[
 beforeskip=-\baselineskip,
 afterskip=.01\baselineskip
 ]{section}

\RedeclareSectionCommand[
 beforeskip=-\baselineskip,
 afterskip=.01\baselineskip
 ]{subsection}


\usepackage[indentfirst=false, noorphans,vskip=\baselineskip]{quoting}

\usepackage{lipsum}
\usepackage{enumitem}
\setlist{nosep,topsep=\baselineskip}

\widowpenalty10000

\usepackage{returntogrid} %to show the grid
\usepackage{tikz,eso-pic}
\AddToShipoutPictureBG {\AtTextUpperLeft{\showdebugpagegrid}}

\begin{document}    \raggedbottom

%\chapter{One} 
\section{One} \lipsum[1-5]

\begin{quoting} \lipsum[1] \end{quoting}

\subsection{One} \lipsum[1-3]

\begin{itemize}\item{BlaBla} \item{\lipsum[1]} \item{BlaBla}
\item{\lipsum[1]}\item{BlaBla}\end{itemize}

\begin{quoting} \lipsum[1] \end{quoting}
\begin{quoting} \lipsum[1] \end{quoting}

\section{Two} \lipsum[1-5]
\begin{enumerate} \item{\lipsum[1]} \item{\lipsum[1]} \item{BlaBla}
\end{enumerate}

\begin{quoting} \lipsum[1] \end{quoting}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261
0

I hope this is what OP was looking for. I tweaked the spaces to get the desired result (around chapter, section, subsection titles, and the used environments). Formulae still can break this setup, but for what's currently included, it should work.

\documentclass[paper=140mm:220mm]{scrbook}

\setlength{\bigskipamount}{\baselineskip}
\usepackage[indentfirst=false, noorphans, vskip=0pt]{quoting}

\newcommand{\skipbeginenv}{%
  \ifdim \lastskip=.01pt \else%
    \vskip-\lastskip%
    \vskip\baselineskip%
  \fi%
}
\newcommand{\skipendenv}{%
  \vskip\baselineskip%
}

\usepackage{etoolbox}
\AtBeginEnvironment{quoting}{\skipbeginenv\itshape}
\AtEndEnvironment{quoting}{\skipendenv}

\AtBeginEnvironment{enumerate}{\skipbeginenv}
\AtEndEnvironment{enumerate}{\skipendenv}

\AtBeginEnvironment{itemize}{\skipbeginenv}
\AtEndEnvironment{itemize}{\skipendenv}

\widowpenalty10000

%\usepackage[hmargin=.0cm]{geometry}
\RedeclareSectionCommand[
beforeskip=\dimexpr-25pt-2\baselineskip\relax,
afterskip=\baselineskip]{chapter}
\RedeclareSectionCommand[
beforeskip=-9.2pt,
afterskip=\baselineskip]{section}
\RedeclareSectionCommand[
beforeskip=-13.2pt,
afterskip=0.01pt]{subsection}

\usepackage{enumitem}
\setlist{nolistsep}

\setlength{\lineskip}{0pt}
\setlength{\lineskiplimit}{0pt}

%\makeatletter
%\newcommand\thefontsize[1]{{#1 The font size is: \f@size pt\\Baselineskip: \the\baselineskip\\}}
%\makeatother
\usepackage{lipsum}

\begin{document}
\raggedbottom
\chapter{One}
\section{One}
%\thefontsize{\usekomafont{chapter}}
%The font size is: 20.74pt
%Baselineskip: 25.0pt
%\thefontsize{\usekomafont{section}}
%The font size is: 14.4pt
%Baselineskip: 18.0pt
%\thefontsize{\usekomafont{subsection}}
%The font size is: 12pt
%Baselineskip: 14.0pt
%\thefontsize{}
%The font size is: 10.95pt
%Baselineskip: 13.6pt

\lipsum[1-5]

\begin{quoting} \lipsum[1] \end{quoting}

%\subsection{One}
\lipsum[1-4]
\subsection{two?}

\begin{itemize}\item{BlaBla} \item{\lipsum[1]} \item{BlaBla}    
\item{\lipsum[1]}\item{BlaBla}\end{itemize}

\begin{quoting} \lipsum[1] \end{quoting}
\begin{quoting} \lipsum[1] \end{quoting}
\lipsum[1]

\section{Two} \lipsum[1-5]
\begin{enumerate} \item{\lipsum[1]} \item{\lipsum[1]} \item{BlaBla}      
\end{enumerate}

\begin{quoting} \lipsum[1] \end{quoting}

\end{document}

result

edit: correct code posted

nox
  • 4,160
  • 12
  • 26