[Tex/LaTex] Latex: How to apply smaller size to all Figures/Tables contained in a Tex document

floatsscalingtables

Figures/Tables do not fit into the page, so that some tables get cut by their right side (imagine that I cannot see the end of the table on its right side). Here is the complicated part:

My situation:

  1. I have two modes under which I compile the document: INFORMS (1column) and IEEE(2 column)

The figures/tables are fine with IEEE template (2 column). It knows how to scale them well, so that everything fits.

All figures are large when compiled with INFORMS. I want to reduce the size by say 40% on each figure.

Some big tables do not fit into the page as described above.

My questions:

How can I apply 40% size reduction to all Figures (all Vector graphics), so that I get smaller figures without affecting the IEEE compilation part?

How to define the tables so that they fit even with INFORMS template?

I did my homework!

The only solution that I am thinking of based on my little knowledge of latex is to use flag and define the objects in a duplicated manner and, depending on which mode, render the appropriate tables\figures. Obviously, this is really ugly solution.

I am interested in solutions that can enforce something globally for all tables and/or figures.

Best Answer

When defining width of your floats, instead of using absolute size, you can use \textwidth.

For example,

\includegraphics[width = 0.5 \textwidth]{image.png}

will give you an image automatically scaled with respect to text width (as a result with respect to number of columns in your template).

The multiplication coefficient can be set in the beginning if you want to change the scaling of all floats at once.

\newcommand{\widthcoeff}{0.8}
...
\includegraphics[\widthcoeff \textwidth]{image.png}

If you don't want to manually change the coefficient for each case, you can also define a conditional.

\newif\ifieeeformat
\ieeeformattrue % if you comment this line out it will be false
\newcommand{\widthcoeff}{0.8}
...
\ifieeeformat
\renewcommand{\widthcoeff}{1}
\fi
Related Question