
figure
予期しない状況で、 を使用してsubfigure
フィギュア用の 2 x 1 環境 (つまり、上部に 1 つのフィギュア、下部に 2 つのフィギュア) を作成しているときに、次のエラーが発生します。
ドキュメントは正常に生成され、図は 1 ページに明確に収まっており、視覚的にもこれを確認できます。つまり、ページにはまだ多くの空きスペースが残っています。しかし、なぜこのエラーが生成されるのかを理解したいです。
入力行 58 のフロートが 14.86864 ポイントでページに対して大きすぎます。
私が使用しているコードブロックは次のとおりです。
\documentclass[12pt,a4paper,oneside,pdftex]{report}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}[htbp!]
\centering
\begin{subfigure}[b]{1\linewidth}
\includegraphics[width=\linewidth]{files/Feb1.pdf}
\caption{No. 1 }
\end{subfigure}
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=\linewidth]{files/Feb2.pdf}
\caption{No. 2 }
\end{subfigure}
\begin{subfigure}[b]{0.4\linewidth}
\includegraphics[width=\linewidth]{files/Feb3.pdf}
\caption{No. 3 }
\end{subfigure}
\caption{\textit{40 characters here in the original version} 544 characters here}
\label{fig:thesefiguresdonotmatter}
\end{figure}
\end{document}
すでに試しました:
- 取り除く
\centering
- 削除
[htbp!]
(最初の行) - 削除
[b]
(subfigure
コマンドの横にあるもの)
答え1
フロートがフッター領域まで拡張されている場合、フロートはまだ大きすぎます。
showframe
ページ レイアウトは、パッケージのオプションによって表示できますgeometry
。このオプションを追加するか、パッケージが使用されていない場合は以下を追加します。
\usepackage[pass, showframe]{geometry}% pass does not change the layout
以下に定義されているマクロは\DebugBox
、寸法をコンソールとファイルに出力し.log
、境界線を追加します。境界線はボックスの内側に配置され、境界線のあるボックスが大きくなるのを防ぎます。
\newcommand*{\DebugBox}[1]{%
\begingroup
\sbox0{#1}%
\typeout{\string\DebugBox: wd=\the\wd0, ht=\the\ht0, dp=\the\dp0}%
\setlength{\fboxrule}{.1pt}% thin border line
\setlength{\fboxsep}{-\fboxrule}% border line inside
\fbox{\box0}%
\endgroup
}
マクロは\DebugBox
次のように使用できます\mbox
。例:
\DebugBox{\includegraphics[width=\linewidth]{files/Feb1.pdf}}