My document uses both hyperref and etextools. Up until today, they appeared to be playing nicely; however a new command seems to have introduced a conflict somewhere.

The MWE below is a greatly simplified version of a far more complex document; it took quite some time to narrow the problem down as far as I have. Removing either of the % to load hyperref or before the \expandnext results in a compilable document, but removing both causes errors.

It feels as though this answer is related, but I don't understand enough of the details of what is happening at this level to be able to adapt this answer to my needs. Can anybody point me in the right direction please?





\newcommand{\useinsert}[1]{ % If a (part) question is to be answered on an insert
            \textbf{Answer this question on the insert provided.}
    }[\textbf{Answer part (#1) of this question on the insert provided.}]%

\renewcommand{\thepartno}{\roman{partno}} % Format part numbers as lower-case roman numerals


\question %\expandnext{\useinsert}{\ref{ques:P1Q10i}}
        \part[3] \label{ques:P1Q10i} Do this.
  • 2
    Don't use etextools. It is incompatible with a lot of things and it is unmaintained. – Ulrike Fischer Jan 29 at 13:23
  • 2
    Beside this: The idea to expand the \ref and use the result in a string comparision is quite daring. If this ever worked with hyperref (which I doubt) you were extremely lucky. – Ulrike Fischer Jan 29 at 13:29
  • I have cleaned up some comments. Reading them, I take it that you care less about th incompatibility than a solution to the task you are trying to achieve. – Joseph Wright Feb 4 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.