git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: adjust hypertargets to beginnings of paragraphs.
53cf829John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+3−2
@@ -500,12 +500,13 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do
500 else blockListToLaTeX bs
500 else blockListToLaTeX bs
501 modify $ \st -> st{ stIncremental = oldIncremental }
501 modify $ \st -> st{ stIncremental = oldIncremental }
502 linkAnchor' <- hypertarget True identifier empty
502 linkAnchor' <- hypertarget True identifier empty
503− -- see #2704 for the motivation for adding \leavevmode:
503+ -- see #2704 for the motivation for adding \leavevmode
504+ -- and #7078 for \vadjust pre
504 let linkAnchor =
505 let linkAnchor =
505 case bs of
506 case bs of
506 Para _ : _
507 Para _ : _
507 | not (isEmpty linkAnchor')
508 | not (isEmpty linkAnchor')
508− -> "\\leavevmode" <> linkAnchor' <> "%"
509+ -> "\\leavevmode\\vadjust pre{" <> linkAnchor' <> "}%"
509 _ -> linkAnchor'
510 _ -> linkAnchor'
510 wrapNotes txt = if beamer && "notes" `elem` classes
511 wrapNotes txt = if beamer && "notes" `elem` classes
511 then "\\note" <> braces txt -- speaker notes
512 then "\\note" <> braces txt -- speaker notes