11

I have list of figures page. Some of these figures' captions have citation. How can I remove the citation from the list of figures page and keep the citation on the normal pages ? Regards

::::::::::::::::::::::::: Addendum I am using the following command :

\newcommand{\munepsfig}[3][scale=1.0]{%
    \begin{figure}[!htbp]
        \centering
        \vspace{2mm}
        \includegraphics[#1]{figures/#2.eps}
        \caption{#3}
        \label{fig:#2}
    \end{figure}
}

Sample Usage:

\munepsfig[scale=0.5,angle=90]{barchart}{Population over time}

4 Answers 4

18

Use the optional argument for \caption:

\caption[Text to the LoF]{Text for the document \cite{xx}}

With the edit to the original question, I would suggest this definition of \munepsfig (using the xparse package):

\usepackage{xparse}

\NewDocumentCommand\munepsfig{O{scale=1.0}mom}
{% 
\begin{figure}[!htbp] 
  \centering 
  \vspace{2mm} 
  \includegraphics[#1]{figures/#2.eps}
  \IfNoValueTF {#3}
    {\caption{#4}}
    {\caption[#3]{#4}} 
  \label{fig:#2} 
\end{figure}%
}

And use it like this:

\munepsfig[scale=0.5,angle=90]{image}[Text for the LoF]{Text for the document}

if you want to have a different text in the LoF, or simply as

\munepsfig[scale=0.5,angle=90]{image}{Text for the document and the LoF}

to have the same text in both the document and the LoF.

Note that the new third argument is optional so you only have to use it if you want to use the optional argument of \caption.

3
  • I am using this command in a predefined style : \newcommand{\munepsfig}[3][scale=1.0]{% \begin{figure}[!htbp] \centering \vspace{2mm} \includegraphics[#1]{figures/#2.eps} \caption{#3} \label{fig:#2} \end{figure} } % Sample Usage: % \munepsfig[scale=0.5,angle=90]{barchart}{Population over time}
    – M.M
    Aug 18, 2012 at 22:57
  • 1
    @Mohammed Please edit your question adding this information (and all other info that is relevant to the problem at hand) in a minimal, but complete document. Aug 18, 2012 at 23:00
  • @Mohammed I updated my answer with a new solution. Aug 18, 2012 at 23:26
6

If you use only \cite in the caption and not other citations commands and no optional arguments, an alternative is to use the etoolbox to add a pre and post hook to \listoffigures and to redefine \cite

\usepackage{etoolbox}

\makeatletter
\let\oldcite\cite
\pretocmd{\listoffigures}{\def\cite{\ignorespaces\@gobble}}{}{}
\apptocmd{\listoffigures}{\let\cite\oldcite}{}{}
\makeatother
5

If you want to do this because of your sorting bibliographystyle (by appearance), I suggest using the package notoccite.

It lets the citation in the toc, but its numbering is following where it appears in the body.

3

You need to change the setup of your custom command to take one additional argument, viz., the material to be written to the List of Figures. In the code below, the content of #4 is what will show up in the List of Figures; it should be quite similar to #3 except for the citation command.

\newcommand{\munepsfig}[4][scale=1.0]{%
    \begin{figure}[!htbp]
        \centering
        \vspace{2mm}
        \includegraphics[#1]{figures/#2.eps}
        \caption[#4]{#3}
        \label{fig:#2}
    \end{figure}
}

You'd use this modified command as follows:

\munepsfig[scale=0.5,angle=90]{barchart}{Population over time 
      \cite{some-source}}{Population over time}

A downside of this approach is this: if the material to be shown in the List of Figures is identical to what's to be shown in the caption, you still need to provide the fourth argument. If you don't, LaTeX will keep looking ahead in the input stream for the next token -- which could literally be anything -- and treat that as the command's fourth argument. Expect weird error messages and odd crashes if you do this...

3
  • sir how to label with this command \munepsfig
    – monika
    Apr 27, 2019 at 2:28
  • \munepsfig[scale=0.66]{mm3}{Effect of variation of $\alpha$ on path of node movement \mycite{r22}}{Effect of variation of $\alpha$ on path of node movement}{f3.6}
    – monika
    Apr 27, 2019 at 2:29
  • here f3.6 is label of my picture but there is ?? coming in the text
    – monika
    Apr 27, 2019 at 2:29

You must log in to answer this question.

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