Graphics, Figures & TablesText between two Figures Side by Side

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mayankmi
Posts: 45
Joined: Sat Apr 20, 2013 7:52 pm

Text between two Figures Side by Side

Post by mayankmi »

My query is a bit complicated..

I want to put some text in between the space between two figure which are side by side. For example "+" between figure 1 and figure 2 and = between figure 2 and figure 3. So it will look like figure 1 + figure 2 = figure 3

Code: Select all

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\begin{document}
  \begin{figure}[!htb]
    \begin{minipage}{0.32\textwidth}
      \includegraphics[width=\linewidth]{x1}
      \caption{Prior 1 without trust factor}\label{fig:x1}
    \end{minipage}
    \hfill
    \begin{minipage}{0.32\textwidth}
      \includegraphics[width=\linewidth]{x2}
      \caption{Prior 2 without trust factor}\label{fig:x2}
    \end{minipage}
    \hfill
    \begin{minipage}{0.32\textwidth}%
      \includegraphics[width=\linewidth]{x}
      \caption{Posterior without trust factor}\label{fig:x}
    \end{minipage}
  \end{figure}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Klausiber
Posts: 16
Joined: Sun Apr 14, 2013 11:41 pm

Text between two Figures Side by Side

Post by Klausiber »

mayankmi wrote:I want to put some text in between the space between two figure which are side by side. For example + between figure 1 and figure 2 and = between figure 2 and figure 3. so it will look like figure 1 + figure 2 = figure 3
Well, just do it ;-)

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}

\begin{document}
  \begin{figure}[!htb]
    \begin{minipage}{0.3\textwidth}
      \includegraphics[width=\linewidth]{x1}
      \caption{Prior 1 without trust factor}\label{fig:x1}
    \end{minipage}\
    +
    \begin{minipage}{0.3\textwidth}
      \includegraphics[width=\linewidth]{x2}
      \caption{Prior 2 without trust factor}\label{fig:x2}
    \end{minipage}\
    =
    \begin{minipage}{0.3\textwidth}
      \includegraphics[width=\linewidth]{x}
      \caption{Posterior without trust factor}\label{fig:x}
    \end{minipage}
  \end{figure}
\end{document}
Note the demo option I added to graphicx so that the example works without the actual pictures present. Don't use this for your document. Also pay attention to the backslashes (\) following the first two {minipage} environments. Without them LaTeX ignores the white space before the "+" and "=".
mayankmi
Posts: 45
Joined: Sat Apr 20, 2013 7:52 pm

Re: Text between two Figures Side by Side

Post by mayankmi »

Thanks a lot, Klausiber! :)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Text between two Figures Side by Side

Post by Johannes_B »

You are putting all images in a single {figure} environment? If they belong together, you might want to take a look at the subfig or subcaption package.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply