使用网格在相对的页面上设置相同基线的线条

使用网格在相对的页面上设置相同基线的线条

这个问题关于将 KOMA 中的标题固定到线网格以及这个据我所知,在 XeTeX 中对整个文档进行类似的操作。

是否有可能强制 TeX 分部分添加垂直粘连,以产生位于同一基线上的相对页面的线条——例如 Bringhurst 所建议的那样?在我的文档中,问题是我通常有很多浮点数和方程式,它们(本身 + cpation)具有可变的高度,因此在底部产生不对称的页面布局(参见 MWE)。使用\flushbottom可能会在页面底部产生所需的行为,但不会在页面中心产生所需的行为,并且在某些情况下可能导致非常大的垂直空间。

附带一个问题:所请求的行为在 TeX 中是否是必需的?

我目前所做的:

贡献似乎可以使用该grid包(或者实际上不使用网格包,但我从它开始)。我尝试使用网格,并且在只有文本和方程式的文档中取得了相当大的成功。当我添加图像和标题等花哨的东西时,事情变得复杂了。然后我尝试让事情“对齐”,调整前后间距以及标题和其他元素的相应允许粘合量。对于标题,基于 normalsize baselineskip 的新长度改善了结果。但到目前为止,总是存在至少一种组合,其中线条不适合同一基线。此外,我必须允许更大的浮动分数。否则,大图只会位于其自己的页面上。在添加包之前,grid这种情况并没有发生。在当前配置中,通常会在图形标题下方添加大量空白。

\documentclass[a4paper,twoside]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}        % US english language and hyphenation settings
\usepackage{amsmath, amsthm, amsfonts, amssymb}
\usepackage{blindtext}

\usepackage[fontsize=11pt,baseline=13pt,lines=48]{grid}

\usepackage{graphicx}
\usepackage{color}

\renewcommand{\topfraction}{.85} % maximum space a top-placed figure can occupy
\renewcommand{\bottomfraction}{.7} % maximum space a bottom-placed figure can occupy
\renewcommand{\textfraction}{.15} % minimum amount of text needed on a page with figures
\renewcommand{\floatpagefraction}{.75} % minimum amount of space a figures need to occupy to be put onto a separate page

% ********************************************************************
% Font Stuff
% ******************************************************************** 
% rm: Palatino
\usepackage[osf,sc]{mathpazo}
\addtokomafont{disposition}{\rmfamily}

% font for chapter numbers
\DeclareFixedFont{\chapterNumber}{U}{eur}{b}{n}{60} % euler, proper call

% micro-typography stuff
\usepackage[tracking=true]{microtype}

% only one space behind full stops
\frenchspacing

% ********************************************************************
% commands for title formatting, etc.
% ******************************************************************** 
\usepackage{textcase} % for \MakeTextUppercase

\microtypesetup{expansion=false}%
\DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\MakeTextUppercase{#1}}}%
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}%

% ********************************************************************
% page head and foot
% ********************************************************************
\usepackage{scrlayer-scrpage}
\renewcommand{\chapterpagestyle}{empty}
\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\upshape\thesection\enspace\spacedlowsmallcaps{#1}}}
\lehead{\mbox{\llap{\small\thepage\kern2em}\scshape\headmark\hfil}}
\rohead{\mbox{\hfil{\scshape\headmark}\rlap{\small\kern2em\thepage}}}
\pagestyle{scrheadings}

% ********************************************************************                
% format of chapter-, section-, etc headings
% ********************************************************************
\definecolor{halfgray}{gray}{0.55} % chapter numbers will be semi transparent .5 .55 .6 .0 

\newcommand\titlerule[1][1pt]{\rule{\textwidth}{#1}}
% Bringhurst style chapter number
    % setting the line
\makeatletter
\renewcommand\chapterlinesformat[3]{%
%   \titlerule\par\nobreak%
  \@hangfrom{#2}{#3}%
  \color{halfgray}\par\nobreak\titlerule%
}
\makeatother
    % setting the number
\renewcommand*{\chapterformat}{%
    \rlap{\makebox[\linewidth][r]{} % makes the 'empty' box for the title, this pushes the number into the margin
    \color{halfgray}\quad\chapterNumber\thechapter\autodot}
}

\newlength{\nsbls}
\setlength{\nsbls}{\baselineskip}
\RedeclareSectionCommand[
  beforeskip=3\nsbls plus 0.5\nsbls minus 0.5\nsbls,
  afterskip=1.9\nsbls plus 0.5\nsbls minus 0.5\nsbls,
  font=\mdseries\scshape\lsstyle\LARGE]{chapter}
\RedeclareSectionCommand[
  beforeskip=2\nsbls plus 0.5\nsbls minus 0.5\nsbls,
  afterskip=1\nsbls plus 0.1\nsbls,
  font=\mdseries\scshape\lsstyle\Large]{section}
\RedeclareSectionCommand[
  beforeskip=1\nsbls plus 0.5\nsbls minus 0.5\nsbls,
  afterskip=1\nsbls plus 0.1\nsbls,
  font=\mdseries\itshape\large]{subsection}

% ********************************************************************                
% captions
% ********************************************************************
\usepackage[font=small]{caption}

% ********************************************************************                
% skip tweaks
% ********************************************************************
% equation skips before and after
\AtBeginDocument{%
    \abovedisplayskip     =1.5\baselineskip plus 0.5\baselineskip minus 0.5\baselineskip
    \belowdisplayskip     =1.5\baselineskip plus 0.5\baselineskip minus 0.5\baselineskip
    \abovedisplayshortskip=1.0\baselineskip plus 0.5\baselineskip minus 0.5\baselineskip
    \belowdisplayshortskip=1.0\baselineskip plus 0.5\baselineskip minus 0.5\baselineskip
}
% float skip lengths
\setlength{\textfloatsep}{3\nsbls plus 1\nsbls minus 1\nsbls}
\setlength{\floatsep}{2\nsbls plus 1\nsbls minus 1\nsbls}

% ********************************************************************                
% document
% ********************************************************************
\begin{document}

\chapter{chapter}
\blindtext[1]
\section{section}
\blindtext[1]
\begin{gridenv}
\begin{equation}
    \phi = \int_\Omega f d\Omega
\end{equation}
\end{gridenv}
\blindtext[3]
\begin{gridenv}
\begin{equation}
    \phi = \frac{\pi}{2}\int\limits_{-\infty}^\infty f d\xi
\end{equation}
\end{gridenv}
\blindtext[1]
%
\begin{figure}
\includegraphics[width=1\textwidth]{example-image}
\caption{\blindtext[1]}
\end{figure}
%

\section{section}
\subsection{subsection}
\blindtext[3]
\begin{gridenv}
\begin{equation}
    \phi = \int_\Omega f d\Omega
\end{equation}
\end{gridenv}
\blindtext[1]

\section{section}
\blindtext[1]
\begin{gridenv}
\begin{equation}
    \phi = \frac{3}{2}a^2
\end{equation}
\end{gridenv}
\blindtext[3]
\blindtext[3]
\end{document}

相关内容