0

Much like is done with section headers using the appendix package here, I would like appendix tables and figures to have distinct captions and references. That is, for tables and figure that I move to the appendix, the labels in front of the captions should be "Appendix Table 1: ...", "Appendix Figure 1: ...", etc.

In addition, I like the references for such exhibits to include the word "Appendix", as in "As is seen in Appendix Table 1, ..." etc. Of course, this can be done using a separate command for appendix references, but they question is whether there is a fix so that it happens automatically for any exhibit once it is moved to the appendix.

1 Answer 1

2

You did not provide an example, but here is what I think you are trying to do

enter image description here

enter image description here

From etoolbox package, use the commands

\AtBeginEnvironment{subappendices}{\renewcommand{\figurename}{}
    \renewcommand{\thefigure}{\textbf{Appendix Figure \arabic{figure}}}
                                }
\AtBeginEnvironment{subappendices}{\renewcommand{\tablename}{}
    \renewcommand{\thetable}{\textbf{Appendix Table \arabic{table}}}
                                }

This renews the labels only for the appendices. Of course, you must check if your class automatically resets the counter of appendices once you have opened subappendices environment

\documentclass[11pt,a4paper,oneside]{book}

\usepackage{etoolbox}

\usepackage{appendix}
\AtBeginEnvironment{subappendices}{\renewcommand{\figurename}{}
    \renewcommand{\thefigure}{\textbf{Appendix Figure \arabic{figure}}}
                            }
\AtBeginEnvironment{subappendices}{\renewcommand{\tablename}{}
    \renewcommand{\thetable}{\textbf{Appendix Table \arabic{table}}}
                            }

\usepackage{graphicx}

\newcommand{\sampleEquationFloats}{

\begin{figure}
    \includegraphics[]{example-image-a}
    \caption{My Caption}
\end{figure}

\begin{equation}
    E = m c^{2}
\end{equation}

\begin{table}
    \caption{Table Caption}
    \centering
    \begin{tabular}{|c |c|}
        \hline
        Column & Column
        \\
        \hline
    \end{tabular}
\end{table}

}



\begin{document}

\begin{subappendices}

    \section{Appendix}

        \sampleEquationFloats

\end{subappendices}

\end{document} 
1
  • Great. The trick of changing \tablenameto null and using \thetable is useful even outside the context of the question, for main-body exhibits.
    – dzeltzer
    Jun 25, 2019 at 6:26

You must log in to answer this question.

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