在页面底部附近开始新的子部分和子部分时,\vbox 溢出

在页面底部附近开始新的子部分和子部分时,\vbox 溢出

我在编写文档时遇到了这个问题,但我没有找到一个明显、优雅的方法来解决这个问题。我可以\clearpage在图片后面添加一个,但随着文档的变化,我必须重新审视它\clearpage

我将尽力简化这个例子。

样本

\documentclass{article}
\usepackage{framed}
\usepackage{tikz-timing}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage[font=bf,justification=raggedright,singlelinecheck=false,format=hang]{caption}
\usepackage[margin=1in,headheight=31pt]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
\end{minipage}\par}%

\renewcommand\headrule{
\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}}%

\fancyhf{}
\fancyhead[R]{\huge\textbf{Lorem}}
\fancyfoot[L]{\textcopyright\ \the\year\ Ipsum Inc.}
\fancyfoot[R]{ABC1234-page \thepage}
\fancyfoot[C]{Draft}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}

\begin{multicols}{2}
\section{Lorem}
\lipsum[1]
\subsection{Lorem}
\lipsum[2-5]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.

\end{multicols}

\def\degr{${}^\circ$}

\begin{minipage}{\columnwidth}
    \captionof{figure}{Dolor Timing}
    \label{fig:dolor}
    \begin{framed}
        \begin{tikztimingtable}
            Lorem   &  L 8{C}          2{L} 3{C} G ;[ dotted ] C; 4{C} 2{L} 10{C}                           ;[ dotted ] 2L  ; 12{C}                                       2{L} 8{C} \\
            Ipsum   &  2{L} 2D{1} 5{L} 2{L} 3{L}   ;[ dotted ] L; 4{L} 2{X} 2D{LSb} 2D{1} 2D{2} 2D{3} 2D{4} ;[ dotted ] 2D{}; 2D{10} 2D{11} 2D{12} 2D{13} 2D{14} 2D{MSb} 10{L}      \\
        \end{tikztimingtable}
    \end{framed}
\end{minipage}

\begin{multicols}{2}
\subsection{Lorem}
\subsubsection{Dolor}
\lipsum[4-5]
\end{multicols}

\end{document}

答案1

您可以multicol使用可选参数来提供一些帮助,告诉它在决定强制在开始时分页之前需要多少空间。

两种可能性,取决于您是否希望将图像放在页面末尾或下一页的开头

在此处输入图片描述

\documentclass{article}
%\showoutput
\usepackage{framed}
\usepackage{tikz-timing}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage[font=bf,justification=raggedright,singlelinecheck=false,format=hang]{caption}
\usepackage[margin=1in,headheight=31pt]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
\end{minipage}\par}%

\renewcommand\headrule{%%%
\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}}%

\fancyhf{}
\fancyhead[R]{\huge\textbf{Lorem}}
\fancyfoot[L]{\textcopyright\ \the\year\ Ipsum Inc.}
\fancyfoot[R]{ABC1234-page \thepage}
\fancyfoot[C]{Draft}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}


\begin{multicols}{2}
\section{Lorem}
\lipsum[1]
\subsection{Lorem}
\lipsum[2-5]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.

\end{multicols}

\begin{multicols}{2}[{%
\def\degr{${}^\circ$}
\begin{minipage}[b]{\columnwidth}
    \captionof{figure}{Dolor Timing}
    \label{fig:dolor}
    \begin{framed}
        \begin{tikztimingtable}
            Lorem   &  L 8{C}          2{L} 3{C} G ;[ dotted ] C; 4{C} 2{L} 10{C}                           ;[ dotted ] 2L  ; 12{C}                                       2{L} 8{C} \\
            Ipsum   &  2{L} 2D{1} 5{L} 2{L} 3{L}   ;[ dotted ] L; 4{L} 2{X} 2D{LSb} 2D{1} 2D{2} 2D{3} 2D{4} ;[ dotted ] 2D{}; 2D{10} 2D{11} 2D{12} 2D{13} 2D{14} 2D{MSb} 10{L}      \\
        \end{tikztimingtable}
    \end{framed}
\end{minipage}}][20\baselineskip]



\subsection{Lorem}

\subsubsection{Dolor}
\lipsum[4-5]
\end{multicols}

\end{document}

在此处输入图片描述

\documentclass{article}
%\showoutput
\usepackage{framed}
\usepackage{tikz-timing}
\usepackage{multicol}
\usepackage{lipsum}
\usepackage[font=bf,justification=raggedright,singlelinecheck=false,format=hang]{caption}
\usepackage[margin=1in,headheight=31pt]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
\end{minipage}\par}%

\renewcommand\headrule{%%%
\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize
\end{minipage}}%

\fancyhf{}
\fancyhead[R]{\huge\textbf{Lorem}}
\fancyfoot[L]{\textcopyright\ \the\year\ Ipsum Inc.}
\fancyfoot[R]{ABC1234-page \thepage}
\fancyfoot[C]{Draft}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}


\begin{multicols}{2}
\section{Lorem}
\lipsum[1]
\subsection{Lorem}
\lipsum[2-5]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.

\end{multicols}


\def\degr{${}^\circ$}
\begin{minipage}[b]{\columnwidth}
    \captionof{figure}{Dolor Timing}
    \label{fig:dolor}
    \begin{framed}
        \begin{tikztimingtable}
            Lorem   &  L 8{C}          2{L} 3{C} G ;[ dotted ] C; 4{C} 2{L} 10{C}                           ;[ dotted ] 2L  ; 12{C}                                       2{L} 8{C} \\
            Ipsum   &  2{L} 2D{1} 5{L} 2{L} 3{L}   ;[ dotted ] L; 4{L} 2{X} 2D{LSb} 2D{1} 2D{2} 2D{3} 2D{4} ;[ dotted ] 2D{}; 2D{10} 2D{11} 2D{12} 2D{13} 2D{14} 2D{MSb} 10{L}      \\
        \end{tikztimingtable}
    \end{framed}
\end{minipage}

\begin{multicols}{2}[][5\baselineskip]

\subsection{Lorem}
\subsubsection{Dolor}
\lipsum[4-5]
\end{multicols}

\end{document}

答案2

如果你不需要在所有页面上使用相同的高度文本,那么你可以简单地\raggedbottom在 之后写入(某处)\begin{document}。标准行为由 定义\flushbottom

相关内容