summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs7
-rw-r--r--test/command/lettrine.md9
2 files changed, 13 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 5ac114b19..a37c152d3 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1264,6 +1264,7 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList $
, ("cref", rawInlineOr "cref" $ doref "ref") -- from cleveref.sty
, ("vref", rawInlineOr "vref" $ doref "ref+page") -- from varioref.sty
, ("eqref", rawInlineOr "eqref" $ doref "eqref") -- from amsmath.sty
+ , ("lettrine", optional opt >> extractSpaces (spanWith ("",["lettrine"],[])) <$> tok)
, ("(", mathInline . toksToString <$> manyTill anyTok (controlSeq ")"))
, ("[", mathDisplay . toksToString <$> manyTill anyTok (controlSeq "]"))
, ("ensuremath", mathInline . toksToString <$> braced)
@@ -1320,7 +1321,7 @@ inlineCommands = M.union inlineLanguageCommands $ M.fromList $
, ("i", lit "i")
, ("\\", linebreak <$ (do inTableCell <- sInTableCell <$> getState
guard $ not inTableCell
- optional (bracketed inline)
+ optional opt
spaces))
, (",", lit "\8198")
, ("@", pure mempty)
@@ -1750,7 +1751,7 @@ include = do
(Tok _ (CtrlSeq name) _) <-
controlSeq "include" <|> controlSeq "input" <|>
controlSeq "subfile" <|> controlSeq "usepackage"
- skipMany $ bracketed inline -- skip options
+ skipMany opt
fs <- (map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .
untokenize) <$> braced
let fs' = if name == "usepackage"
@@ -2355,7 +2356,7 @@ hline = try $ do
controlSeq "endhead" <|>
controlSeq "endfirsthead"
spaces
- optional $ bracketed inline
+ optional opt
return ()
lbreak :: PandocMonad m => LP m Tok
diff --git a/test/command/lettrine.md b/test/command/lettrine.md
new file mode 100644
index 000000000..0c3c64d66
--- /dev/null
+++ b/test/command/lettrine.md
@@ -0,0 +1,9 @@
+```
+% pandoc -f latex -t native
+\lettrine{A}{category} is
+
+\lettrine[lhang=0.17]{A}{category} is
+^D
+[Para [Span ("",["lettrine"],[]) [Str "A"],Span ("",[],[]) [Str "category"],Space,Str "is"]
+,Para [Span ("",["lettrine"],[]) [Str "A"],Span ("",[],[]) [Str "category"],Space,Str "is"]]
+```