4

I am trying to find a way to make the equations that appear in this text a bit more better looking...

\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{relsize}

\begin{document}

\begin{equation}
    N_\text{c}(i) = \dfrac{N_\text{o}(i)}{1 - \mathlarger{‎‎\sum}_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b} - N_\text{o}(i)/2N_\text{b}}\label{eq:Bollinger}
\end{equation}

\begin{equation}
    N_\text{c}(i) = -N_\text{b}\ln{\left(1-\dfrac{N_\text{o}(i)/N_\text{b}}{1-\mathlarger{\sum}_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b}}\right)}
\end{equation}

\begin{equation}
    N_\text{c}(i) = -N_\text{b}\dfrac{\ln{\left(1-\dfrac{N_\text{o}(i)/N_\text{b}}{1-\mathlarger{\sum}_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b}}\right)}}{1-\sigma\tanh\left(\sigma\mathlarger{\sum}_{j=i_0}^{i-1}N_\text{c}(j)/N_\text{b}\right)}
\end{equation}

\end{document}

enter image description here

Any idea on how to make them look more beautiful?

10
  • 3
    Rewrite them to not look like monsters?
    – TeXnician
    Nov 3, 2017 at 14:45
  • 1
    @TeXnician Thank you very much for your comment! What do you mean rewrite them?
    – Thanos
    Nov 3, 2017 at 14:46
  • 2
    Well, I just mean that the equations as they are written do not look that bad (actually if that's your real text width I think it's pretty good then). But they look monstrous, because of how they are written (much white space etc.) So the most effective way of making them "beautiful" would probably be to use some other form, but I'm no mathematician, so can't judge if that would be a good idea.
    – TeXnician
    Nov 3, 2017 at 14:50
  • @TeXnician Exaclty this white space is the problem, but I would prefer to keep the form as is, since it makes it more comprehensive in the text...
    – Thanos
    Nov 3, 2017 at 14:53
  • 1
    Most of your extra whitespace is caused by including the sums in the fractions. If I was in your shoes, I would define something like S = \sum_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b} in the line before the equation, and then rewrite the equations in terms of S. Nov 3, 2017 at 19:17

4 Answers 4

7

Avoid having blank lines before display mat, or consecutive display math (TeX can not really handle either in a sane way) and keep control over the delimiters by avoiding \left\right I guessed you want to keep the \limits setting of the summation so I kept the normal summation (which has better vertical alignment) and made a larger but still fixed bracket size to cope with the large numerator.

enter image description here

\documentclass{article}
\usepackage{amsmath, amssymb}
\makeatletter
\def\Biggg#1{{\hbox{$\left#1\vbox to21\p@{}\right.\n@space$}}}
\def\Bigggl{\mathopen\Biggg}
\def\Bigggm{\mathrel\Biggg}
\def\Bigggr{\mathclose\Biggg}
\makeatother

\begin{document}

align (or gather if no alignement)
\begin{align}
    N_{\mathrm{c}}(i) &= \frac{N_\text{o}(i)}{1 - ‎‎\sum\limits_{j=i_0}^{i-1}N_\text{o}(j)/N_{\mathrm{b}} - N_\text{o}(i)/2N_{\mathrm{b}}}\label{eq:Bollinger}
\\[\jot]
    N_{\mathrm{c}}(i) &= -N_{\mathrm{b}}\ln{\Biggl(1-\frac{N_\text{o}(i)/N_{\mathrm{b}}}{1-\sum\limits_{j=i_0}^{i-1}N_\text{o}(j)/N_{\mathrm{b}}}\Biggr)}
\\[\jot]
    N_{\mathrm{c}}(i) &= -N_{\mathrm{b}}\frac{\ln{\Bigggl(1-\dfrac{N_\text{o}(i)/N_{\mathrm{b}}}{1-\sum\limits_{j=i_0}^{i-1}N_\text{o}(j)/N_{\mathrm{b}}}\Bigggr)}}{1-\sigma\tanh\left(\sigma\sum\limits_{j=i_0}^{i-1}N_{\mathrm{c}}(j)/N_{\mathrm{b}}\right)}
\end{align}

\end{document}
6

