I have defined a new command \mypageref to reference page numbers of text parts in my appendix. The begin of such a text part is labeled, e.g., by \label{text_begin}, and the end of the text part is labeled, e.g., by \label{text_end}. The statement is intended to either print, e.g., "S. 42" if the text part is entirely on page 42, or to print, e.g., "S. 42 - 44" if the text part is going over multiple pages. I use the \ifthenelse statement of the ifthen package. The command is defined as follows:

      {S. \pageref{#1}}
      {S. \pageref{#1}\ --\ \pageref{#2}}

It works fine in the main text and in footnotes. However, I have the situation, that my appendix contains text which also belongs to a "source" with an own entry in my bib file, lets say

      author = {AAA},
      title = {BBB},
      year = 2014

Now, I want to use


which fails with the error: "Missing \endcsname inserted".



works. In other words, using the \mypageref in the 1st optional argument (pre) works, but not in the 2nd optional argument (post). I use biblatex and biber. Note that \footcite as well as \mypageref work fine separately.


From this source, I got a solution to my problem:


        {S. \pageref{#1}}
        {S. \pageref{#1}\ --\ \pageref{#2}}

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.