Graphics, Figures & TablesCaption package: problem changing caption name in LyX

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
di remigio
Posts: 4
Joined: Tue Sep 08, 2009 7:22 pm

Caption package: problem changing caption name in LyX

Post by di remigio »

I need to change the captions of certain figures in a document from "Figure" to "Diagram". I tried the caption package using the command "\captionsetup{name=Diagram}" where it was needed. Problem is that it generates an error and I don't know how to solve it.

Thank you.

Recommended reading 2024:

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

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Caption package: problem changing caption name in LyX

Post by meho_r »

Try defining \captionsetup{figurename=Diagram} inside the float (use ERT just after the image but before caption, inside the float) to apply the change for one figure/diagram only. You can't use "name" since it's not clear on what it is to be applied. There are more details and examples of customizing in caption package manual.
di remigio
Posts: 4
Joined: Tue Sep 08, 2009 7:22 pm

Re: Caption package: problem changing caption name in LyX

Post by di remigio »

Same error... Is it possible to do it without using this package?
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Caption package: problem changing caption name in LyX

Post by sommerfee »

What error do you get? Can you provide an example code?

This one is running fine here:

Code: Select all

\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{figure}
\centering
A figure
\caption{A figure}
\end{figure}
\begin{figure}
\captionsetup{name=Diagram}
\centering
A diagram
\caption{A diagram}
\end{figure}
\end{document}
Personally I find this approach a little bit confusing to the reader, I think it would be better to have separated counters for figures and diagrams, like here:

Code: Select all

\documentclass{article}
\usepackage{caption}
\DeclareCaptionType[fileext=lod]{diagram}
\begin{document}
\begin{figure}
\centering
A figure
\caption{A figure}
\end{figure}
\begin{diagram}
\centering
A diagram
\caption{A diagram}
\end{diagram}
\end{document}
HTH,
Axel
Post Reply