Graphics, Figures & Tablessubfigures in column in beamer class

Information and discussion about graphics, figures & tables in LaTeX documents.
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

subfigures in column in beamer class

Post by carol »

Hi,
I want to organize some figures on one frame as follows:

figure 1 subfigure2.1
subfigure2.2
subfigure2.3

so figure 1 at left in one column and 3 subfigures at right in another column.

I tried columns environment for the subfigures at right but they are displayed under figure 1. It seems that subfloat environment even if I load package subfig is not supported. I can't think of any other solution. Perhaps block environment is not appropriate.

Cheers,

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

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

subfigures in column in beamer class

Post by sommerfee »

carol wrote:It seems that subfloat environment even if I load package subfig is not supported.
But the subfigure and the subcaption package are working fine with beamer.
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

subfigures in column in beamer class

Post by carol »

I use \subfloat as indicated below. Note that I don't want to use caption or subcaption
\frame
{
\frametitle{Features of the Beamer Class}
\subfloat{\includegraphics[scale = 0.5]{~/Desktop/easter.png}}
\subfloat{\includegraphics[scale = 0.45]{~/Desktop/easter.png}}
}
And then, I'll get the following messages:

usr/share/texmf/tex/latex/caption/caption.sty:197:\@makecaption undefined. \renewcommand\@makecaption
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Missing \endcsname inserted ...ined{c@subfigure}{\newsubfloat{figure}}{}
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Missing \begin{document}. ...ined{c@subfigure}{\newsubfloat{figure}}{}
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Extra \endcsname ...ined{c@subfigure}{\newsubfloat{figure}}{}
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Missing \endcsname inserted ...ined{c@subfigure}{\newsubfloat{figure}}{}
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Extra \endcsname ...ined{c@subfigure}{\newsubfloat{figure}}{}
/usr/share/texmf/tex/latex/subfig/subfig.sty:298:Missing \endcsname inserted ...ined{c@subfigure}{\newsubfloat{fig
....
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

subfigures in column in beamer class

Post by sommerfee »

carol wrote:I use \subfloat as indicated below. Note that I don't want to use caption or subcaption
If you don't want to use the subcaption package (why?), you could still use the subfigure package instead. It may be superseeded by the subfig package, but at least it works with beamer while the subfig package does not.

Axel
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

Re: subfigures in column in beamer class

Post by carol »

Well I don't need to use subcaption for the figures in a presentation. The title is enough.

I don't understand why I can't use \subfloat and subfig package in a beamer class since it worked in report document.

Now I don't get error with \subfigure{\includegraphics...} but I don't get the figures in the order that I wanted:

figure1 subfig2.1
subfig2.2
subfig2.3
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

subfigures in column in beamer class

Post by sommerfee »

carol wrote:Well I don't need to use subcaption for the figures in a presentation. The title is enough.
If the title is enough why do you want to use the subfig package at all? Why don't you just place the figures like you want them to be placed?

And I still don't understand the thing about the subcaption package since the subcaption package has the same functionality as the subfig package - it even knows the \subfloat command.
I don't understand why I can't use \subfloat and subfig package in a beamer class since it worked in report document.
Because the subfig package is incompatible to the beamer document class. This is a known problem.
Now I don't get error with \subfigure{\includegraphics...} but I don't get the figures in the order that I wanted:
Could you please give us a complete example code so we can examine what is going wrong here?
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

subfigures in column in beamer class

Post by carol »

All I want to do is to organize 4 figures in 2 columns ordered horizontally, 1 figure in one column at left and the other three figures in vertical order in another column at right.

Here is the last code that I used with no message order but doesn't organize the figures in the way that i want:

Code: Select all

\documentclass{beamer}
\usepackage{beamerthemesplit}
\usepackage{subfigure}
\begin{document}
\frame
{
\frametitle{Features of the Beamer Class}
% for the figure that should be at left alone
\includegraphics[scale = 0.5]{easter1.png}
%for the subfigures that should be organized in vertical order together at right
\begin{figure}
	\subfigure{\includegraphics[scale = 0.5]{easter2.1.png}}
	\subfigure{\includegraphics[scale = 0.45]{easter2.2.png}}
\end{figure}
}
\end{document}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

subfigures in column in beamer class

Post by gmedina »

Why don't you use columns, as suggested by the following example?

Code: Select all

\documentclass{beamer}
\usepackage{beamerthemesplit}

\begin{document}

\frame
{
\frametitle{Features of the Beamer Class}

\begin{columns}
\column{.45\textwidth}
\centering
\rule{4cm}{6cm}

\column{.45\textwidth}
\centering
\rule{4cm}{2cm}\\
\rule{4cm}{2cm}\\
\rule{4cm}{2cm}
\end{columns}
}

\end{document}
I used black rectangles to simulate actual figures. You can, of course, use the standard \includegraphics command instead.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

Re: subfigures in column in beamer class

Post by carol »

Yes, it works perfectly. Thanks

How about if I want to shift the figures or in other cases, text or equations to the left in the left column and to the right in the right column instead of centering? Because in some cases, the objects in each column could become close to to the objects of in the other column at the boundaries of the columns. Tried \flushleft and \flushright don't work.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

subfigures in column in beamer class

Post by gmedina »

carol wrote:...How about if I want to shift the figures or in other cases, text or equations to the left in the left column and to the right in the right column instead of centering?...
Replace the \centering commands in my example with \raggedright, or \raggedleft.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply