@@ -50,8 +50,6 @@ import Text.Pandoc.Highlighting (highlight, styleToLaTeX,
5050
5151data WriterState =
5252 WriterState { stInNote :: Bool -- true if we're in a note
53− , stInTable :: Bool -- true if we're in a table
54− , stTableNotes :: [Doc] -- List of notes in current table
5553 , stOLLevel :: Int -- level of ordered list nesting
5654 , stOptions :: WriterOptions -- writer options, so they don't have to be parameter
5755 , stVerbInNote :: Bool -- true if document has verbatim text in note
@@ -72,8 +70,8 @@ data WriterState =
7270writeLaTeX :: WriterOptions -> Pandoc -> String
7371writeLaTeX options document =
7472 evalState (pandocToLaTeX options document) $
75− WriterState { stInNote = False, stInTable = False,
76− stTableNotes = [], stOLLevel = 1, stOptions = options,
73+ WriterState { stInNote = False,
74+ stOLLevel = 1, stOptions = options,
7775 stVerbInNote = False,
7876 stTable = False, stStrikeout = False,
7977 stUrl = False, stGraphics = False,
@@ -422,7 +420,6 @@ blockToLaTeX HorizontalRule = return $
422420blockToLaTeX (Header level (id',classes,_) lst) =
423421 sectionHeader ("unnumbered" `elem` classes) id' level lst
424422blockToLaTeX (Table caption aligns widths heads rows) = do
425− modify $ \s -> s{ stInTable = True, stTableNotes = [] }
426423 headers <- if all null heads
427424 then return empty
428425 else ($$ "\\hline\\noalign{\\medskip}") `fmap`
@@ -433,11 +430,8 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
433430 else text "\\noalign{\\medskip}"
434431 $$ text "\\caption" <> braces captionText
435432 rows' <- mapM (tableRowToLaTeX False aligns widths) rows
436− tableNotes <- liftM (reverse . stTableNotes) get
437− let toNote x = "\\footnotetext" <> braces (nest 2 x)
438− let notes = vcat $ map toNote tableNotes
439433 let colDescriptors = text $ concat $ map toColDescriptor aligns
440− modify $ \s -> s{ stTable = True, stInTable = False, stTableNotes = [] }
434+ modify $ \s -> s{ stTable = True }
441435 return $ "\\begin{longtable}[c]" <>
442436 braces ("@{}" <> colDescriptors <> "@{}")
443437 -- the @{} removes extra space at beginning and end
@@ -446,7 +440,6 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
446440 $$ vcat rows'
447441 $$ "\\hline"
448442 $$ capt
449− $$ notes
450443 $$ "\\end{longtable}"
451444
452445toColDescriptor :: Alignment -> String
@@ -661,16 +654,10 @@ inlineToLaTeX (Note contents) = do
661654 modify (\s -> s{stInNote = True})
662655 contents' <- blockListToLaTeX contents
663656 modify (\s -> s {stInNote = False})
664− inTable <- liftM stInTable get
665657 let optnl = case reverse contents of
666658 (CodeBlock _ _ : _) -> cr
667659 _ -> empty
668− if inTable
669− then do
670− curnotes <- liftM stTableNotes get
671− modify $ \s -> s{ stTableNotes = contents' : curnotes }
672− return $ "\\footnotemark" <> space
673− else return $ "\\footnote" <> braces (nest 2 contents' <> optnl)
660+ return $ "\\footnote" <> braces (nest 2 contents' <> optnl)
674661 -- note: a \n before } needed when note ends with a Verbatim environment
675662
676663citationsToNatbib :: [Citation] -> State WriterState Doc