aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-11 12:20:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-11 12:20:44 -0700
commit211fe266e064ef894153a3d711cea427595ab966 (patch)
tree37fac22f9ac7c9458533724d983858cd826eb646 /src/Text
parent7ec953e31bd25269d000558c50495848b0f9c952 (diff)
downloadpandoc-211fe266e064ef894153a3d711cea427595ab966.tar.gz
LaTeX writer: Don't produce `\label{}` for Div or Span.
Just `\hyperdef`. A slight amendment to #1519.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 65ceb85a0..3ed20ae87 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -308,12 +308,11 @@ blockToLaTeX (Div (identifier,classes,_) bs) = do
ref <- toLabel identifier
let linkAnchor = if null identifier
then empty
- else "\\hyperdef{}" <> braces (text ref) <>
- braces ("\\label" <> braces (text ref))
+ else "\\hyperdef{}" <> braces (text ref)
contents <- blockListToLaTeX bs
if beamer && "notes" `elem` classes -- speaker notes
then return $ "\\note" <> braces contents
- else return (linkAnchor <> contents)
+ else return (linkAnchor $$ contents)
blockToLaTeX (Plain lst) =
inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
-- title beginning with fig: indicates that the image is a figure
@@ -670,11 +669,11 @@ inlineToLaTeX (Span (id',classes,_) ils) = do
let noEmph = "csl-no-emph" `elem` classes
let noStrong = "csl-no-strong" `elem` classes
let noSmallCaps = "csl-no-smallcaps" `elem` classes
- label' <- if null id'
- then return empty
- else toLabel id' >>= \x ->
- return (text "\\label" <> braces (text x))
- fmap (label' <>)
+ ref <- toLabel id'
+ let linkAnchor = if null id'
+ then empty
+ else "\\hyperdef{}" <> braces (text ref)
+ fmap (linkAnchor <>)
((if noEmph then inCmd "textup" else id) .
(if noStrong then inCmd "textnormal" else id) .
(if noSmallCaps then inCmd "textnormal" else id) .