git.iko.soy/typeable/pandoc
on master help sign in
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.

commit198862ee40702c8844e4d0503329b69a3062c49b authorJohn MacFarlane <jgm@berkeley.edu> dateTue 13 Oct 2015, 21:48 (11 years ago) parent25e0e0b
1 file changed+1−1
src/Text/Pandoc/Writers/LaTeX.hs+1−1
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -748,7 +748,7 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do
748748 ref <- toLabel id'
749749 let linkAnchor = if null id'
750750 then empty
751− else "\\hyperdef{}" <> braces (text ref) <>
751+ else "\\protect\\hyperdef{}" <> braces (text ref) <>
752752 braces ("\\label" <> braces (text ref))
753753 fmap (linkAnchor <>)
754754 ((if noEmph then inCmd "textup" else id) .