1

I am writing a paper for school in which I need to include appendices. Currently, I am using the \appendix command at the end of the document (just before \end{document}) to insert these appendices. When creating a new appendix, I used the \section command, and it's working just fine, and it does what I want. Except, there is one problem. The heading shows in the following way:

A Appendix A

I am trying to get rid of the first A in the heading. These are the packages and commands I am using in my document.

\documentclass{article}
\usepackage{hyperref}
\usepackage[nameinlink, noabbrev]{cleveref}    
\usepackage{xcolor}
\hypersetup{
    colorlinks,
    linkcolor={red!100!black}
    }

\begin{document}


    We can see in \Cref{app:A} the original text in blah, blah, blah.  
    \Cref{app:B} depicts a table with the results from this study.  
    Finally, \Cref{app:C} shows a plot of these results...

    \appendix
    \section{Appendix A}\label{app:A}

    Text here...

    \section{Appendix B}\label{app:B}

    Table here...

    \section{Appendix C}\label{app:C}

    Figure here...

\end{document}

And here is the output:

enter image description here

I know that if I use the command \section*{Appendix A} as opposed to \section{Appendix A} then the first letter goes away. The problem with that solution is that I can't use the cleveref to cross-reference this item in the body of my text. And if I do reference it using \Cref{app:A}, it simply links to the previous section that was not starred. In my case, the hyperlink is connected to my conclusion and not my appendices. I need to be able to reference the appendices in my text, and I need to get rid of the first letter because it violates APA formatting rules, which is the formatting used in my field.

I hope someone can help me with this. Also, I'm new to LaTeX, so I'd prefer simple solutions (such as a \renew command) that won't require that I change my entire document because my paper is basically done. Thank you in advance!

  • 1
    Have you seen the posting Having 'Appendix A' instead of 'A Appendix'? The solution provided in the associated answer works just fine with the macros of the cleveref package. The only downside is that you'll have to come up with more imaginative sectioning header names than "Appendix A", "Appendix B", etc. – Mico Apr 19 at 0:23
  • @Mico Unfortunately that solution didn't work for me. Adding the code to my preamble, as specified, made no difference in my output. – Ernesto Apr 19 at 0:38
1

You could reformat the titles of the appendices with titlesec.

\documentclass{article}
\usepackage{hyperref}
\usepackage[nameinlink, noabbrev]{cleveref}  
\usepackage{titlesec}

\usepackage{xcolor}
\hypersetup{
    colorlinks,
    linkcolor={red!100!black}
    }

\begin{document}

\section{Test}

    We can see in \Cref{app:A} the original text in blah, blah, blah.  
    \Cref{app:B} depicts a table with the results from this study.  
    Finally, \Cref{app:C} shows a plot of these results...

    \appendix
\titleformat{\section}[block]{\Large\bfseries}{\appendixname~\thesection}{1em}{}

    \section{}\label{app:A}

    Text here...


    \section{}\label{app:B}

    Table here...

    \section{}\label{app:C}

    Figure here...

\end{document}

enter image description here

  • 1
    This worked perfectly. An additional note for those using APA and not well-versed on LaTeX, adding \centering after \bfseries will center the heading. – Ernesto Apr 19 at 0:42
  • @Ernesto May I suggest to use \filcenter instead of \centering: \titleformat{\section}[block]{\Large\bfseries\filcenter}{\appendixname~\thesection}{1em}{} in that case? – marmot Apr 19 at 0:48
  • I was not familiar with that command. Is \filcenter typically used for sections and the like, while \centering is used for the body of the text? – Ernesto Apr 19 at 2:14
  • @Ernesto It can be found in the titlesec manual and is suggested there, probably for good reasons. – marmot Apr 19 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.