git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: use % after hypertarget before code block
commit8709b7cf80498d06863ac987a6b3968b84a7fc85 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 2 Mar 2017, 12:13 (10 years ago) parent9e50319
1 file changed+4−1
src/Text/Pandoc/Writers/LaTeX.hs+4−1
src/Text/Pandoc/Writers/LaTeX.hs+4−1
@@ -490,7 +490,10 @@ blockToLaTeX (BlockQuote lst) = do
490490blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
491491 opts <- gets stOptions
492492 lab <- labelFor identifier
493− linkAnchor <- hypertarget True identifier lab
493+ linkAnchor' <- hypertarget True identifier lab
494+ let linkAnchor = if isEmpty linkAnchor'
495+ then empty
496+ else linkAnchor' <> "%"
494497 let lhsCodeBlock = do
495498 modify $ \s -> s{ stLHS = True }
496499 return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$