diff options
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 548ac75a8..20a2db76b 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -420,6 +420,8 @@ inlineCommands = M.unions , ("uline", underline <$> tok) -- plain tex stuff that should just be passed through as raw tex , ("ifdim", ifdim) + -- stackengine + , ("addstackgap", skipopts *> tok) ] lettrine :: PandocMonad m => LP m Inlines @@ -833,6 +835,7 @@ blockCommands = M.fromList <|> (grouped block >>= addMeta "title"))) , ("subtitle", mempty <$ (skipopts *> tok >>= addMeta "subtitle")) , ("author", mempty <$ (skipopts *> authors)) + , ("tableofcontents", mempty <$ (addMeta "tableOfContents" True)) -- -- in letter class, temp. store address & sig as title, author , ("address", mempty <$ (skipopts *> tok >>= addMeta "address")) , ("signature", mempty <$ (skipopts *> authors)) @@ -933,11 +936,15 @@ environments = M.union (tableEnvironments blocks inline) $ , ("abstract", mempty <$ (env "abstract" blocks >>= addMeta "abstract")) , ("sloppypar", env "sloppypar" blocks) , ("letter", env "letter" letterContents) + , ("multicols", env "multicols" multicols) , ("minipage", env "minipage" $ skipopts *> spaces *> optional braced *> spaces *> blocks) , ("figure", env "figure" $ skipopts *> figure) , ("subfigure", env "subfigure" $ skipopts *> tok *> figure) , ("center", divWith ("", ["center"], []) <$> env "center" blocks) + , ("flushright", divWith ("", ["flushright"], []) <$> env "flushright" blocks) + , ("flushleft", divWith ("", ["flushleft"], []) <$> env "flushleft" blocks) + , ("landscape", env "landscape" blocks) , ("quote", blockQuote <$> env "quote" blocks) , ("quotation", blockQuote <$> env "quotation" blocks) , ("verse", blockQuote <$> env "verse" blocks) @@ -1088,6 +1095,18 @@ letterContents = do _ -> mempty return $ addr <> bs -- sig added by \closing +multicols :: PandocMonad m => LP m Blocks +multicols = do + spaces + n <- fromMaybe 1 . safeRead . untokenize <$> braced + spaces + bs <- blocks + return $ divWith ("", ["columns"], []) $ cols n bs + where + cols :: Int -> Blocks -> Blocks + cols n = foldr1 (.) (replicate n $ divWith ("", ["column"], [])) + + figure :: PandocMonad m => LP m Blocks figure = try $ do resetCaption |