Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
Thank you. Didn't knew about \@chapapp! Very useful –  Pedro May 28 '12 at 18:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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