In LaTeX figures, one can use \textwidth
and \columnwidth
to specify sizes of the graphic relative to the size of surrounding text, e.g.
\includegraphics[width=.5\textwidth]{myimage}
.
I would like to easily switch from onecolumn to twocolumn template (and back) without the figure growing too large for onecolumn template. For twocolumn template (where \columnwidth
is roughly half the \textwidth
), I would like to have something like:
\includegraphics[width=.9\columnwidth]{myimage}
.
and for onecolumn template (where \columnwidth
and \textwidth
are equal):
\includegraphics[width=.5\textwidth]{myimage}
.
Now, I figured I could limit this using some kind of a min operator:
\includegraphics[width=min(.5\textwidth,.9\columnwidth)]{myimage}
but this is invalid syntax. Is there something like this to solve this problem, possibly through the use of LaTeX macro system?