3

I want to put multiple figures in one frame. I am trying different combinations but neither works. I used subfigure (worked) but I didn't manage to put in a proper way the figures.

As I read, it's better to use subfig (and also it's easier for me), but it seems subfig always throw a lot of errors (and it opens the subfig.sty file).

\documentclass[10pt,blue]{beamer}

 \setbeamertemplate{navigation symbols}{}
 \usepackage[caption=false]{subfig}



\usepackage{fontspec}
\setsansfont{DejaVuSans}
\usepackage{polyglossia}
\setmainlanguage{greek}
 \setotherlanguage{english}

\usepackage{url}


 %\usepackage{caption}%,subcaption}



 \usepackage{ graphicx, amsmath, amssymb, lettrine}


\newcommand{\EN}[1]{\foreignlanguage{english}{#1}}
\mode<presentation>

\begin{document}

\begin{frame}
\frametitle{\EN{title}}
\setbeamercovered{transparent}


\begin{figure}
\centering

\subfloat[][]{\includegraphics[scale=0.55]{cad-}\label{lab1}}
\subfloat[][]{\includegraphics[scale=0.55]{grid}\label{lab2}}
\subfloat[][]{\includegraphics[scale=0.55]{grid}\label{lab3}}
\subfloat[][]{\includegraphics[scale=0.55]{grid}\label{lab4}}
\subfloat[][]{\includegraphics[scale=0.55]{grid}\label{lab5}}
\subfloat[][]{\includegraphics[scale=0.55]{grid}\label{lab6}}

%\caption{\EN{text} \protect\subref{lab1} \EN{some text} 
%  \protect\subref{lab2} \EN{ text}}

\end{figure}

\end{frame}

\end{document}

---------------UPDATE----------------------------------

Even with that setup doesn't work.. It seems subfig doesn't work. It opens the subfig.sty file.

\documentclass{beamer}

\usepackage[utf8x]{inputenc}
\usepackage{default}
\usepackage[caption=false]{subfig}


\begin{document}
Hello
\end{document}

---------------UPDATE 2---------------------------------------

Beginning of log file:

This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) (format=xelatex 2012.7.6)  9 SEP 2012 17:49
entering extended mode
 %&-line parsing enabled.
**forstack.tex
(./forstack.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, ibycus, monogreek, greek, ancientgreek, loaded.
(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/etc/texmf/tex/latex/config/graphics.cfg
File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live
)
Package graphics Info: Driver file: xetex.def on input line 91.

(/usr/share/texmf-texlive/tex/xelatex/xetex-def/xetex.def
File: xetex.def 2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

))
\Gin@req@height=\dimen102
\Gin@req@width=\dimen103
)
(/usr/share/texmf/tex/latex/beamer/base/beamer.cls
(/usr/share/texmf/tex/latex/beamer/base/beamerbasercs.sty
Package: beamerbasercs 2007/01/28 (rcs-revision 1.4)
)
Document Class: beamer 2007/03/11 cvs version 3.07 A class for typesetting pres
entations (rcs-revision 1.70)
(/usr/share/texmf/tex/latex/beamer/base/beamerbasemodes.sty

The first errors:

! Missing \endcsname inserted.
<to be read again> 
                   \ext@figure 
l.298 ...ined{c@subfigure}{\newsubfloat{figure}}{}

The control sequence marked <to be read again> should
not appear between \csname and \endcsname.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.298 ...ined{c@subfigure}{\newsubfloat{figure}}{}

You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Extra \endcsname.
\@ifundefined ...dafter \ifx \csname #1\endcsname 
                                                  \relax \expandafter \@firs...
l.298 ...ined{c@subfigure}{\newsubfloat{figure}}{}

I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
<to be read again> 
                   \ext@figure 
l.298 ...ined{c@subfigure}{\newsubfloat{figure}}{}

The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

! Extra \endcsname.
\newcounter ...ifdefinable \csname c@#1\endcsname 
                                                  {\@definecounter {#1}}\@if...
l.298 ...ined{c@subfigure}{\newsubfloat{figure}}{}

I'm ignoring this, since I wasn't doing a \csname.
12
  • 1
    The error you get should be self-explaining: you're loading subcaption along subfig. Load only one of them.
    – egreg
    Sep 7, 2012 at 12:40
  • @egreg :No, it still doesn't work
    – George
    Sep 7, 2012 at 13:21
  • Sorry, but "doesn't work" means nothing. What's not working?
    – egreg
    Sep 7, 2012 at 13:34
  • @egreg:As i said,it show a lot of errors (138) and it opens the subfig.sty file to this point "\@ifundefined{c@subfigure}{\newsubfloat{figure}}{}".
    – George
    Sep 7, 2012 at 13:39
  • You are loading lots of packages and any of them can cause problems. So this is not a MWE because you can take out packages one by one and see if the output has changed such that we don't have to guess your remaining document. Nevertheless, try with \usepackage[caption=false]{subfig}. Also are you using XeLaTeX?
    – percusse
    Sep 7, 2012 at 13:42

1 Answer 1

3

The following, modified form of your MWE (i) doesn't throw any errors and (ii) manages to place all six "figures" side-by-side. Because I don't have access to the files cad-[.pdf] and grid[.pdf], note that I had to load the graphicx package with the demo option set (which will just create a black blob in lieu of loading an actual graphics file).

Furthermore, since I have no idea what the natural scale of your graphics files may be, I've replaced all [scale=0.55] instructions with [width=1.4cm] instructions. I've also inserted various \hspace{1mm} instructions to create some separation between the subfloats.

enter image description here

\RequirePackage[demo]{graphicx} % remove this in final version
\documentclass[10pt,blue]{beamer}

\setbeamertemplate{navigation symbols}{}
\usepackage[caption=false]{subfig}

\usepackage{fontspec}
\setsansfont{DejaVuSans}
\usepackage{polyglossia}
\setmainlanguage{greek}
\setotherlanguage{english}

\usepackage{url}

%\usepackage{caption}%,subcaption}

\usepackage{ amsmath, amssymb, lettrine} % don't load graphicx package again -- beamer already does that

\newcommand{\EN}[1]{\foreignlanguage{english}{#1}}
\mode<presentation>

\begin{document}

\begin{frame}
\frametitle{\EN{title}}
\setbeamercovered{transparent}

\begin{figure}
\centering

\subfloat[][]{\includegraphics[width=1.4cm]{cad-}\label{lab1}}
\hspace{1mm}
\subfloat[][]{\includegraphics[width=1.4cm]{grid}\label{lab2}}
\hspace{1mm}
\subfloat[][]{\includegraphics[width=1.4cm]{grid}\label{lab3}}
\hspace{1mm}
\subfloat[][]{\includegraphics[width=1.4cm]{grid}\label{lab4}}
\hspace{1mm}
\subfloat[][]{\includegraphics[width=1.4cm]{grid}\label{lab5}}
\hspace{1mm}
\subfloat[][]{\includegraphics[width=1.4cm]{grid}\label{lab6}}

%\caption{\EN{text} \protect\subref{lab1} \EN{some text} 
%  \protect\subref{lab2} \EN{ text}}

\end{figure}
\end{frame}
\end{document}
8
  • :First of all thanks for your help.Unfortunately this also doesn't work.I receive a lot of errors.First,it opens the subfig.sty file in line " \@ifundefined{c@subfigure}{\newsubfloat{figure}}{}".
    – George
    Sep 9, 2012 at 13:40
  • :And some of the errors are: "Missing \endcsname inserted.....ined{c@subfigure}{\newsubfloat{figure}{} ", " Use of \the doesn't match its definition." , "Unknwon option `caption=false'for package subfig " , "Illegal unit of measure (pt inserted) \RequireXeTex " , " Missing number,treated as zero \RequireXeTex"
    – George
    Sep 9, 2012 at 13:43
  • @George - please indicate which TeX distribution you use. (I use MacTeX 2012 with all updates applied, and I get no error messages at all.) You are running XeLaTeX, right?
    – Mico
    Sep 9, 2012 at 14:18
  • :yes, i run xelatex , i use versions latex-beamer-3.20 and texlive-latex-2012 , texlive-latex-recommended (2009-7) ,texlive-latex-extra (2009-7)
    – George
    Sep 9, 2012 at 14:24
  • 1
    I think you have some problems with your tex installation. Make sure that only TeXLive 2012 and the actual beamer is used.
    – Mensch
    Sep 9, 2012 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .