3

I want to change the caption name of a figure for an appendix. For example I have

\caption{This is a supplemental figure.}

and by default the caption appears as

Figure 1: This is a supplemental figure.

However I want

Figure S1 - This is a supplemental figure.

I tried this

\renewcommand{\figurename}{Figure S}

but it adds a space in between and results in

Figure S 1 - This is a supplemental figure.
5

Add this to your document preamble:

\makeatletter
\g@addto@macto\appendix{\renewcommand{\thefigure}{S\arabic{figure}}}
\makeatother

A MWE:

\documentclass{report}

\makeatletter
\g@addto@macro\appendix{\renewcommand{\thefigure}{S\arabic{figure}}\setcounter{figure}{0}}
\makeatother

\begin{document}

\begin{figure}
\caption{Not in Appendix}
\end{figure}

\appendix

\begin{figure}
\caption{In Appendix}
\end{figure}


\end{document}
3

I would put the letter into the number:

\renewcommand*{\thefigure}{S\arabic{figure}}

Then also referencing works. \ref reports the number including the letter.

0

This would work if using the appendices environment:

\g@addto@macro\appendices{\renewcommand{\thefigure}{S\arabic{figure}}\setcounter{figure}{0}}

Latex code below:

\documentclass{report}
\usepackage{appendix}

\makeatletter
\g@addto@macro\appendices{\renewcommand{\thefigure}{S\arabic{figure}}\setcounter{figure}{0}}
\makeatother

\begin{document}

\begin{figure}
\caption{Not in Appendix}
\end{figure}

\begin{appendices}

\begin{figure}
\caption{In Appendix}
\end{figure}

\end{appendices}
\end{document}
  • \g@addto@macro\appendices and not \g@addto@macro\appendix – user7312684 May 7 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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