# vertical spacing in one equation (not align)

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{exp\left(\frac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)}$$


That's my equation and here's its appearance

I think I can change the vertical spacing in the exp part. Because it looks like frac line touches the N and V in the document. But I don't know how.

Common advice is to insert a \mathstrut, which is an invisible construct of zero width and vertical dimensions like a parenthesis. But that is not tall enough to do the trick here. You could insert a strut of your own making, i.e., a zero width rule of suitable height, into the denominator, but that is a bit error prone. So you could pick up a trick from an old answer of mine:

\documentclass{article}
\makeatletter
\newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}}
\newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}}
\makeatother
\begin{document}
$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\frac{V_{oc_n}+K_v\Delta T}{\raisemath{-1pt}{nN_sV_t}}\right)}$$
\end{document}


(Incidentally, use \exp for the exponential function.)

• Or, instead of writing \mathstrut, write ^{\mathstrut}. – Mico Apr 28 '18 at 8:56
• @Mico Clever. I didn't think of that. – Harald Hanche-Olsen Apr 28 '18 at 9:02

When you nest fractions like that, they get "squeezed". Maybe \dfrac is what you want?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\dfrac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)}$
\end{document}


You can use the \mfrac (medium-sized fraction) from nccmath, which looks better anyway in nested fraction, with or without a \mathstrut, or \cfrac with the pair \biggl(...\biggr) in the place of \left(...\right). Compare:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, nccmath}

\begin{document}

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\frac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)}$$

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\mfrac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)}$$

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\mfrac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)^{\mathstrut}}$$

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\biggl(\cfrac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\biggr)}$$

$$I_D=\frac{I_{sc_n}+K_i\Delta T}{\exp\left(\cfrac{V_{oc_n}+K_v\Delta T}{nN_sV_t}\right)}$$
\end{document}


• You got a little runaway code in there. (Code as text) :) – Andreas Storvik Strauman Apr 28 '18 at 9:09
• Oh! yes. I didn't check where the cursor was when I inserted the image. Thanks for pointing it! – Bernard Apr 28 '18 at 9:42

Another solution would consist of not using \frac in the denominator and, instead, using inline-fraction notation. A benefit of taking this approach is that the symbols and letters won't be so tiny.

\documentclass{article}
\begin{document}
$$I_D=\frac{I_{sc_n}+K_i\Delta T}{% \exp[(V_{oc_n}+K_v\Delta T)/(nN_sV_t)]}$$
\end{document}