# How can I group all these equations in just one group and write them without the error Missing \$ inserted. …gy}

here is the equation I would like to write but it is not working as it should

Here is what I have tried so far

    $$\label{eq:3.2} & $(EQE)= \frac{photons_{out}}{electrons_{in}}$ & = \frac{radiant flux / photon energy}{injected current / elementary charge}$$

• Please show a compilable minimal working example (MWE) showing what you have tried so far – fractal Dec 20 '19 at 16:47
• Nest an amsmath aligned environment in an equation. – Bernard Dec 20 '19 at 16:50
• You are putting math mode () inside math mode (equation). Remove $ and $. Also, use \text for photon, out, radiant flux, etc. – fractal Dec 20 '19 at 17:01

You are nesting math mode  in another math environment {equation}. This is a recommended version of your equation.

Some notes:

• The number should go to the last line of the equation.
• Use \text from amsmath to display text.
• Use align from amsmath to align equations on different lines.
• Don't use numbers in labels. Use meaningful labels for \label.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\text{EQE}&=\frac{\#\,\text{photons}_{\text{out}}}{\#\,\text{electrons}_\text{in}}\nonumber\\
&=\frac{\Phi_e/E_{\text{ph}}}{I_{\text{in}/e}}=\frac{\Phi_e\times e}{I_{\text{in}\times E_{\text{ph}}}}\nonumber\\
&=\frac{\pi\times A\times L_{\text{v}}\times e\times \lambda_{\text{average}}}{K_{\text{m}}\times V(\lambda_{\text{peak}})\times I_{\text{in}}\times hc}\label{eq:somename}
\end{align}
\end{document}


• +1 for "Use meaningful labels for \label." – Mico Dec 20 '19 at 17:17
• If there's any chance such an expression might appear in a theorem or other italic environment, you want to use either \mathrm or \textup to ensure that the "words" don't become italic. \text follows the upright or italic style of the surrounding text. – barbara beeton Dec 20 '19 at 20:29
• @barbarabeeton I would say that in an italic environment, I want those text to be italic as well. – fractal Dec 21 '19 at 1:05

I would use a single aligned environment inside an equation environment. I would also use \mathrm and \textnormal for words and acronyms.

\documentclass{article}
\usepackage{amsmath} % for 'aligned' environment
\usepackage{newpxtext,newpxmath} % optional
\numberwithin{equation}{section} % optional

\begin{document}
\setcounter{section}{4}  % just for this example
\setcounter{equation}{4}

\label{eq:EQE} \begin{aligned} \mathrm{EQE} &= \frac{\textnormal{\#photons}_{\textnormal{out}}}{\textnormal{\#electrons}_{\textnormal{in}}}\\ &= \frac{\textnormal{radiant flux}/\textnormal{photon energy}}{\textnormal{injected current}/\textnormal{elementary charge}} \end{aligned}
\end{document}