diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-02-18 17:11:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-02-18 17:11:53 -0800 |
commit | 0f5c56dfb171e27745f4fe8530325223ecefe52a (patch) | |
tree | 6a8d76235acf1488597d3d96adf1023940fbf768 /src/Text | |
parent | 005344fb18c9e3bc3c2601ab3b6a7d567c46f398 (diff) | |
download | pandoc-0f5c56dfb171e27745f4fe8530325223ecefe52a.tar.gz |
T.P.PDF: disable `smart` when building PDF via LaTeX.
This is to prevent accidental creation of ligatures like
`` ?` `` and `` !` `` (especially in languages with quotations
like German), and similar ligature issues.
See jgm/citeproc#54.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/PDF.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 7c0082c29..3f9dd8dad 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -43,6 +43,7 @@ import Text.Pandoc.Definition import Text.Pandoc.Error (PandocError (PandocPDFProgramNotFoundError)) import Text.Pandoc.MIME (getMimeType) import Text.Pandoc.Options (HTMLMathMethod (..), WriterOptions (..)) +import Text.Pandoc.Extensions (disableExtension, Extension(Ext_smart)) import Text.Pandoc.Process (pipeProcess) import System.Process (readProcessWithExitCode) import Text.Pandoc.Shared (inDirectory, stringify, tshow) @@ -114,7 +115,10 @@ makePDF program pdfargs writer opts doc = runIOorExplode $ do putCommonState commonState doc' <- handleImages opts tmpdir doc - source <- writer opts doc' + source <- writer opts{ writerExtensions = -- disable use of quote + -- ligatures to avoid bad ligatures like ?` + disableExtension Ext_smart + (writerExtensions opts) } doc' res <- case baseProg of "context" -> context2pdf verbosity program pdfargs tmpdir source "tectonic" -> tectonic2pdf verbosity program pdfargs tmpdir source |