Graphics, Figures & Tableshow to modify the text of captionlabel

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
clement
Posts: 15
Joined: Wed Oct 14, 2009 5:06 am

how to modify the text of captionlabel

Post by clement »

hi:

I try to set up the label of caption, and expect to modify the text
of label. I apply the following code:

Code: Select all

\begin{table}
 \renewcommand{\captionlabel}{test} 
\end{table}
but it not work. Could any one give any advice about that, thanks.

Recommended reading 2024:

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

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

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

how to modify the text of captionlabel

Post by sommerfee »

clement wrote:I try to set up the label of caption, and expect to modify the text of label. I apply the following code:
\captionlabel is coming from which package? From the caption or the ccaption package or the memoir document class or...?

Code: Select all

\begin{table}
 \renewcommand{\captionlabel}{test}
\end{table}
I do not see a \caption here where the redefinition could take affect.

Here comes a working example:

Code: Select all

\documentclass{article}
\usepackage{caption}
\DeclareCaptionLabelFormat{test}{test}
\captionsetup{labelformat=test}
\begin{document} 
\begin{figure} 
  \caption{No picture}
\end{figure} 
\end{document} 
clement
Posts: 15
Joined: Wed Oct 14, 2009 5:06 am

Re: how to modify the text of captionlabel

Post by clement »

thanks, and captionlabel is from package caption2.
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: how to modify the text of captionlabel

Post by phi »

please don't use caption2, it was replaced by caption.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: how to modify the text of captionlabel

Post by sommerfee »

...and the only support I (=author of the caption and caption2 packages) give for caption2 is helping migrating to one of the actual versions (3.0 or 3.1) of the caption package.

The section `Compatibility to older versions' in the actual caption package documentation contains a little guide for migrating from caption2 to caption 3.x, if you have any questions beyond that doc please don't hesitate to ask me.

I'm sorry about that, but caption2 is now outdated since about 6 years and it's not compatible to the modern needs of today, e.g. hyperref.

Axel
Post Reply