git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Removed stLink, link template variable.
e1e9bfcfiddlosopher
src/Text/Pandoc/Writers/LaTeX.hs+2−5
@@ -46,7 +46,6 @@ data WriterState =
46 , stTable :: Bool -- true if document has a table
46 , stTable :: Bool -- true if document has a table
47 , stStrikeout :: Bool -- true if document has strikeout
47 , stStrikeout :: Bool -- true if document has strikeout
48 , stSubscript :: Bool -- true if document has subscript
48 , stSubscript :: Bool -- true if document has subscript
49− , stLink :: Bool -- true if document has links
50 , stUrl :: Bool -- true if document has visible URL link
49 , stUrl :: Bool -- true if document has visible URL link
51 , stGraphics :: Bool -- true if document contains images
50 , stGraphics :: Bool -- true if document contains images
52 , stLHS :: Bool -- true if document has literate haskell code
51 , stLHS :: Bool -- true if document has literate haskell code
@@ -60,7 +59,7 @@ writeLaTeX options document =
60 WriterState { stInNote = False, stOLLevel = 1, stOptions = options,
59 WriterState { stInNote = False, stOLLevel = 1, stOptions = options,
61 stVerbInNote = False, stEnumerate = False,
60 stVerbInNote = False, stEnumerate = False,
62 stTable = False, stStrikeout = False, stSubscript = False,
61 stTable = False, stStrikeout = False, stSubscript = False,
63− stLink = False, stUrl = False, stGraphics = False,
62+ stUrl = False, stGraphics = False,
64 stLHS = False, stBook = False }
63 stLHS = False, stBook = False }
65
64
66pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String
65pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String
@@ -95,7 +94,6 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
95 [ ("tables", "yes") | stTable st ] ++
94 [ ("tables", "yes") | stTable st ] ++
96 [ ("strikeout", "yes") | stStrikeout st ] ++
95 [ ("strikeout", "yes") | stStrikeout st ] ++
97 [ ("subscript", "yes") | stSubscript st ] ++
96 [ ("subscript", "yes") | stSubscript st ] ++
98− [ ("links", "yes") | stLink st ] ++
99 [ ("url", "yes") | stUrl st ] ++
97 [ ("url", "yes") | stUrl st ] ++
100 [ ("lhs", "yes") | stLHS st ] ++
98 [ ("lhs", "yes") | stLHS st ] ++
101 [ ("graphics", "yes") | stGraphics st ]
99 [ ("graphics", "yes") | stGraphics st ]
@@ -329,8 +327,7 @@ inlineToLaTeX (TeX str) = return $ text str
329inlineToLaTeX (HtmlInline _) = return empty
327inlineToLaTeX (HtmlInline _) = return empty
330inlineToLaTeX (LineBreak) = return $ text "\\\\"
328inlineToLaTeX (LineBreak) = return $ text "\\\\"
331inlineToLaTeX Space = return $ char ' '
329inlineToLaTeX Space = return $ char ' '
332−inlineToLaTeX (Link txt (src, _)) = do
330+inlineToLaTeX (Link txt (src, _)) =
333− modify $ \s -> s{ stLink = True }
334 case txt of
331 case txt of
335 [Code x] | x == src -> -- autolink
332 [Code x] | x == src -> -- autolink
336 do modify $ \s -> s{ stUrl = True }
333 do modify $ \s -> s{ stUrl = True }