5

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}
6
  • Please make your code compilable, starting with \documentclass{...} and ending with \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem.
    – jub0bs
    Nov 19, 2013 at 21:02
  • Please remove everything that is not necessary to explain what your problem is. In particular, we don't have the files that you \input. Also, your code contains loads of packages that are irrelevant to your problem. What we need is a minimal working example (MWE).
    – jub0bs
    Nov 19, 2013 at 21:10
  • related: tex.stackexchange.com/a/60342/21891
    – jub0bs
    Nov 19, 2013 at 21:15
  • @Jubobs I will remove what you request. Thought the full preambel wold the info need to see package collisions. Nov 19, 2013 at 21:21
  • Unless I misread the question, it has nothing to do with package conflicts, so there is no harm in removing some of those \usepackages.
    – jub0bs
    Nov 19, 2013 at 21:23

1 Answer 1

5

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.

1
  • I'm trying to use your answer, but my compiler says that \addappheadtotoc has not been defined, and so it doesn't compile. How can I solve this? Sep 19, 2014 at 0:17

You must log in to answer this question.

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