diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-17 06:53:38 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-17 06:53:38 +0000 |
commit | 1a09a9d40f9f956045c9d3daaa0c1316310e6d17 (patch) | |
tree | e8b18b0a056d48d4f4de2a2d792775f43513984f | |
parent | be344321227a33c9a3f3e2031b88045f5159d1ff (diff) | |
download | pandoc-1a09a9d40f9f956045c9d3daaa0c1316310e6d17.tar.gz |
Revert "LaTeX writer: Add unique labels to figures."
This reverts commit be344321227a33c9a3f3e2031b88045f5159d1ff.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1896 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 15 | ||||
-rw-r--r-- | tests/writer.latex | 2 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index a3e6b9364..02fbf4add 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -40,7 +40,6 @@ import Text.PrettyPrint.HughesPJ hiding ( Str ) data WriterState = WriterState { stInNote :: Bool -- @True@ if we're in a note , stOLLevel :: Int -- level of ordered list nesting - , stUsedIdents :: [String] -- identifiers used already , stOptions :: WriterOptions -- writer options, so they don't have to be parameter , stVerbInNote :: Bool -- true if document has verbatim text in note , stEnumerate :: Bool -- true if document needs fancy enumerated lists @@ -57,8 +56,8 @@ data WriterState = writeLaTeX :: WriterOptions -> Pandoc -> String writeLaTeX options document = evalState (pandocToLaTeX options document) $ - WriterState { stInNote = False, stOLLevel = 1, stUsedIdents = [], - stOptions = options, stVerbInNote = False, stEnumerate = False, + WriterState { stInNote = False, stOLLevel = 1, stOptions = options, + stVerbInNote = False, stEnumerate = False, stTable = False, stStrikeout = False, stSubscript = False, stUrl = False, stGraphics = False, stLHS = False, stBook = False } @@ -134,14 +133,8 @@ blockToLaTeX (Plain lst) = do blockToLaTeX (Para [Image txt (src,tit)]) = do capt <- inlineListToLaTeX txt img <- inlineToLaTeX (Image txt (src,tit)) - st <- get - let usedIdents = stUsedIdents st - let lab = uniqueIdent txt usedIdents - put $ st{ stUsedIdents = lab : usedIdents } - return $ text "\\begin{figure}[htb]" $$ - text "\\centering" $$ img $$ - (text "\\caption{" <> capt <> text ("}\\label{" ++ lab ++ "}")) $$ - text "\\end{figure}\n" + return $ text "\\begin{figure}[htb]" $$ text "\\centering" $$ img $$ + (text "\\caption{" <> capt <> char '}') $$ text "\\end{figure}\n" blockToLaTeX (Para lst) = do st <- get let opts = stOptions st diff --git a/tests/writer.latex b/tests/writer.latex index e06ac5bdf..dbefdb8fd 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -812,7 +812,7 @@ From ``Voyage dans la Lune'' by Georges Melies (1902): \begin{figure}[htb] \centering \includegraphics{lalune.jpg} -\caption{lalune}\label{lalune} +\caption{lalune} \end{figure} Here is a movie \includegraphics{movie.jpg} icon. |