TeX - LaTeX Asked on August 1, 2021
I’m trying to include a figure (a pdf chart) in my document and wrap around it, but it’s giving me tons of overfull hbox errors. Here is the code:
documentclass{article}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{lipsum}
begin{document}
lipsum[2]
begin{wrapfigure}{r}{0.6textwidth}
centering
includegraphics[width=0.55textwidth]{example-image-a}
caption{label{fig:simpres}Residual values plot}
end{wrapfigure}lipsum
end{document}
They go away if I remove the wrapfigure
part, but obviously then I lose the ability to wrap around the figure which is important here. Any ideas?
Works fine with article
class
documentclass{article}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{lipsum}
begin{document}
lipsum[2]
begin{wrapfigure}{r}{0.6textwidth}
centering
includegraphics[width=0.55textwidth]{example-image-a}
caption{label{fig:simpres}Residual values plot}
end{wrapfigure}lipsum
end{document}
Answered by js bibra on August 1, 2021
Two documents - the one shown as an example, and the one with all the overfull warnings.
The example code has an underfull box because you forced a line break with wrapfigure, by using it as part of the paragraph. Documentation of wrapfig, on page 2, says:
- It is convenient to begin the environment between paragraphs, but if you want placement in the middle of a paragraph, you must put the environment between two words where there is a natural line break.
If at all possible, put the environment between paragraphs (leave a blank line before it).
It has an overfull box because the nonsense
asdfasfasdfasfasdfasfasdfasfasdfasfasdfasfasdfasdfasdfasdfasdfasdf
is wider than the line and has no separate words.
Back to the original list of multiple warnings. Look at the document output pdf and see what formatting happened. See if there are big words or formulas that can't fit in the narrow portion of the text. The underfull warnings, especially, are to be expected in narrow columns. Using package "microtype" can help the typesetting in narrow columns. Also make sure you have the proper language selected for hyphenation.
Answered by Donald Arseneau on August 1, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP