Skip to content

Commit

Permalink
T.P.PDF: disable smart when building PDF via LaTeX.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed Feb 19, 2021
1 parent 005344f commit 0f5c56d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Text/Pandoc/PDF.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0f5c56d

Please sign in to comment.