labels – How to Label Figures in LaTeX Accurately

labelsnodes

I often have the need to apply leaders to a figure with some text. Right now I use Powerpoint with the Computer Modern Font and import the file to Overleaf in .pdf format. This workflow makes unappealing figures like the one below, because the text does not scale and is often hardly legible. Is there a way to label these figures right in Latex?

enter image description here

Best Answer

Since your question isn't about putting pictures side-by-side, I'll answer with a single image. Feel free to correct me if I'm wrong.

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{font=small, labelfont=bf}
\captionsetup[sub]{labelsep=period, subrefformat=brace}
\usepackage{tikz}

\begin{document}

\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\node at (0,0){\includegraphics[width=5cm]{example-image-a}};
\draw[->, >=latex] (-3,1) node[left]{Support}--(-1,0.5);
\draw[->, >=latex] (5,-1) node[right, text width=3cm]{CJP Weld\\ (Continuous Mesh)}--(1.5,0);
\draw[->, >=latex] (5,-1)--(1,-0.5);
\end{tikzpicture}
\caption{\label{fig:figure1} Description of figure 1.}
\end{figure}

\end{document}

result

The usual command to display an image is included in a node so that, inside the tikzpicture environment, you have all the TikZ commands to draw arrows (and a lot more if need be).

It isn't a perfectly elegant solution since you have to go through trials-and-errors to find the best coordinates for each extremity of each arrow, but it does the job.