6

How to put two figures (different sizes) side by side in a single block in tikzposter?

Is there a neat way of using?

\begin{tikzfigure}[Caption of figure]
\includegraphics[width = \linewidth]{image}
\end{tikzfigure}

My code is:

\begin{center}
\begin{minipage}{0.45\linewidth}
\begin{tikzfigure}[Caption of figure1]
\includegraphics[height = 10cm]{figure1}
\end{tikzfigure}
\hfill
\end{minipage}
\begin{minipage}{0.45\linewidth}
\begin{tikzfigure}[Caption of figure2]
\includegraphics[height = 10cm]{figure2}
\end{tikzfigure}
\end{minipage}
\end{center}
\noindent

but the pictures a misaligned (vertically). I tried this suggestion: LaTeX figures side by side but it did not work properly. Normally I use

\begin{figure}
...
\end{figure}

environment, but it does not work with tikzfigure.

Thank you in advance!

7

This works:

\documentclass{tikzposter}

\title{The Title}
\author{The Author}

\begin{document}

\maketitle

\block{A Title}{%
\begin{center}
\begin{minipage}{0.45\linewidth}
  \centering
  \begin{tikzfigure}[Caption of figure1]
  \includegraphics[height = 10cm]{example-image-a}
  \end{tikzfigure}%
\end{minipage}\hfill
\begin{minipage}{0.45\linewidth}
  \centering
  \begin{tikzfigure}[Caption of figure2]
  \includegraphics[height = 10cm]{example-image-b}
  \end{tikzfigure}%
\end{minipage}
\end{center}
}

\end{document}

enter image description here

You probably might want to control the figures' width instead of their height, as in

\includegraphics[width=.75\linewidth]{image}

and using the optional argument for minipage, you can adjust vertical alignment; for example, using b (bottom alignment):

\documentclass{tikzposter}

\title{The Title}
\author{The Author}

\begin{document}

\maketitle

\block{A Title}{%
\centering
\begin{minipage}[b]{0.45\linewidth}
  \centering
  \begin{tikzfigure}[Caption of figure1]
  \includegraphics[width=.7\linewidth,height=5cm]{example-image-a}
  \end{tikzfigure}%
\end{minipage}\hfill
\begin{minipage}[b]{0.45\linewidth}
  \centering
  \begin{tikzfigure}[Caption of figure2]
  \includegraphics[width=.7\linewidth,height=10cm]{example-image-b}
  \end{tikzfigure}%
\end{minipage}%
}

\end{document}

enter image description here

  • Perfect (as usual)!! Thanks! I put incorrectly the "\hfill" and it causes the picture misaligned. – Arnold Klein Aug 29 '15 at 21:54
  • @Gonzalo Is there a way to set the distance between the two figures? – L.K. Aug 17 '18 at 15:44
2
\column{0.5}
\block{A figure}
 {
        \begin{tikzfigure}
            \includegraphics[width=0.2\textwidth]{thankyoupostit.png}
            \includegraphics[width=0.2\textwidth]{thankyoupostit.png}
            \includegraphics[width=0.2\textwidth]{thankyoupostit.png}
        \end{tikzfigure}
  }

We can put as many as figures very simply as done in above code snippet. But for this the total width requirement for images should be less than or equal to the size of column.

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.