# How can I align certain elements of the numerator and denominator in a fraction?

I have a large fraction containing very similar parts in both the numerator and denominator, but since the denominator has additional variables, the similar parts are not aligned together. Here is the picture:

I want is align similar parts of both numerator and denominator as in this (photo-edited) picture:

My source code:

\documentclass[]{report}

\usepackage{amsmath}

\begin{document}

$$I_{rs} = \frac{ y^{2} I_{sc,ref} \bigg[ 1 + \frac{\alpha}{100} (T_{op}-T_{ref}) \biggl] } {exp \left ( \displaystyle \frac{V_{oc,ref} \bigg[ 1 + \frac{\beta}{100} (T_{op}-T_{ref}) \biggl]} {a \thinspace V_{t}} \right) - 1 } % \label{eq:I_rs_trans}$$

\end{document}


## 2 Answers

I wouldn't align these as structurally aligning the terms seems confusing, but...

\documentclass[]{report}

\usepackage{amsmath}

\def\posA{0sp}\def\posB{0sp}
\begin{document}

$$\makeatletter I_{\mathrm{rs}} = \frac{ y^{2} I_{\mathrm{sc}sc,\mathrm{ref}} \pdfsavepos\write\@auxout{\gdef\string\posA{\the\pdflastxpos sp}}% \biggl[ 1 + \frac{\alpha}{100} (T_{\mathrm{op}}-T_{\mathrm{ref}}) \biggr]\kern2\dimexpr\posA-\posB\relax } {\exp \left ( \displaystyle \frac{V_{\mathrm{oc},\mathrm{ref}} \pdfsavepos\write\@auxout{\gdef\string\posB{\the\pdflastxpos sp}}% \biggl[ 1 + \frac{\beta}{100} (T_{\mathrm{op}}-T_{\mathrm{ref}}) \biggr]} {a \thinspace V_{t}} \right) - 1 } % \label{eq:I_rs_trans}$$

\end{document}


It takes two runs to stabilize. Note using \mathrm and \bigl on the left not the right.

I suspect your readers won't gain much, in terms of really understanding what's going on in the equation, if the two terms in square brackets are aligned. In fact, they might become confused, or at least distracted.

Your readers might, instead, appreciate something that's more compact:

\documentclass{report}
\usepackage{amsmath}
\begin{document}

$$\label{eq:I_rs_trans} I_{\mathrm{rs}} = \frac{ y^2 I_{\mathrm{sc},\mathrm{ref}} \bigl[ 1+\frac{\alpha}{100} (T_{\mathrm{op}}-T_{\mathrm{ref}}) \bigr] } { \exp\bigl\{ (a V_{t}{)}^{-1}V_{\mathrm{oc},\mathrm{ref}} \bigl[ 1+\frac{\beta}{100} (T_{\mathrm{op}}-T_{\mathrm{ref}}) \bigr] \bigr\} - 1 }$$

\end{document}