Cross-referencing with part prefix also for appendix











up vote
0
down vote

favorite












In my document I restart the chapter counter for every part. Unfortunately, this leads to ambiguous numbers for, e. g. figures. Therefore, I decided to add the number of the part as a prefix to the chapter with:



renewcommand{thechapter}{thepart.arabic{chapter}}


In general, this works nice. However, I have some chapters before a part which leads to a prepended ".", e. g. ".1 Chapter 0".
So, the first thing I want to achieve is removing the point when there is no part above the chapter.



The second issue arises with the appendix because the appendix chapters are not included in the "renewcomand" above. It would be more uniform if the Appendix, which is part III would be numbered like "III.A", "III.B" and so on.



Here is the current output:
enter image description here



How can I remove the leading "." for chapters outside a part? How can I add the part number to the appendix chapters? Ideally, this should also work for the figures (see "List of Figures" in image), tables and equations.



UPDATE:
Concering the first issue ("."). I found this solution:



makeatletter
renewcommand{thechapter}{%
ifnumc@part<1 @arabicc@chapter
else thepart.@arabicc@chapter
fi
}
makeatother









share|improve this question




























    up vote
    0
    down vote

    favorite












    In my document I restart the chapter counter for every part. Unfortunately, this leads to ambiguous numbers for, e. g. figures. Therefore, I decided to add the number of the part as a prefix to the chapter with:



    renewcommand{thechapter}{thepart.arabic{chapter}}


    In general, this works nice. However, I have some chapters before a part which leads to a prepended ".", e. g. ".1 Chapter 0".
    So, the first thing I want to achieve is removing the point when there is no part above the chapter.



    The second issue arises with the appendix because the appendix chapters are not included in the "renewcomand" above. It would be more uniform if the Appendix, which is part III would be numbered like "III.A", "III.B" and so on.



    Here is the current output:
    enter image description here



    How can I remove the leading "." for chapters outside a part? How can I add the part number to the appendix chapters? Ideally, this should also work for the figures (see "List of Figures" in image), tables and equations.



    UPDATE:
    Concering the first issue ("."). I found this solution:



    makeatletter
    renewcommand{thechapter}{%
    ifnumc@part<1 @arabicc@chapter
    else thepart.@arabicc@chapter
    fi
    }
    makeatother









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In my document I restart the chapter counter for every part. Unfortunately, this leads to ambiguous numbers for, e. g. figures. Therefore, I decided to add the number of the part as a prefix to the chapter with:



      renewcommand{thechapter}{thepart.arabic{chapter}}


      In general, this works nice. However, I have some chapters before a part which leads to a prepended ".", e. g. ".1 Chapter 0".
      So, the first thing I want to achieve is removing the point when there is no part above the chapter.



      The second issue arises with the appendix because the appendix chapters are not included in the "renewcomand" above. It would be more uniform if the Appendix, which is part III would be numbered like "III.A", "III.B" and so on.



      Here is the current output:
      enter image description here



      How can I remove the leading "." for chapters outside a part? How can I add the part number to the appendix chapters? Ideally, this should also work for the figures (see "List of Figures" in image), tables and equations.



      UPDATE:
      Concering the first issue ("."). I found this solution:



      makeatletter
      renewcommand{thechapter}{%
      ifnumc@part<1 @arabicc@chapter
      else thepart.@arabicc@chapter
      fi
      }
      makeatother









      share|improve this question















      In my document I restart the chapter counter for every part. Unfortunately, this leads to ambiguous numbers for, e. g. figures. Therefore, I decided to add the number of the part as a prefix to the chapter with:



      renewcommand{thechapter}{thepart.arabic{chapter}}


      In general, this works nice. However, I have some chapters before a part which leads to a prepended ".", e. g. ".1 Chapter 0".
      So, the first thing I want to achieve is removing the point when there is no part above the chapter.



      The second issue arises with the appendix because the appendix chapters are not included in the "renewcomand" above. It would be more uniform if the Appendix, which is part III would be numbered like "III.A", "III.B" and so on.



      Here is the current output:
      enter image description here



      How can I remove the leading "." for chapters outside a part? How can I add the part number to the appendix chapters? Ideally, this should also work for the figures (see "List of Figures" in image), tables and equations.



      UPDATE:
      Concering the first issue ("."). I found this solution:



      makeatletter
      renewcommand{thechapter}{%
      ifnumc@part<1 @arabicc@chapter
      else thepart.@arabicc@chapter
      fi
      }
      makeatother






      cross-referencing numbering appendices






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 6 at 14:03

























      asked Dec 5 at 18:07









      aquila

      205




      205



























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463355%2fcross-referencing-with-part-prefix-also-for-appendix%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463355%2fcross-referencing-with-part-prefix-also-for-appendix%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?