[Tex/LaTex] Remove chapter name or add appendix name to chapter

appendicesmemoirnumbering

My document class

\documentclass[a4paper,openany,article]{memoir}

I want to add Appendix before the number so that \chapter{An appendix} displays Appendix A An appendix and not A An appendix

Alternatively, if I change my document class to

\documentclass[a4paper,openany]{memoir}

and remove chapter so that when calling a \chapter it only numbers

ex. \chapter{Title 1} results in in 1 Title 1

My doc:

\documentclass[a4paper,openany,article]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\maxsecnumdepth{subsection}
\settocdepth{subsection}
%----------------------------------------------------------
\begin{document}
%-------------------------------
    \frontmatter
        \pagenumbering{Roman}

        \tableofcontents

%-------------------------------
    \mainmatter

             \chapter{Introduction}

             \appendix
             \addappheadtotoc
             \chapter{Derivations}
             \section{Celerity at arbitrary depth}\label{sec:celerity_ar_dep}
             \includepdf[pages=59,scale=1,trim = 0mm 0mm 0mm 10cm,clip]{Litteratur/Hydrodynamics2012.pdf}

%-------------------------------
    \backmatter

\end{document}

Best Answer

Hope I haven't misunderstood the question...

If you want to add the word "Appendix" each time a chapter title is printed (inside appendices), you can add the line

\renewcommand*\printchaptername{\Large\bfseries\appendixname~}

just after issuing the \appendix command.

MWE

\documentclass[a4paper,openany,article]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

\maxsecnumdepth{subsection}
\settocdepth{subsection}
%----------------------------------------------------------
\begin{document}
%-------------------------------
    \frontmatter
        \pagenumbering{Roman}

        \tableofcontents

%-------------------------------
    \mainmatter

             \chapter{Introduction}

             \appendix
             \addappheadtotoc
             \renewcommand*\printchaptername{\Large\bfseries\appendixname~}
             \chapter{Derivations}
             \section{Celerity at arbitrary depth}\label{sec:celerity_ar_dep}
             %\includepdf[pages=59,scale=1,trim = 0mm 0mm 0mm 10cm,clip]{Litteratur/Hydrodynamics2012.pdf}

%-------------------------------
    \backmatter

\end{document}

Output:

enter image description here

If you also want the same behavior in the ToC, you can add the line

\renewcommand*\cftappendixname{\appendixname~}

in the preamble.


Instead, if you want to use

\documentclass[a4paper,openany]{memoir}

you can remove the words "Chapter" and "Appendix" from chapter titles by simply adding the following line in your preamble:

\renewcommand*\printchaptername{}

If you want to remove "Chapter" but not "Appendix" add also

\renewcommand*\printchaptername{\chapnamefont\appendixname}

just after issuing \appendix.