@@ -40,7 +40,6 @@ import Text.PrettyPrint.HughesPJ hiding ( Str )
4040data WriterState =
4141 WriterState { stInNote :: Bool -- @True@ if we're in a note
4242 , stOLLevel :: Int -- level of ordered list nesting
43− , stUsedIdents :: [String] -- identifiers used already
4443 , stOptions :: WriterOptions -- writer options, so they don't have to be parameter
4544 , stVerbInNote :: Bool -- true if document has verbatim text in note
4645 , stEnumerate :: Bool -- true if document needs fancy enumerated lists
@@ -57,8 +56,8 @@ data WriterState =
5756writeLaTeX :: WriterOptions -> Pandoc -> String
5857writeLaTeX options document =
5958 evalState (pandocToLaTeX options document) $
60− WriterState { stInNote = False, stOLLevel = 1, stUsedIdents = [],
61− stOptions = options, stVerbInNote = False, stEnumerate = False,
59+ WriterState { stInNote = False, stOLLevel = 1, stOptions = options,
60+ stVerbInNote = False, stEnumerate = False,
6261 stTable = False, stStrikeout = False, stSubscript = False,
6362 stUrl = False, stGraphics = False,
6463 stLHS = False, stBook = False }
@@ -134,14 +133,8 @@ blockToLaTeX (Plain lst) = do
134133blockToLaTeX (Para [Image txt (src,tit)]) = do
135134 capt <- inlineListToLaTeX txt
136135 img <- inlineToLaTeX (Image txt (src,tit))
137− st <- get
138− let usedIdents = stUsedIdents st
139− let lab = uniqueIdent txt usedIdents
140− put $ st{ stUsedIdents = lab : usedIdents }
141− return $ text "\\begin{figure}[htb]" $$
142− text "\\centering" $$ img $$
143− (text "\\caption{" <> capt <> text ("}\\label{" ++ lab ++ "}")) $$
144− text "\\end{figure}\n"
136+ return $ text "\\begin{figure}[htb]" $$ text "\\centering" $$ img $$
137+ (text "\\caption{" <> capt <> char '}') $$ text "\\end{figure}\n"
145138blockToLaTeX (Para lst) = do
146139 st <- get
147140 let opts = stOptions st