I am trying to renew the latex \caption command where I want a \listoffigures with the short description and both short and long descriptions in the figure's caption. The output that I expect is as follows:
I got the above output with the following code:
\documentclass{article}
\usepackage{graphicx}
\newcommand{\mycaption}[2][]{\caption[#1]{\textbf{#1} #2}}
\begin{document}
\listoffigures
\begin{figure}
\centering
\includegraphics[width=3cm]{example-image}
\mycaption[Short Description.]{Long Description}
\end{figure}
\end{document}
But, what I want:
\renewcommand{\caption}[2][]{\caption[#1]{\textbf{#1} #2}}
I would like to know if there is any build-in latex syntax to achieve my purpose.




Oandmomean in this command please\NewDocumentCommand{\mycaption}{O{#2}mo}{%? I can follow the rest of your command but I cannot see why those letters in particular? Edit: Probably O "optional", mo "mandatory" "optional" arguments. – Mar 25 '22 at 00:02