git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: use % after hypertarget before code block
8709b7cJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+4−1
@@ -490,7 +490,10 @@ blockToLaTeX (BlockQuote lst) = do
490blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
490blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
491 opts <- gets stOptions
491 opts <- gets stOptions
492 lab <- labelFor identifier
492 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' <> "%"
494 let lhsCodeBlock = do
497 let lhsCodeBlock = do
495 modify $ \s -> s{ stLHS = True }
498 modify $ \s -> s{ stLHS = True }
496 return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$
499 return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$