LaTeX writer: add \protect to \hyperdef in inline context.

This way we don't get an error when this is used as a moveable
argument.

Closes #2136.
This commit is contained in:
John MacFarlane 2015-10-13 21:48:14 -07:00
parent 25e0e0bd2a
commit 198862ee40

View file

@ -748,7 +748,7 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do
ref <- toLabel id'
let linkAnchor = if null id'
then empty
else "\\hyperdef{}" <> braces (text ref) <>
else "\\protect\\hyperdef{}" <> braces (text ref) <>
braces ("\\label" <> braces (text ref))
fmap (linkAnchor <>)
((if noEmph then inCmd "textup" else id) .