mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-26 09:25:48 +00:00
LaTeX reader: Fix semantics of \ref.
We were including the ams environment type in addition to the number. This is proper behavior for `\cref` but not for `\ref`. To support `\cref` we need to store the environment label separately.
This commit is contained in:
@@ -170,9 +170,7 @@ theoremEnvironment blocks opt name = do
|
||||
Just ident ->
|
||||
updateState $ \s ->
|
||||
s{ sLabels = M.insert ident
|
||||
(B.toList $
|
||||
theoremName tspec <> "\160" <>
|
||||
str (renderDottedNum num)) (sLabels s) }
|
||||
(B.toList $ str (renderDottedNum num)) (sLabels s) }
|
||||
Nothing -> return ()
|
||||
return $ space <> B.text (renderDottedNum num)
|
||||
else return mempty
|
||||
@@ -182,14 +180,14 @@ theoremEnvironment blocks opt name = do
|
||||
RemarkStyle -> B.emph
|
||||
let title = titleEmph (theoremName tspec <> number)
|
||||
<> optTitle <> "." <> space
|
||||
return $ divWith (fromMaybe "" mblabel, [name], []) $ addTitle title
|
||||
return $ divWith (fromMaybe "" mblabel, [name], [])
|
||||
$ addTitle title
|
||||
$ maybe id removeLabel mblabel
|
||||
$ case theoremStyle tspec of
|
||||
PlainStyle -> walk italicize bs
|
||||
_ -> bs
|
||||
|
||||
|
||||
|
||||
proof :: PandocMonad m => LP m Blocks -> LP m Inlines -> LP m Blocks
|
||||
proof blocks opt = do
|
||||
title <- option (B.text "Proof") opt
|
||||
|
||||
@@ -133,7 +133,7 @@ These are all pretty interesting facts.
|
||||
, ( "reference" , "def:tri" )
|
||||
]
|
||||
)
|
||||
[ Str "Definition\160\&1" ]
|
||||
[ Str "1" ]
|
||||
( "#def:tri" , "" )
|
||||
, Space
|
||||
, Str "since"
|
||||
|
||||
Reference in New Issue
Block a user