With the adjustbox
package you can say
\adjustbox{max width=\columnwidth}{...}
that will scale the contents only if it exceeds the \columnwidth
, according to the documentation:
A good example is max width=\textwidth
which will limit large content to the text width but will not affect smaller content.
Of course \textwidth
is just by way of example and any dimension can be used.
Here's an example:
\documentclass{article}
\usepackage{adjustbox,lipsum}
\begin{document}
\noindent\adjustbox{max width=\textwidth}{%
\begin{tabular}{p{.7\textwidth}}\lipsum[2]\end{tabular}}
\noindent\adjustbox{max width=\textwidth}{%
\begin{tabular}{p{1.5\textwidth}}\lipsum[2]\end{tabular}}
\end{document}
As suggested by Martin Scharrer in a comment, the environment form can be even handier in this case:
\documentclass{article}
\usepackage{adjustbox,lipsum}
\begin{document}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{p{.7\textwidth}}\lipsum[2]\end{tabular}
\end{adjustbox}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{p{1.5\textwidth}}\lipsum[2]\end{tabular}}
\end{adjustbox}
\end{document}
The environment form automatically adds \noindent
.
adjustbox
package might help.