Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to asign a number to equation which contains figure. My code is

\documentclass[12pt,a4paper]{article} 
\usepackage[slovak]{babel} 
\usepackage[utf8x]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage{palatino,verbatim}
\usepackage{amsmath} 
\usepackage{graphicx} 
\usepackage{float}

\begin{document}
\begin{itemize}
\item Self-energy:
\[
\raisebox{-3mm}{\includegraphics[width=0.8cm]{SelfEnergyAll.pdf}}
\qquad
\begin{aligned}
= -i\Sigma(p,\mathring{m},\mathring{g})(2\pi)^4 \delta(p_f - p_i) 
\end{aligned}
\]

\end{itemize}
\end{document}

Is there any way how to do that? By the way, is there a better way how to write this type of equations (I need to use them very often). Thanks.

share|improve this question
3  
Why not just use \begin{equation} and \end{equation} in place of \[ and \]? Then the equation will be numbered. –  Ian Thompson Apr 25 at 13:25
    
Well, good point, thank you. I didn´t think that would work. Anyway, is it possible to place the figure in front of the equation in any smarter way? Because now, if the equation becomes longer, I need to raise the figure more. I would like to have the figure always at the same position in front of the first =. –  Suzie Apr 25 at 13:35

2 Answers 2

You can just use an equation environment instead of \[...\]:

Sample output

\documentclass[12pt,a4paper]{article} 

\usepackage{amsmath} 
\usepackage{graphicx} 

\begin{document}

\begin{itemize}
\item Self-energy:
  \begin{equation}
    \vcenter{\hbox{\includegraphics[width=0.8cm]{example-image-a}}}
    = -i\Sigma(p,\mathring{m},\mathring{g})(2\pi)^4 \delta(p_f - p_i) 
  \end{equation}
\end{itemize}

\end{document}

\vcenter will center the box vertically with respect to the x-axis of the equation.

share|improve this answer
    
Yes, that looks fantastic! Thank you. –  Suzie Apr 25 at 13:39
    
With \usepackage[export]{adjustbox} you can do \includegraphics[width=0.8cm,valign=c]{file} –  egreg Apr 25 at 13:41
    
@egreg That's a nice alternative –  Andrew Swann Apr 25 at 17:48

Andrew's answer probably is what you are looking for. If you want to share numbering with figures I think you should use the figure environment:

\documentclass[12pt,a4paper]{article}
\usepackage[slovak]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{palatino,verbatim}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}

\usepackage{todonotes}

\begin{document}

\begin{figure}
\caption{}
\label{a fig}
\begin{itemize}
\item Self-energy:

%\raisebox{-3mm}[0cm][0cm]{\missingfigure[figwidth=0.8cm]{testing}}
\missingfigure[figwidth=0.8cm]{testing}
\[
\qquad
\begin{aligned}
= -i\Sigma(p,\mathring{m},\mathring{g})(2\pi)^4 \delta(p_f - p_i)
\end{aligned}
\]

\end{itemize}
\end{figure}
\end{document}
share|improve this answer
    
Note that figures float... –  Andrew Swann Jun 5 at 8:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.