On 06/07/2011 12:04 PM, Sebastian Krämer wrote:
Hello there!
I'm supposed to write a report (mokay) and use a custom template/class
for that (nah..). So while my report by lyx was looking great, now I
have to adopt and port from article to the custom latex class that was
provided for me.
Now, I read about creating a lyx layout file and created, from what I
gathered in the class file, the following layout:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[SMBV11,article]{SMBV}
#Format 35
Input stdclass.inc
Provides inputenc 1
Provides babel 1
Provides multicol 1
Provides ae 1
Provides eurosym 1
Provides amsmath 1
Provides amsfonts 1
Provides amssymb 1
Provides amsextra 1
Provides epsfig 1
Provides graphics 0
Provides graphicx 0
Provides algorithm 1
Provides algorithmic 1
Provides fontenc 1
Provides subfigure 1
Provides subfig 0
Provides figure 1
where I tried to list everything that gets imported by the class file.
That class file inherits from article.
Now the problem is with figures. I created a minimal sample (see
attached) and I'm getting the following error:
..
(/usr/share/texmf/tex/latex/graphics/epsfig.sty)
(/usr/share/texmf/tex/latex/subfigure/subfigure.sty
! LaTeX Error: Command \c@subfigure already defined.
Or name \end... illegal, see p.192 of the manual.
I "figure" this comes from the following code in the class template:
\renewenvironment{figure}
{\setcounter{subfigure}{0}
\@float{figure}}
{\end@float}
Further, we're supposed to add graphics (eps only) to the document like
in the following snippet:
\begin{figure}[b]
\centering
\subfigure[Eins]{\includegraphics[width=0.3\textwidth]{Bilder/SMBV11_EMuster_fig1}}
\subfigure[Zwei]{\includegraphics[width=0.3\textwidth]{Bilder/SMBV11_EMuster_fig2}}
\subfigure[Drei]{\includegraphics[width=0.3\textwidth]{Bilder/SMBV11_EMuster_fig3}}
\caption{\label{SMBV11_EMuster_fig01}Beispiel für...}
\end{figure}
So I can't change the template. Does anybody know how I can change the
layout so that figures work?
My wild guess is that I have to force figures to use \subfigure and not
\subfloat but I'm totally not sure.
Sorry for the lenghty post. But I have hope that someone out there has
come across this before or knows how to tackle this.
Regards,
Sebastian
Hi,
A few things:
- Your layout will try to load a SMBV11.cls file, is that right?
- Don't put # in front of "Format 35", that makes it a comment
- If your class is derived from article, you're a bit better off to use
"Input article.layout" instead of "Input stdclass.inc"
- Remove the "Provides something 0" lines
- There is no package "figure"
--
Julien