0

I am using a customised caption. It creates one title caption followed by another caption. I want to display the title caption in the list of figures, but not the second one. How could I hide the second caption in the list of figures?

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}


%%%%%caption set up%%%%%%
\usepackage{caption}
\newcommand\mycaption[2]{\caption{\textbf{#1}\newline\footnotesize#2}}
\captionsetup{font=small, labelfont=bf, singlelinecheck=false, tableposition=bottom, justification=justified}
%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}

\begin{figure}[t]
\centering
\includegraphics[clip,width=1.0\columnwidth]{example-image}%
\mycaption{Caption for list of figures.}{Nor for list of figures.}
\end{figure}

\end{document}

enter image description here enter image description here

3
  • 4
    Usually the caption command can be used as \caption[caption only for list of figures]{caption only under the image}, maybe you can adapt your newcommand accordingly, in such that you pass argument #1 into the square brackets?
    – Lukas
    Commented Jul 28, 2021 at 13:48
  • 5
    \newcommand\mycaption[2]{\caption[\textbf{#1}]{\textbf{#1}\newline\footnotesize#2}} Commented Jul 28, 2021 at 13:56
  • A big thank you to both of you. I will follow @Simon Dispa 's solution.
    – yufiP
    Commented Jul 29, 2021 at 11:39

0

You must log in to answer this question.

Browse other questions tagged .