Instead of \mathlarger{\sum}, just make sure the numerators and denominators are in display-style math. To avoid excessively large parentheses, use \sum\nolimits. Use \Biggl( and \Biggr) for the larger parentheses in rows 2 and 3, and use \Bigl( and \Bigr) for the parentheses in the denominator of row 3. Finally, I would use \mathrm rather than \text to render the items c, i and o, to get the math-specific spacing.

enter image description here

\documentclass{article}
\usepackage{amsmath, amssymb}
\newcommand\ddfrac[2]{\dfrac{\displaystyle #1}{\displaystyle #2}}

\begin{document}

\begin{align}
N_{\mathrm{c}}(i) 
&= \ddfrac{N_{\mathrm{o}}(i)}{1 - \sum\nolimits_{j=i^{}_0}^{i-1}N_{\mathrm{o}}(j)/N_{\mathrm{b}} - N_{\mathrm{o}}(i)/2N_{\mathrm{b}}}\label{eq:Bollinger}\\[2ex]
N_{\mathrm{c}}(i) 
&= -N_{\mathrm{b}}\ln\Biggl(1-\ddfrac{N_{\mathrm{o}}(i)/N_{\mathrm{b}}}{1-\sum\nolimits_{j=i^{}_0}^{i-1}N_{\mathrm{o}}(j)/N_{\mathrm{b}}}\Biggr) \\[2ex]
N_{\mathrm{c}}(i) 
&= -N_{\mathrm{b}}\,\ddfrac{\ln\Biggl(1-\ddfrac{N_{\mathrm{o}}(i)/N_{\mathrm{b}}}{1-\sum\nolimits_{j=i^{}_0}^{i-1}N_{\mathrm{o}}(j)/N_{\mathrm{b}}}\Biggr)}{1-\sigma\tanh\Bigl(\sigma\sum\nolimits_{j=i^{}_0}^{i-1}N_{\mathrm{c}}(j)/N_{\mathrm{b}}\Bigr)}
\end{align}

\end{document}
5

If you must keep the equation as it is and just remove the excess space (nasty thing to do but...) you can use fixit from this solution:

\fixit[<mathstyle>]{<left-delim>}{<content>}{<right-delim>}

The command definition is:

\usepackage{amsmath}
\newcommand\fixit[4][\displaystyle]{
  \setbox0=\hbox{$#1#3$}
  \setbox2=\hbox{$\vcenter{\copy0}$}
  \raisebox{\dimexpr\ht0-\ht2}{$#1\left#2\copy2\right#4$}
}

MWE for your case:

\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{relsize}
\newcommand\fixit[4][\displaystyle]{
  \setbox0=\hbox{$#1#3$}
  \setbox2=\hbox{$\vcenter{\copy0}$}
  \raisebox{\dimexpr\ht0-\ht2}{$#1\left#2\copy2\right#4$}
}
\begin{document}

\begin{equation}
    N_\text{c}(i) = -N_\text{b}\ln{\fixit{(}{1-\dfrac{N_\text{o}(i)/N_\text{b}}{1-\mathlarger{\sum}_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b}}}{)}}
\end{equation}

\end{document}

The result:

Result

0
4

One way to reduce the white space (I do not think that the following is really more beautiful) is to make your \mathlarger small again.

The white space (AFAIK) results from the computations of \left etc. which stupidly scales up the parenthesis. See e.g. "(" or "\left(" parentheses?

equations

\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{relsize}

\begin{document}

\begin{equation}
    N_\text{c}(i) = \frac{N_\text{o}(i)}{1 - ‎‎\sum_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b} - N_\text{o}(i)/2N_\text{b}}\label{eq:Bollinger}
\end{equation}

\begin{equation}
    N_\text{c}(i) = -N_\text{b}\ln{\Biggl(1-\frac{N_\text{o}(i)/N_\text{b}}{1-\sum_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b}}\Biggr)}
\end{equation}

\begin{equation}
    N_\text{c}(i) = -N_\text{b}\frac{\ln{\Biggl(1-\dfrac{N_\text{o}(i)/N_\text{b}}{1-\sum_{j=i_0}^{i-1}N_\text{o}(j)/N_\text{b}}\Biggr)}}{1-\sigma\tanh\left(\sigma\sum_{j=i_0}^{i-1}N_\text{c}(j)/N_\text{b}\right)}
\end{equation}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.