1

I want to have the chapter numbers in my book go like 1, 2, 3, ... A1, A2, A3, ..., where the "A" chapters are like appendices. Is it correct to go about this by issuing a \renewcommand{\thechapter}{A\arabic{chapter}} before chapter A1, and resetting the chapter counter to 1? Or will it cause problems if I have two chapters that both have chapter number 1 internally?

  • 1
    And an example would be? Have you tried it to see if it causes problems or not? Most things can cause problems. Whether they will or not depends on the details. – cfr Jan 16 '17 at 4:05
  • 2
    Though agreeing with @cfr I would suspect that you should be totally fine with your solution (as long as you do "normal" stuff else). But adding a few more details on what you document should be able to do and contain will be really helpful to answer your question satisfyingly. – Ruben Jan 16 '17 at 4:24
  • @Ruben I don't consider hyperlinks 'abnormal' ;). – cfr Jan 16 '17 at 20:20
4

This is fine under the following conditions:

  1. You're not using hyperref. The following minimal example shows why:

    \documentclass{report}
    
    \usepackage{hyperref}
    
    \begin{document}
    
    \tableofcontents
    
    \chapter{A chapter}
    
    \renewcommand{\thechapter}{A\arabic{chapter}}
    \setcounter{chapter}{0}
    
    \chapter{An appendix chapter}
    
    \end{document}
    

    The above example prints this warning to the .log:

    pdfTeX warning (ext4): destination with the same identifier (name{chapter.1}) 
    has been already used, duplicate ignored
    <to be read again> 
                       \relax 
    l.14 \chapter{An appendix chapter}
    

    You need to also adjust \theHchapter:

    \renewcommand{\thechapter}{A\arabic{chapter}}
    \renewcommand{\theHchapter}{A\arabic{chapter}}
    

    This is not critical, but affect hyperlinks (including those of bookmarks).

  2. Subsidiary document elements don't use \arabic{chapter} directly, but rather the display version \thechapter. This is typically the case, that \thechapter is used when referring to the chapter number representation, but just in case.

| improve this answer | |

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.