9

I googled to find the answers to the above question. But by "label" I mean labeling the figure, not the label that is used for referencing. Let me explain.

Say I am making a figure for a high school presentation which shows various parts of a PC: the CPU, the monitor, the keyboard, the mouse, etc. I can insert the labels using a software like MS Paint. But inserting equations, letters with subscripts, superscripts is a very difficult using softwares like MS Paint.

For the same purposes I would like to use LaTeX. Is there a way to do that?

Another reason for wanting to use Latex is that Latex will perhaps create text in the form of vectors, i.e. the text will most likely not pixelate when zoomed into.

5
  • Do you want to place text on the image, or just above/below in the form of a caption?
    – Werner
    May 26, 2012 at 3:16
  • Text on the image. I know how to put captions, from the top of my head \caption{Schematic of a PC}... May 26, 2012 at 3:17
  • 2
    Caramdir's answer to Drawing on an image with TikZ shows one possible solution (instead of drawing shapes you can add text using nodes). May 26, 2012 at 3:21
  • 1
    If you are using Inkscape to create figures, you can output figures as pdf images with a *.tex file. You then input the tex file instead of the image, and all the text will be generated by LaTeX. May 26, 2012 at 3:33
  • @Scribblemacher: Wow! Yeah I think I remember something like that. I will give it a shot immediately. May 26, 2012 at 3:36

1 Answer 1

11

Here's an adaptation of Caramdir's excellent answer to Drawing on an image with TikZ :

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[
every pin edge/.style={thick,blue!50},pin distance=15mm,
cir/.style = {align=center,circle,fill=blue!50,minimum size=6pt,inner sep=0pt}
]

\node[anchor=south west,inner sep=0] (image) at (0,0) 
  {\includegraphics[width=0.45\textwidth]{ctanlion}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
  \node [cir,pin=110:{The \TeX book}] at (0.16,0.45) {};
  \node [cir,pin=60:\parbox{4cm}{CTAN lion \\ by Duane Bibby}] at (0.76,0.65) {};
\end{scope}
\end{tikzpicture}

\end{document}

enter image description here

2
  • 1
    What does distance=30cm do? May 26, 2012 at 5:51
  • 1
    @YiannisLazarides nothing! I forgot to delete it; I did it now. Thanks. May 26, 2012 at 5:51

You must log in to answer this question.

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