0

I saw this post about fitting equations to the page width, but it did not really answer my question. I have the following snippet of my code:

\documentclass[11pt,a4paper,fleqn]{report}
\usepackage{amsmath}
\usepackage{amsfonts}        
\begin{document}

\begin{align}
I:=&...\\
&=(1+(-1)^m+(-1)^n+(-1)^m(-1)^n)b_{mn}\int_0^\infty\xi_2^n\int_0^\infty\xi_1^m\exp(-\frac{1}{2}\lambda_1\xi_1^2)\mathrm d\xi_1\exp(-\frac{1}{2}\lambda_2\xi_2^2)\mathrm d\xi_2\\
& = (1+(-1)^m+(-1)^n+(-1)^m(-1)^n)I_1\\ 
...
\end{align}
\end{document}

Resulting in the following for the two lines of equation that are worked out (the ... are some other code, but not relevant to the question)enter image description here As can be seen the first line is too long for the page and "pushes" the equation number to another line. Is there a way to shrink the equation, for example by using less space in the part before the integrals where the $1$'s are?

5
  • 4
    (1) welcome, (2) you should either rewrite the first line or break the line in two, directly shrinking it hurts readability and should always be avoided
    – daleif
    Commented Sep 26, 2018 at 12:38
  • 1
    (i) please correct your code snippet (packages had to be loaded before begin{document}, missing is document class); the most what can be done without breaking line is: \begin{align} I &:= ...\\ &=(1+(-1)^m+(-1)^n+(-1)^m(-1)^n)b_{mn} \int\limits_0^\infty\xi_2^n \int\limits_0^\infty\xi_1^m \mathrm{e}^{(-\frac{1}{2}\lambda_1\xi_1^2)}\mathrm{d}\xi_1 \mathrm{e}^{(-\frac{1}{2}\lambda_2\xi_2^2)}\mathrm{d}\xi_2\\ & = (1+(-1)^m+(-1)^n+(-1)^m(-1)^n)I_1 \end{align}
    – Zarko
    Commented Sep 26, 2018 at 12:54
  • It is part of a page-long derivation, and splitting it over two lines makes the readability of the total more difficult, that's why I'm hesitating to do it. But if it's the only solution, it's the only solution. Commented Sep 26, 2018 at 13:11
  • 1
    I would define a new function $f(m,n)=1+(-1)^m+(-1)^n+(-1)^{m+n}$. Commented Sep 26, 2018 at 13:14
  • Using (-1)^{m+n} instead of (-1)^m(-1)^n would already be a good start. YOu might also consider using e^{-\lambda_1\xi_1^2/2} instead of \exp(-\frac{1}{2}\lambda_1\xi_1^2}.
    – user30471
    Commented Sep 26, 2018 at 14:45

1 Answer 1

2

A solution with flalign, the \medmath command from nccmath and geometry to have a more decant right margin. Unrelated: I replaced := with \coloneqq from mathtools, so the colon be centred on the math axis:

\documentclass[11pt,a4paper,fleqn]{report}
\usepackage{mathtools, nccmath}
\usepackage{amsfonts}
\usepackage[showframe]{geometry}

\begin{document}

\begin{flalign}
 I&\coloneqq ... & & & & \\
    &=\medmath{(1+(-1)^m+(-1)^n+(-1)^m(-1)^n)b_{mn}\int_0^\infty\!\!\xi_2^n\int_0^\infty\!\!\xi_1^m\exp\Bigl(-\frac{1}{2}\lambda_1\xi_1^2\Bigr)\,\mathrm d\xi_1\exp\Bigl(-\frac{1}{2}\lambda_2\xi_2^2\Bigr)\,\mathrm d\xi_2}\\
    & = (1+(-1)^m+(-1)^n+(-1)^m(-1)^n)I_1\\
    ...
    \end{flalign}
    \end{document

} enter image description here

You must log in to answer this question.

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