2

I want to know if there is a tool to automatically resize the equations if they are longer than \pagewidth.

The whole story is that I am compiling my thesis in b5paper, but I want to also produce a pdf that is more ebook-size-friendly. Therefore, I am compiling the source documents again with a smaller paper size. Long equations that are correctly displayed in b5paper go over the margin in the new smaller paper. I tried to use the breqn package, but as soon as I load it, the compiler never ends compiling.

Any other idea?

Thanks in advance

0

2 Answers 2

2

Scaling elements which contain text is usually a bad idea, see Why not scale elements that contain text

I suggest to use a smaller font size or split the equations over multiple lines instead.

\begingroup
    \scriptsize%
    \begin{equation}
     x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
    \end{equation}
\endgroup

If you must scale them, you could try \resizebox:

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\begin{equation}
\resizebox{.9\textwidth}{!}{
     x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
}
\end{equation}


\end{document}

Or if you also want to apply it to short equations which don't need to be scaled:

\documentclass{article}

\usepackage{adjustbox}

\begin{document}

\begin{equation}
\adjustbox{max width=.9\textwidth}{
     x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
}
\end{equation}


\begin{equation}
\adjustbox{max width=.9\textwidth}{
     x x x x x x x x x x x x x x x x x x x x 
}
\end{equation}

\end{document}
1
  • I wanted to have something that does not force me to change each one of the formulas in the whole book. I guess there is no better solution that the ones you proposed. Thanks anyway. Commented Sep 4, 2018 at 12:08
0

Use \scalebox as in this example

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}

\begin{document}
        \begin{equation}      
            \scalebox{4.0}{$
                    y=2x+5
                $}
        \end{equation}
\end{document}
2
  • Bad idea, this will result in very uneven fontsizes throughout your document: tex.stackexchange.com/questions/425453/… Commented Oct 12, 2023 at 16:36
  • 2
    Besides what @samcarter_is_at_topanswers.xyz said, this doesn't answer the question. First, there is nothing automatic in this; second, the question is about making too long equations smaller, not small equations larger. Did you read the question at all?
    – campa
    Commented Oct 12, 2023 at 16:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .