LaTeX writer: adjust hypertargets to beginnings of paragraphs.
Use `\vadjust pre` so that the hypertarget takes you to the beginning of the paragraph rather than one line down. Closes #7078. This makes a particular difference for links to citations using `--citeproc` and `link-citations: true`.
This commit is contained in:
parent
9e728b40f3
commit
53cf8295a4
1 changed files with 3 additions and 2 deletions
|
@ -500,12 +500,13 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do
|
||||||
else blockListToLaTeX bs
|
else blockListToLaTeX bs
|
||||||
modify $ \st -> st{ stIncremental = oldIncremental }
|
modify $ \st -> st{ stIncremental = oldIncremental }
|
||||||
linkAnchor' <- hypertarget True identifier empty
|
linkAnchor' <- hypertarget True identifier empty
|
||||||
-- see #2704 for the motivation for adding \leavevmode:
|
-- see #2704 for the motivation for adding \leavevmode
|
||||||
|
-- and #7078 for \vadjust pre
|
||||||
let linkAnchor =
|
let linkAnchor =
|
||||||
case bs of
|
case bs of
|
||||||
Para _ : _
|
Para _ : _
|
||||||
| not (isEmpty linkAnchor')
|
| not (isEmpty linkAnchor')
|
||||||
-> "\\leavevmode" <> linkAnchor' <> "%"
|
-> "\\leavevmode\\vadjust pre{" <> linkAnchor' <> "}%"
|
||||||
_ -> linkAnchor'
|
_ -> linkAnchor'
|
||||||
wrapNotes txt = if beamer && "notes" `elem` classes
|
wrapNotes txt = if beamer && "notes" `elem` classes
|
||||||
then "\\note" <> braces txt -- speaker notes
|
then "\\note" <> braces txt -- speaker notes
|
||||||
|
|
Loading…
Add table
Reference in a new issue