multicol 中的 lettrine 位置错误。\columnbreak 的问题

multicol 中的 lettrine 位置错误。\columnbreak 的问题

以下代码显示了两个问题。1. 除非\vfill在末尾插入,否则在 multicols 环境和 SampleList 环境中,lettrine 的意图是错误的。2. SampleList 之后的下一张图片(此处模拟为小页面)的定位间隔很大,这是不受欢迎的。

在此处输入图片描述

\documentclass[]{scrbook}

\usepackage{multicol}
\usepackage{lettrine}

\begin{document}

\newcounter{itemstep}
\setcounter{itemstep}{0}
\setlength{\parindent}{0pt}

\newenvironment{SampleList}{}{}
\newcommand{\step}{%
\stepcounter{itemstep}%
\lettrine[findent=5pt,lines=1]{\theitemstep}{}
}% end of \step 

\begin{multicols}{2}

\begin{minipage}[b]{.99\linewidth}
\centering
\rule{0.95\linewidth}{9cm}
\end{minipage}

\begin{SampleList}
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
%
\columnbreak % <-- error of large free space introduced here
%
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
%
\vfill % <-- necessary to position last lettrine number correct
\end{SampleList}
% 
\begin{minipage}[b]{.99\linewidth}
\centering
\rule{0.95\linewidth}{5cm}
\end{minipage}
%
\begin{SampleList}
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. 
% \vfill  % <- commented to show error with position of last lettrine number
\end{SampleList}
\end{multicols}

\end{document}

答案1

\par建议在环境的开始\step和结束处添加,这样可以解决问题。\strut如果该步骤后面跟有非常高的东西(例如步骤 4 之后),则这是确保更好间距的安全措施(感谢 Barbara Beeton 提供)。

\documentclass[]{scrbook}

\usepackage{multicol}
\usepackage{lettrine}

\newcounter{itemstep}
\setcounter{itemstep}{0}
\setlength{\parindent}{0pt}

\newenvironment{SampleList}{}{\unskip\strut\par} % <--- added
\newcommand{\step}{%
  \par % <--- added
  \stepcounter{itemstep}%
  \lettrine[findent=5pt,lines=1]{\theitemstep}{}
}% end of \step 

\begin{document}

\begin{multicols}{2}

\begin{minipage}[b]{.99\linewidth}
\centering
\rule{0.95\linewidth}{9cm}
\end{minipage}

\begin{SampleList}
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
%
\columnbreak
%
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
%
\end{SampleList}
% 
\begin{minipage}[b]{.99\linewidth}
\centering
\rule{0.95\linewidth}{5cm}
\end{minipage}
%
\begin{SampleList}
\step This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. This is some example text. 
\step This is some example text. This is some example text. This is some example text. This is some example text. 
\end{SampleList}
\end{multicols}

\end{document}

在此处输入图片描述

相关内容