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

enter image description here

Here is what I have tried so far

    \begin{equation} \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.
  &=\frac{\text{radiation flux}/\text{photon energy}}{\text{injected current}/\text{elementary charge}}\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}

enter image description here

  • +1 for "Use meaningful labels for \label." – Mico Dec 20 '19 at 17:17
  • 1
    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.

enter image description here

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

\setcounter{section}{4}  % just for this example

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

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.