때로는 한 페이지에 레이아웃하고 중앙에 수평선을 배치하려는 두 개 이상의 그림 환경이 있습니다. 이를 달성하기 위해 두 환경 사이에 \vfill\hrule\vfill을 배치했습니다. 그러나 이것은 페이지의 전체 텍스트 영역에 걸쳐 있는 미니페이지를 만드는 경우에만 작동합니다.
그러나 이렇게 하면 문서 클래스에 따라 hbox 또는 vbox 오버플로가 발생합니다. 기사의 경우 15pt의 hbox 오버플로이고, phdesis(웹에서 가져온 cls)의 경우 15pt의 vbox 오버플로이기도 합니다.
이것은 최소한의 작업 예입니다.
\documentclass{article}
\newlength{\minipagewidth}
\newlength{\minipageheight}
\begin{document}%
%results in: Badbox, line 9: Overfull \hbox (15.0pt too wide) in paragraph at lines 9-26
\setlength{\minipagewidth}{\textwidth}%
\setlength{\minipageheight}{\textheight}%
\begin{minipage}[t][\minipageheight]{\minipagewidth}%
Top of the page
\vfill\hrule\vfill
Bottom of the page
\end{minipage}
% no vbox or hbox overflow:
\addtolength{\minipagewidth}{-15pt}%
%\addtolength{\minipageheight}{-15pt}%
\begin{minipage}[t][\minipageheight]{\minipagewidth}%
Top of the page
\vfill\hrule\vfill
Bottom of the page
\end{minipage}%
\end{document}
두 번째 미니페이지에서는 그러한 경고가 발생하지 않지만 너비에서 15pt를 빼야 했습니다. 이 15pt는 어디에서 왔습니까? \textwidth가 텍스트 영역의 너비보다 넓은 이유는 무엇입니까?
답변1
기본 들여쓰기입니다. LaTeX에 관한 한 a는 minipage
큰 글자와 같습니다. \begin{minipage}
아직 단락 안에 있지 않은 경우 단락을 시작합니다 .
\noindent\begin{minipage}{\textwidth}
문제를 해결합니다.
높이에 관해서는 당신이 정말로 달성하고 싶은 것이 무엇인지 잘 모르겠습니다.
전체 페이지 플로트의 경우 다음과 같이 할 수 있습니다.
\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum} % just for the example
\begin{document}
\lipsum[1-3]
\begin{figure}[p]
\centering
\begin{minipage}[c][\dimexpr\textheight-\baselineskip+\topskip\relax][s]{\textwidth}
\centering
\includegraphics[width=8cm]{example-image-a}
\caption{A caption to the first figure}
\vfill
\hrule
\vfill
\includegraphics[width=8cm]{example-image-b}
\caption{A caption to the second figure}
\end{minipage}
\end{figure}
\lipsum[4-10]
\end{document}