10

According to the official Revtex 4.1 documentation, if there's only one appendix, one can use \appendix* instead of \appendix to avoid having unnecessary letter A. However, in my case, adding * just prints it in the text and seem to have no effect at all. I have no idea how to debug this. What could be the problem?

UPD: commenting out \usepackage[capitalize]{cleveref} in the preamble makes \appendix* work as expected, but I need this package.

\documentclass[aps,pre,twocolumn,superscriptaddress,showkeys,showpacs]{revtex4-1}
\usepackage[capitalize]{cleveref}

\begin{document}
    \title{Paper}
    \date{\today}
    \maketitle

    \appendix*
    \section{Proof of X}
    Easy peasy
\end{document}

Extracted from paper.log:

revtex4-1.cls    2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for documentation)
...
revsymb4-1.sty    2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for documentation)
cleveref.sty    2013/12/28 v0.19 Intelligent cross-referencing
dmytro
  • 203
  • 1
  • 2
  • 6

2 Answers2

8

The definition of \appendix in revtex4.cls ends with \@ifstar{...}{...}, but cleveref adds code to the macro and so this \@ifstar is inefficient.

You can reinstate it at the end:

\documentclass[aps,pre,twocolumn,superscriptaddress,showkeys,showpacs]{revtex4-1}
\usepackage{etoolbox} % for \appto
\usepackage{lipsum} % for mock text
\usepackage[capitalize]{cleveref}

\makeatletter
\appto{\appendix}{%
  \@ifstar{\def\thesection{\unskip}\def\theequation@prefix{A.}}%
          {\def\thesection{\Alph {section}}}%
}
\makeatother

\begin{document}

\title{Paper}
\date{\today}
\maketitle

\section{Title}

\lipsum[1-3]

\appendix*
\section{Proof of X}

\lipsum[4]

\end{document}

(Note that revtex4-1 is the most recent release.)

enter image description here

egreg
  • 1,121,712
3

cleveref appends some code to \appendix which breaks the starred variant provided by revtex4.cls.

The original version could be saved to, say, \revappendix and used then instead of \appendix. The cross-referencing can be maintained using the optional argument of \label[appendix]{...}, which is an invention by cleveref.

\documentclass[aps,pre,twocolumn,superscriptaddress,showkeys,showpacs]{revtex4}

\let\revappendix\appendix


\usepackage[capitalize]{cleveref}

\begin{document}
\title{Paper}
\date{\today}
\maketitle

\section{Main section} \label{mainsection}

\revappendix*
\section{Proof of X} \label[appendix]{myappsection}
Easy peasy


In \cref{mainsection} and \cref{myappsection}


\end{document}

enter image description here

  • Thanks, that's elegant, but doesn't it break some cleveref features? – dmytro Sep 07 '15 at 21:55
  • @dmytro: I've tried with \label{myappsection} after that \section and \cref{myappsection} yields Section, so I would say: No, but this isn't a proof of course –  Sep 07 '15 at 21:58
  • Unfortunately, the downside of this approach is that referencing the appendix somewhere in the sections above yields Section, whereas one should see Appendix. It makes sense since clreveref doesn't know it is an appendix. – dmytro Sep 07 '15 at 23:02
  • 1
    @dmytro: Cured ;-) –  Sep 07 '15 at 23:10