How can i check if the value in \thechapter or \value{chapter} is a letter or a number?
That way i could identify if the counter is referring to a normal Chapter or an Appendix.
Asked
Active
Viewed 1,901 times
13
1 Answers
14
if you're using the book.cls, you can check this way:
\makeatletter
\ifx\@chapapp\appendixname
<whatever you want to do for an appendix>
\else <whatever you want to do for a regular chapter>
\fi
\makeatother
if you're using a different class, look for how \chaptername and \appendixname are used and adapt the above code appropriately.
Edit:
The question Is there an "\if" command that determines if a command has been issued? provides an approach that can be used if \@chapappis not defined by the class.
barbara beeton
- 88,848
\@chapapp! Very useful – Pedro May 28 '12 at 18:05