# Maximum figure width when using bmcart class

I am writing a paper for a journal and have to use the bmcart class of the BioMed Central template found here (direct link to ZIP file). I am using it with two columns:

\documentclass[twocolumn]{bmcart}


The bmcart class encloses every figure and its caption in a box. When I enable graphics in the template file:

\usepackage{graphicx}
%\def\includegraphic{}
%\def\includegraphics{}


and insert a plot without scaling:

\begin{figure}[h!]
\includegraphics{myplot}
\caption{\csentence{Sample figure title.}
Figure legend text.}
\end{figure}


then the plot overflows the box to the right. The width of my plot is 235 pt, the width I got using \showthe\columnwidth in a figure environment.

My question is: what is the optimal width for plots that I want to include so that when I do \includegraphics{myplot} there is no scaling and the plot fits perfectly inside the box drawn around it?

I would be really grateful if you could point out how to determine the optimal width in this case, but also in general, if possible.

Edit: thanks to @Fran for pointing out this question about the difference between \hsize, \columnwidth, \linewidth and other dimensions.

• for me it is not clear what you want but can you try \includegraphics[width=\hsize]{myplot}? – touhami Apr 10 '15 at 12:36
• I would try \includegraphics[width=\columnwidth]{myplot}. – Mico Apr 10 '15 at 12:39
• @Mico, in the case of bmcart, \columnwidth overflows the box boundaries to the right. I wrote that in my post but made a typo so it wasn't clear, now I fixed it. – nedim Apr 10 '15 at 13:17
• @touhami, my goal was not to scale the plot using, i.e., the width parameter. However, your comment has lead me to a solution. If I make my plots as wide as \hsize then they fit perfectly without scaling! Thank you, please write this as an answer and I will gladly accept it. – nedim Apr 10 '15 at 13:19
• @nedim there is no need to be answer. You're welcome. – touhami Apr 10 '15 at 13:48

In this case, \hsize returned the optimal width of the figure. \showthe\hsize returned 222.5 pt. When I made a 222.5 pt plot and included it in the paper using \includegraphics{myplot}, it fit perfectly without resizing.
In most cases though, \hsize should be avoided. I thank @egreg for his comment that clarifies why.
• I think that \linewidth is safer in general (see this famous question). BTW, why change the original image size instead of using [width=\linewidth]? You can lost some image resolution in the original source and overall ...It's a lot of work! – Fran Apr 10 '15 at 17:43
• Avoid using \hsize. – egreg Apr 11 '15 at 23:21
• @egreg, what is the reason for avoiding \hsize? I am not very experienced with LaTeX. – nedim Apr 12 '15 at 11:32
• @nedim Because \hsize is an internal parameter and you're not guaranteed that its current value is the line width that will be used for typesetting the paragraph. On the other hand, in lists you can rely on \linewidth, while outside of lists \columnwidth is the parameter to be used. – egreg Apr 12 '15 at 12:36