From 63a949d7300c401cb98595ebe5fcc9f30c00d7a6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 17 Dec 2024 20:03:23 -0800 Subject: [PATCH] LaTeX writer: use displayquote for block quotes with csquotes. Closes #10456. --- src/Text/Pandoc/Writers/LaTeX.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 40cdb73e2393..5df392074e2a 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -426,6 +426,7 @@ blockToLaTeX (LineBlock lns) = blockToLaTeX $ linesToPara lns blockToLaTeX (BlockQuote lst) = do beamer <- gets stBeamer + csquotes <- liftM stCsquotes get case lst of [b] | beamer && isListBlock b -> do oldIncremental <- gets stIncremental @@ -438,7 +439,10 @@ blockToLaTeX (BlockQuote lst) = do modify (\s -> s{stInQuote = True}) contents <- blockListToLaTeX lst modify (\s -> s{stInQuote = oldInQuote}) - return $ "\\begin{quote}" $$ contents $$ "\\end{quote}" + let envname = if csquotes then "displayquote" else "quote" + return $ ("\\begin" <> braces envname) $$ + contents $$ + ("\\end" <> braces envname) blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do opts <- gets stOptions inNote <- stInNote <$> get