
我試圖在我的文件中包含一個圖形(一個 pdf 圖表)並環繞它,但它給我帶來了大量的過度填充 hbox 錯誤。這是代碼:
\documentclass{article}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{wrapfigure}{r}{0.6\textwidth}
\centering
\includegraphics[width=0.55\textwidth]{example-image-a}
\caption{\label{fig:simpres}Residual values plot}
\end{wrapfigure}\lipsum
\end{document}
如果我移除該部件,它們就會消失wrapfigure
,但顯然我會失去包裹人物的能力,這在這裡很重要。有任何想法嗎?
答案1
兩份文件 - 一份作為範例顯示,另一份包含所有過滿警告。
範例程式碼有一個未滿的框,因為您透過將其用作段落的一部分來強制使用換行符換行。 wrappig 的文檔,第 2 頁,說:
- 在段落之間開始環境很方便,但如果您想將環境放置在段落中間,則必須將環境放在兩個單字之間有自然換行的地方。
如果可能的話,將環境放在段落之間(在前面留一個空行)。
它有一個過滿的盒子,因為廢話
asdfasfasdfasfasdfasfasdfasfasdfasfasdfasfasdfasdfasdfasdfasdfasdf
比線寬並且沒有單獨的單字。
回到原來的多個警告清單。查看文件輸出 pdf,看看發生了什麼格式設定。看看是否有大詞或公式無法容納在文本的狹窄部分中。尤其是在狹窄的列中,會出現未滿警告。使用“microtype”套件可以幫助在窄欄內排版。還要確保您選擇了正確的連字符語言。
答案2
article
與課堂配合良好
\documentclass{article}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[2]
\begin{wrapfigure}{r}{0.6\textwidth}
\centering
\includegraphics[width=0.55\textwidth]{example-image-a}
\caption{\label{fig:simpres}Residual values plot}
\end{wrapfigure}\lipsum
\end{document}