0

I am unable to give the figure a name or figure number using the following latex command for, instance: $\vcenter{\hbox{\includegraphics[height=6.6em]{C:/Users/abc/Documents/g2}}}$. Thanks

6
  • 1
    Can you please make a complete minimal example? What's the reason for \vcenter? Are you using a figure environment?
    – egreg
    Commented Mar 15, 2019 at 18:28
  • @egreg $\vcenter$ is used just to center the argument and g2 is my figure's file name in my computer saved in C drive.
    – gete
    Commented Mar 15, 2019 at 18:47
  • 1
    That's clear. What's needed is to know where and how you use those commands. Please, add some context.
    – egreg
    Commented Mar 15, 2019 at 18:49
  • @David Carlisle sorry i am not familiar in drawing figures in normal latex constructs.
    – gete
    Commented Mar 15, 2019 at 19:10
  • @egreg I am using a software to draw figures and save into my computer and using the above latex commands, i am able to include my figures in latex file which runs successfully, but i couldn't name the figure and call it in the text to refer
    – gete
    Commented Mar 15, 2019 at 19:15

1 Answer 1

3

enter image description here

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
  \centering
  \includegraphics[height=6.6em]{example-image}
  \caption{An example image\label{eximg}}
\end{figure}

Some text, see Figure \ref{eximg}.

\end{document}

You must log in to answer this question.

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