[Tex/LaTex] Appendix with alphabetical label

appendicesnumberingsectioning

I would like to have my appendices labelled 'Appendix A', 'Appendix B', etc. as below.

I'm using \documentclass{book}.

enter image description here

Best Answer

This is a simple way to do what you need.

If this doesn't fit your needs, please edit your question and add a minimal working example (MWE).

\documentclass{book}

\usepackage{titlesec}
\titleformat{\chapter}[display]
{\centering\Huge}
{\Huge\bfseries\chaptertitlename\ \thechapter}
{20pt}
{}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]

\begin{document}
    \tableofcontents

    \chapter{Short chapter title}
    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem}

    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem}

    \chapter[Long chapter title]{Long long long long long long chapter title}
    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem}
    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem} 

    \appendix

    \chapter{Short appendix title}
    \section{Section title}
    \begin{theorem}
        This is a simple way to do what you need.
    \end{theorem}
    \begin{theorem}
        Since you didn't provide a MWE, I cannot know if this is actually what you need!
    \end{theorem}
    \section{Section title}
    \begin{theorem}
        Why don't people provide a MWE?
    \end{theorem}
    \begin{theorem}
        A MWE is always needed!
    \end{theorem}

    \chapter[Long appendix title]{Long long long long long long appendix title}
    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem}
    \section{Section title}
    \begin{theorem}
        \LaTeX\ is fun!
    \end{theorem}
    \begin{theorem}
        Ducks are fun!
    \end{theorem}
\end{document}

enter image description here

enter image description here