Thursday, February 10, 2011

get rid of latex badboxes on framed figures

If you include in a LaTeX document a graphics file with a frame
`\fbox{\includegraphics[width=\textwidth]{file.png}}`
you will get a badbox warning. The solution is to substract twice the size of the frame:
`\fbox{\includegraphics[width=\textwidth-\fboxrule-\fboxrule]{file.png}}`
For multicolumn:
`\fbox{\includegraphics[width=\columnwidth-\fboxrule-\fboxrule]{file.png}}`