hyperref and \verb

Peter Flynn peter at silmaril.ie
Wed Jan 29 16:19:35 CET 2020


On 29/01/2020 14:57, Fernando Gouvea wrote:
> I am working on a book, and the publisher has just (as I was
> finishing) asked me to use \hyperref to make links active on the
> electronic version. Adding \usepackage{hyperref} and making no other
> changes, I get a new error message:
> 
>> ! LaTeX Error: \verb illegal in command argument.

This does look like TeX is seeing \verb while it is processing the 
argument of a previous command. Can you check first that there aren't 
any missing close-curly-braces anywhere before the \verb?

Hyperref makes LOTS of very deep-seated changes to LaTeX. For this 
reason it should always be the last package you load.

Can you try moving your \usepackage{hyperref} to after all other 
\usepackage commands and see if that helps.

> This happens because I used something like \verb|Qp| in a footnote. 
> Despite the error message, the resulting pdf looks ok. Of course, I 
> haven't actually tried using any hyperref functionality yet. Can
> anyone explain what is going on?

You might also try using a different delimiter, eg \verb`Op` or \verb+Op+

///Peter


More information about the texhax mailing list.