From 8709b7cf80498d06863ac987a6b3968b84a7fc85 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Mar 2017 12:13:02 +0100 Subject: LaTeX writer: use % after hypertarget before code block --- src/Text/Pandoc/Writers/LaTeX.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 789593118..e54829f94 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -490,7 +490,10 @@ blockToLaTeX (BlockQuote lst) = do blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do opts <- gets stOptions lab <- labelFor identifier - linkAnchor <- hypertarget True identifier lab + linkAnchor' <- hypertarget True identifier lab + let linkAnchor = if isEmpty linkAnchor' + then empty + else linkAnchor' <> "%" let lhsCodeBlock = do modify $ \s -> s{ stLHS = True } return $ flush (linkAnchor $$ "\\begin{code}" $$ text str $$ -- cgit v1.2.3