How can I auto adjust a equation to appear in the entire page? (Scale to equations, is this exist?)

To "scale" an equation to fit a box you can use \resizebox from the package graphicx. Below is a stripped example of your code that does what you are looking for.

\documentclass[landscape, 12pt]{report}
\usepackage{graphicx}
\pagestyle{empty}

\begin{document}
\noindent Here is some text
\begin{equation}
\resizebox{.9 \textwidth}{!} 
{
    $ a + b $
}
\end{equation}
and here is some more.
\end{document}

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 to 1.0 \textwidth (compiled with pdflatex):

Example 1

In this example it is set to 0.2 \textwidth

Example 2


Breaking huge fractions certainly is tricky, and I don't think there exists an automated solution for that.

So first off, let's see how your formula looks like (examples in plain-format):

\input amssym.def
\def\P{{\rm P}}
\def\E{\Bbb E}
$$
  \P(H_h|E_1,E_2,\dots,E_e,\dots E_\E)
  = { \P(H_h) \P(E_1|H_h) \P(E_2|H_h,E_1) \dots
    \P(E_e|H_h,E_1,E_2,\dots,E_{e-1},E_{e+1}\dots,E_\E) \ldots
    \P(E_\E|H_h,E_1,E_2,\dots,E_\E-1)
    \over
    \P(E_1,E_2,\dots,E_e,\dots,E_\E) }
$$

enter image description here

Oh my, we ran out of paper!

Knuth gives an example in the TeXbook how you can break the formula (exercise 19.9), and applying that solution here isn't exactly straight-forward, for there is many ways to do the splitting. Let's start off with two-line split:

$$
  \P(H_h|E_1,E_2,\dots,E_e,\dots E_\E)
  = {\displaystyle{\P(H_h) \P(E_1|H_h) \P(E_2|H_h,E_1) \dots
    \P(E_e|H_h,E_1,E_2,\dots,E_{e-1},E_{e+1}\dots,E_\E) \ldots
    \atop
    \hfill\P(E_\E|H_h,E_1,E_2,\dots,E_\E-1) } \over
      \P(E_1,E_2,\dots,E_e,\dots,E_\E) }
$$

enter image description here

Well, we didn't run out of paper, but we were left with an overfull box.

Maybe if we introduced a not-so-natural break instead:

$$
  \P(H_h|E_1,E_2,\dots,E_e,\dots E_\E)
  = { \displaystyle{ \P(H_h) \P(E_1|H_h) \P(E_2|H_h,E_1) \dots
    \P(E_e|H_h,E_1,E_2,
    \hfill
    \atop
    \qquad \dots,E_{e-1},E_{e+1}\dots,E_\E) \ldots
    \P(E_\E|H_h,E_1,E_2,\dots,E_\E-1) }
    \over
    \P(E_1,E_2,\dots,E_e,\dots,E_\E) }
$$

enter image description here

Now the space-requirements are better, albeit with a cost.

You could go really over the board and split it into three lines:

$$
  \P(H_h|E_1,E_2,\dots,E_e,\dots E_\E)
  = { \displaystyle{
      \displaystyle{ \P(H_h) \P(E_1|H_h) \P(E_2|H_h,E_1) \dots \hfill
      \atop
      \qquad \P(E_e|H_h,E_1,E_2,\dots,E_{e-1},E_{e+1}\dots,E_\E) \ldots }
      \atop
      \hfill \P(E_\E|H_h,E_1,E_2,\dots,E_\E-1) }
    \over
    \P(E_1,E_2,\dots,E_e,\dots,E_\E) }
$$

enter image description here

But that might be a tad too funky. I dunno.

So, how would an automated solution choose? I guess it would be really tricky.


Package resizegather can automatically shrink equations of environment gather of package amsmath to fit the line width.

The following example compares the equation using \textstyle of rdhs' answer with resizing the overlarge equation (too large by 148.64104pt):

\documentclass[landscape, 12pt]{report}
\usepackage[landscape]{geometry}
\usepackage{amsmath,amssymb}

\usepackage{resizegather}

\begin{document}
\begin{gather}
  \label{eq-tfrac}
    P\left(H_h|E_1,E_2,\ldots ,E_e,\ldots    E_{\mathbb{E}}\right)=\tfrac{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)}
  \\\label{eq-resized}
    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{gather}
\end{document}

Result

Including the equation number on the same line

Two examles/variations:

\documentclass[landscape, 12pt]{report}
\usepackage[landscape]{geometry}
\usepackage{amsmath,amssymb}

\usepackage{graphicx}
\usepackage{tabularx}

\newcommand*{\Sample}{%
  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)}%
}

\begin{document}
\refstepcounter{equation}
\[
  \resizebox{\linewidth}{!}{$\displaystyle\Sample$\quad(\theequation)}
\]
%
\refstepcounter{equation}
\[
  \begin{tabularx}{\linewidth}{@{}X@{\quad}l@{}}
    \resizebox{\linewidth}{!}{$\displaystyle\Sample$}&(\theequation)
  \end{tabularx}
\]
\end{document}

Result

Note: Keep in mind that it is usually better to avoid shrunk oversized equations.