I would like to have an A prefix in the appendix figures, but not in the section heading – and include the Appendix in the table of contents.
A MWE inspired be this answer.
\documentclass[a4paper,12pt,bibliography=totoc]{scrartcl}
\usepackage{blindtext}
\usepackage{graphicx}
\setcounter{secnumdepth}{0} % remove numbers from section headings
%%%%%%%%%%
\begin{document}
\tableofcontents
\section{Section 1}
\begin{figure}[!h]
\includegraphics[width=0.3\textwidth]{example-image-duck}
\caption{duck}
\label{fig:duck}
\end{figure}
\blindtext
\setcounter{secnumdepth}{3} % add numbers to section headings, needed for prefix in the figures
\appendix
\counterwithin{figure}{section}
\section{Appendix}\label{appendix}
\begin{figure}[!h]
\includegraphics[width=0.3\textwidth]{example-image-a}
\caption{Image in Appendix}
\label{fig:image}
\end{figure}
\end{document}
P.S. See also a related question in here (these were originally in the same post, but decided to seperate them for clarity.)
