tiktuk
tiktuk

Reputation: 495

Sphinx PDF output: Apostrophes in python source are replaced by right single quotes

I am outputting some documentation as PDF using Sphinx. It's all very fine except for when python source code are output, then single quotes (unicode U+0027) are output as right single quotes (U+2019) which look awkward.

Here are images of the glyphs in question and here is my generated PDF.

Does anybody know how to correct this?

Upvotes: 9

Views: 675

Answers (1)

abbot
abbot

Reputation: 27850

Add this to your sphinx conf.py (or append to latex_preamble if it is already set):

latex_preamble = """
\usepackage{upquote}
"""

Upvotes: 4

Related Questions