3

I have a document as follows:

\documentclass[10pt,a4paper,landscape]{report}
\usepackage[a4paper,bindingoffset=0cm,left=2cm,right=2cm,top=2cm,bottom=2cm,footskip=2cm,landscape]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node {\includegraphics[scale=0.6]{example-image}};
\end{tikzpicture}
\quad
\begin{tikzpicture}
\node {\includegraphics[scale=0.6]{example-image}};
\end{tikzpicture}
\quad
\begin{tikzpicture}
\node {\includegraphics[scale=0.6]{example-image}};
\end{tikzpicture}
\end{document}

Which produces this image

output

I would like to horizontally and vertically align the three images on the page. I would also like to add some text above and below each image.

Note I must use tikzpicture as I am using the answer here. An example of my desired out put is as below (done roughly in paint)

enter image description here

  • 3
    The content is too wide for the page, as LaTeX tells you. And why are you using TikZ? – cfr Nov 27 '16 at 23:02
2

As it stands, the content is simply too wide for the text block. It is probably easiest to set the scaling as a proportion of the block width.

TikZ is not needed or especially suitable here. You probably want to handle these as sub-figures of an overall figure. The subcaption package can help with this.

For example:

\documentclass[10pt,a4paper,landscape]{report}
\usepackage[margin=2cm,footskip=2cm]{geometry}
\usepackage{subcaption}
\usepackage{graphicx}

\begin{document}
\begin{figure}
  \centering
  \caption{Some text above the whole figure.}
  \begin{subfigure}{.3\textwidth}
    \includegraphics[width=\linewidth]{example-image}
    \caption{First, an exciting contribution by unknown artist.}
  \end{subfigure}\quad
  \begin{subfigure}{.3\textwidth}
    \includegraphics[width=\linewidth]{example-image}
    \caption{Second, an anonymous mystery.}
  \end{subfigure}\quad
  \begin{subfigure}{.3\textwidth}
    \includegraphics[width=\linewidth]{example-image}
    \caption{Finally, an inscrutable offering by artist unknown.}
  \end{subfigure}
\end{figure}
\end{document}

Exhibition by Three Anonymous Artists

If the text above isn't meant to be a caption, just use regular text. If you need to refer to the figures or sub-figures, just use \label{fig:whatever} after the relevant \caption(s).

EDIT

If you really need then to be in tikzpicture environments, that's fine. Just nest them inside the subfigures. You just need to alter the size of the images included, obviously, to make room.

\documentclass[10pt,a4paper,landscape]{report}
\usepackage[margin=2cm,footskip=2cm]{geometry}
\usepackage{subcaption}
\usepackage{tikz}

\begin{document}
\begin{figure}
  \centering
  \caption{Some text above the whole figure.}
  \begin{subfigure}{.3\textwidth}
    \centering
    \begin{tikzpicture}
      \node {\includegraphics[width=.9\linewidth]{example-image}};
    \end{tikzpicture}
    \caption{First, an exciting contribution by unknown artist.}
  \end{subfigure}\quad
  \begin{subfigure}{.3\textwidth}
    \centering
    \begin{tikzpicture}
      \node {\includegraphics[width=.9\linewidth]{example-image}};
    \end{tikzpicture}
    \caption{Second, an anonymous mystery.}
  \end{subfigure}\quad
  \begin{subfigure}{.3\textwidth}
    \centering
    \begin{tikzpicture}
      \node {\includegraphics[width=.9\linewidth]{example-image}};
    \end{tikzpicture}
    \caption{Finally, an inscrutable offering by artist unknown.}
  \end{subfigure}
\end{figure}
\end{document}

Enhanced Exhibition by Unknown Artists

  • Hi @cfr. Thanks for your answer. I should have stated that I do have to use tikz, as I am using this solution: tex.stackexchange.com/questions/333026/… to have callout boxes automatically resize depending on my scaling. – Steve Hatcher Nov 27 '16 at 23:57
  • The point is, you don't need TikZ for this. You can put the tikzpictures in the subfigures with the images inside nodes inside the pictures. But for labelling them, you still want captions and you still want them to be sub-figures if you want separate captions. – cfr Nov 28 '16 at 0:03
  • @SteveHatcher Please see edit above. – cfr Nov 28 '16 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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