If I have a document like this:
\documentclass[landscape, 12pt]{report}
\usepackage[landscape]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amssymb, graphics, setspace}
\newcommand{\mathsym}[1]{{}}
\newcommand{\unicode}[1]{{}}
\newcounter{mathematicapage}
\begin{document} \begin{equation}\label{Equation:Naive_Bayes_Classifier}
P\left(H_h|E_1,E_2,\ldots ,E_e,\ldots E_{\mathbb{E}}\right)=\frac{P\left(H_h\right) P\left(E_1|H_h\right) P\left(E_2|H_h,E_1\right) \text{$\ldots $P}
\left(E_e|H_h,E_1,E_2,\ldots ,E_{e-1},E_{e+1} \ldots, E_{\mathbb{E}}\right) \text{$\ldots $P}
\left(E_{\mathbb{E}}|H_h,E_1,E_2,\ldots ,E_{\mathbb{E}-1}\right)}{ P\left(E_1,E_2,\ldots,E_e, \ldots ,E_{\mathbb{E}}\right)}
\end{equation}
\end{document}
How can I auto adjust this equation to appear in the entire page, using all horizontal space? (Without badboxes or smaller than the width of the page?)
If is there a kind of scale to use in equations, giving explicity how greater the equation should become, this solver my problem too.
Best Answer
To "scale" an equation to fit a box you can use
\resizebox
from the packagegraphicx
. Below is a stripped example of your code that does what you are looking for.Here the
.9
determines how much of the width you'd like to take up, in this case I choose 90% though you can fit to your liking. The!
as the second argument will preserve the aspect ratio.Giving credit where it is due, a very similar question was answered on Stack Exchange recently about shrinking the equation. In both cases the
\resizebox
should suffice, though it is not recommended. Personally, I would consider splitting the equation. Having an inconsistent math font size can be a typographical nightmare.Examples
Here the argument to
\resizebox
is set to1.0 \textwidth
(compiled withpdflatex
):In this example it is set to
0.2 \textwidth