@@ -135,14 +135,14 @@ theoremstyle = do
135135 Just sty -> updateState $ \ s -> s{ sLastTheoremStyle = sty }
136136 return mempty
137137
138- newtheorem :: PandocMonad m => LP m Inlines -> LP m Blocks
139- newtheorem inline = do
138+ newtheorem :: PandocMonad m => LP m Blocks
139+ newtheorem = do
140140 number <- option True (False <$ symbol ' *' <* sp)
141141 name <- untokenize <$> braced
142142 sp
143143 series <- option Nothing $ Just . untokenize <$> bracketedToks
144144 sp
145- showName <- tokWith inline
145+ showName <- braced <|> (( : [] ) <$> anyTok)
146146 sp
147147 syncTo <- option Nothing $ Just . untokenize <$> bracketedToks
148148 sty <- sLastTheoremStyle <$> getState
@@ -168,8 +168,12 @@ extractLabelFromBlock (Para inlines) = extractLabel Nothing inlines
168168extractLabelFromBlock _ = Nothing
169169
170170theoremEnvironment :: PandocMonad m
171- => LP m Blocks -> LP m Inlines -> Text -> LP m Blocks
172- theoremEnvironment blocks opt name = do
171+ => LP m Blocks
172+ -> LP m Inlines
173+ -> LP m Inlines
174+ -> Text
175+ -> LP m Blocks
176+ theoremEnvironment blocks inlines opt name = do
173177 resetCaption
174178 tmap <- sTheoremMap <$> getState
175179 case M. lookup name tmap of
@@ -206,7 +210,8 @@ theoremEnvironment blocks opt name = do
206210 PlainStyle -> B. strong
207211 DefinitionStyle -> B. strong
208212 RemarkStyle -> B. emph
209- let title = titleEmph (theoremName tspec <> number)
213+ tname <- parseFromToks inlines (theoremName tspec)
214+ let title = titleEmph (tname <> number)
210215 <> optTitle <> " ." <> space
211216 return $ divWith (fromMaybe " " mblabel, [name], [] )
212217 $ addTitle title
0 commit comments