3

I'm trying to write

\[ \frac{1}{1+e^{\frac{\varepsilon-\mu}{k_B T}}} \]

but it looks really wonky. In particular the B in the subscript is just as big as everything else. I've seen this written in a way that looked nice (without using \exp or writing (...)/(...) instead of \frac{}{}. Is there any nicer way of doing this?

2
  • 4
    I would always recommend the exp syntax when the argument get complicated, easier to understand for the reader. Perhaps even combined with / instead of the fraction
    – daleif
    Commented Jul 15, 2021 at 21:08
  • Welcome to TeX.SE.
    – Mico
    Commented Jul 15, 2021 at 21:18

3 Answers 3

10

Consider the following four representations of the same mathematical expression.

enter image description here

  • The first row is from your posting. TeX knows about scriptstyle (for first-level subscripts and superscripts) and scriptscriptstyle (for second-level subscripts and superscripts) math, but not about scriptscriptscriptstyle. That's why the letter B looks too big relative to k and T.

  • The second row succeeds in making the overall expression less tall, by replacing \frac{1}{...} with [...]^{-1}. However, the letter B still looks too big.

  • The third row replaces e^{...} with \exp(...). This change, finally, succeeds in getting the relative sizes about right.

  • The fourth row replaces frac{a}{b} with (a)/(b), with inline-fraction notation.

In my view, the expressions in rows 3 and 4 both look good.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\addtolength\jot{4pt}
\begin{align*} 
&\frac{1}{1+e^{\frac{\varepsilon-\mu}{k_B T}}} \\
&\Bigl[1+e^{\frac{\varepsilon-\mu}{k_B T}}\Bigr]^{-1} \\
&\Bigl[1+\exp\Bigl(\frac{\varepsilon-\mu}{k_B T}\Bigr)\Bigr]^{-1} \\
&\bigl[1+\exp\bigl((\varepsilon-\mu)/(k_B T)\bigr)\bigr]^{-1}
\end{align*}
\end{document}
5

You can use\tfrac in the exponent (and \mathrm{e}, but that's another problem). Compare:

\documentclass{article}
\usepackage{mathtools}
\usepackage{lipsum}

\begin{document}

\[ \frac{1}{1+\mathrm{e}^{\frac{\varepsilon-\mu}{k_B T}}} \]

\[ \frac{1}{1+\mathrm{e}^{\tfrac{\varepsilon-\mu}{k_B T}}} \]

\end{document} 

enter image description here

4

If you prefer to have a smaller B you can use scalerel package with the command \scaleobj. Here's an example with a scaling factor of 0.7.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{scalerel}
\begin{document}
\[ \frac{1}{1+e^{\frac{\varepsilon-\mu}{k_{\scaleobj{.7}{B}} T}}} \]
\end{document}

enter image description here

1
  • 1
    +1. Scaling the letter B down seems, to me, preferable to using \tfrac, which in the present expression generates an overly large exponent term that towers over the letter e.
    – Mico
    Commented Jul 15, 2021 at 21:30

You must log in to answer this question.

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