Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In a long paper, full of figures labeled as usual, there are two figures which I would like to single out and label with symbols. For instance, I would like to have them labeled Figure $\dag$ and Figure $\ddag$. I would like to do this in a way that is compatible with \label and \ref, so that when I refer to Figure $\dag$ \label{dagfig} with \ref{dagfig}, I get $\dag$. I would also like the figures to appear with this labeling in the list of figures. Is there some way to do this?

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

You can redefine \thefigure locally and step down the figure counter:

\documentclass{article}

\begin{document}

\listoffigures

\begin{figure}
\renewcommand\thefigure{$\dag$}
\caption{Figure dag}
\label{fig:dag}
\addtocounter{figure}{-1}
\end{figure}

\begin{figure}
\renewcommand\thefigure{$\ddag$}
\caption{Figure ddag}
\label{fig:ddag}
\addtocounter{figure}{-1}
\end{figure}

Figures~\ref{fig:dag}, and~\ref{fig:ddag}...

\begin{figure}
\caption{Regular figure}
\label{fig:fig}
\end{figure}

\end{document}

enter image description here

egreg has suggested a refinement to the above solution using a new command:

\documentclass{article}

\makeatletter
\newcommand\specialcaption[1]{%
  \@namedef{the\@captype}{#1}%
  \addtocounter{\@captype}{-1}\caption}
\makeatother

\begin{document}

\begin{figure}
\specialcaption{$\dag$}{Figure dag}
\label{fig:dag}
\end{figure}

\begin{figure}
\specialcaption{$\ddag$}{Figure ddag}
\label{fig:ddag}
\end{figure}

Figures~\ref{fig:dag}, and~\ref{fig:ddag}...

\begin{figure}
\caption{Regular figure}
\label{fig:fig}
\end{figure}

\end{document}

\specialcaption also admits the optional argument, as in

\specialcaption{$\dag$}[short]{long}

and, since it uses \@captype, this command can also be used in the table environment. Usual precautions about using fragile commands also apply to \specialcaption.

share|improve this answer
    
Thanks again for your help. –  Andrey Jun 11 '12 at 21:42
    
Gonzalo, look in the chat. –  egreg Jun 11 '12 at 21:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.