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.

enter image description here

I want to put the equation right at the figure and center they both. How I can realize it?

share|improve this question
    
So the image shows what you're after, not what you've tried, right? How did you get the image? –  Werner Jul 9 at 17:44
    
It's just sketch created in the other program. –  iVi Jul 9 at 17:45
    
Thanks for editing! I don't know about this tag. –  iVi Jul 9 at 17:51

1 Answer 1

up vote 5 down vote accepted

I would place the graphic and equation in the following way:

enter image description here

\documentclass{article}
\usepackage[export]{adjustbox}
\begin{document}

\begin{figure}
  \centering
  \includegraphics[valign = c, width = .3\linewidth]{example-image} \qquad
  $\displaystyle A = \frac{B}{C}$
  \caption{A picture and an equation}
\end{figure}

\end{document}

The image would be vertically aligned at the center with the \displaystyle equation, thanks to adjustbox's export of options.

You don't have to add the caption, nor do you have to place it inside a figure float. You could also just use:

\[
  \includegraphics[valign = c, width=.3\linewidth]{example-image} \qquad
  A = \frac{B}{C}
\]
share|improve this answer
    
Yes; I guess this is more like what the OP wants. I'll delete my answer. –  Gonzalo Medina Jul 9 at 18:06
    
It's nice solution for "includegraphics", but there are more "tikzpicture" in my work (it doesn't have "valign" option). I will try to think out... –  iVi Jul 9 at 18:20
    
I used "baseline={([yshift=-.8ex]current bounding box.center)}". Result is near to one that I want to get... –  iVi Jul 9 at 18:26
    
@iVi: Sorry, but I didn't see you mouse being drawn using a tikzpicture... :) –  Werner Jul 9 at 18:36
    
It is so bad code, but it work. pastebin.com/jYtGbaxQ –  iVi Jul 9 at 18:36

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.