0
  \begin{equation}

 \centering \Large \textbf{$\lambda_{c} = \frac{18.64}{B \times E^{2} }$ }

 \label{eq1:Critical wavelength}
 \end{equation}
\begin{center}
\captionof
{equation}{where B is the bending magnet magnetic  field ( B = 1T ) , E is the energy of the booster}
\end{center}
6
  • 4
    \captionof is not a standard command and is presumably the command that tex reported is undefined, although you did not show the error message, also \Large will have generated a warning as size commands are invalid in math mode, \centering also does nothing useful inside equation Commented Dec 27, 2021 at 22:05
  • 2
    What David says, but also blank lines are not allowed inside equation.
    – egreg
    Commented Dec 27, 2021 at 22:09
  • I made edits but the error still appears :( Commented Dec 27, 2021 at 22:11
  • 3
    you can not have blank lines in equation, \textbf{$...$} does nothing at all and it is very unusual to use captions with equations, the text where... would normally just be set as normal text after the equation. You have not provided a usable test document nor said what output you want, only provides a fragment that is really hard to guess what you want it to do. Commented Dec 27, 2021 at 22:31
  • Related: How to write a perfect equation parameters description?
    – Werner
    Commented Dec 27, 2021 at 23:23

1 Answer 1

3

Making a test document from your fragment

\documentclass{article}

\begin{document}

\begin{equation}

 \centering \Large \textbf{$\lambda_{c} = \frac{18.64}{B \times E^{2} }$ }

 \label{eq1:Critical wavelength}
 \end{equation}
\begin{center}
\captionof
{equation}{where B is the bending magnet magnetic  field ( B = 1T ) , E is the energy of the booster}
\end{center}

\end{document}

Produces the error

! Missing $ inserted.
<inserted text> 
                $
l.6 
    
? 

as blank lines are not allowed in math mode.

Deleting the blank lines you get

LaTeX Font Warning: Command \Large invalid in math mode on input line 6.   

so deletimg \Large

you get

! Undefined control sequence.
l.10 \captionof

as \captionof is defined by the caption or capt-of packages, but adding

\usepackage{capt-of}

defines \captionof command but as equations captioning is not set up you get

! Undefined control sequence.
<write> \@writefile{\ext@equation 
                                  }{\protect \contentsline {equation}{\prote...
l.14 \end{document}
                   
? 

as the equation already has an equation number it is hard to guess what formatting you would want for a separately numbered caption, so I suggest deleting this. Also \centering and \textbf are doing nothing in this context, so I think you want:

enter image description here

\documentclass{article}

\begin{document}

Some text
\begin{equation}
 \lambda_{c} = \frac{18.64}{B \times E^{2} }
 \label{eq1:Critical wavelength}
 \end{equation}
where $B$ is the bending magnet magnetic  field ($B = 1T$),
$E$ is the energy of the booster.


\end{document}

You must log in to answer this question.

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