Using the follow MWE, I'm able to create a beautiful lists of photos on the left and a caption on the right (similarly, I could also use the sidecaption package or floats directly).
MWE [LuaLaTeX]:
\documentclass[letterpaper]{report}
\usepackage[demo]{graphicx}
\usepackage{fontspec}
\usepackage{savetrees}
\begin{document}
\begin{figure}[H]
\begin{minipage}{\textwidth}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\end{minipage}
\end{figure}
\end{document}
The issue is that when multiple photos or long (height) photos are added to the tabular environment, the photos go off of the page instead of a new page being created and going into the new page.
MWE [LuaLaTeX]:
\documentclass[letterpaper]{report}
\usepackage[demo]{graphicx}
\usepackage{fontspec}
\usepackage{savetrees}
\begin{document}
\begin{figure}[H]
\begin{minipage}{\textwidth}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\begin{tabular}{p{8cm}p{6cm}}
\vspace{0cm}
\includegraphics[width=8cm]{name} & Some text on the side.
\end{tabular}
\end{minipage}
\end{figure}
\end{document}
I noticed that outside of the minipage and tabular environments, everything works perfectly, but this isn't an option because I need a caption on the right side of the images and also need to ensure that LaTeX doesn't move pictures around randomly. Ideally I can keep everything inside the minipage and tabular enviornments.
MWE [LuaLaTeX]:
\documentclass[letterpaper]{report}
\usepackage[demo]{graphicx}
\usepackage{fontspec}
\usepackage{savetrees}
\begin{document}
\flushleft
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\includegraphics[width=8cm]{name} \\
\end{document}
I have hundreds of images that need to be formatted as in the first MWE, so applying \newpage
manually is not an option.
Is there a way to automatically move the images to new pages where necessary like it does in the last MWE?
Best Answer
You can use a separate figure for each image and to make sure the order is not altered you need only to specify the location options for each figure environment
[!htb]
. Also use\vspace{-0.25cm}
to align text and figures correctly. No need for aminipage
at all. See this modified code:The output as you want: