Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 366
tiktuk Avatar asked Apr 22 '11 16:04

tiktuk


1 Answers

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

latex_preamble = """
\usepackage{upquote}
"""
like image 188
abbot Avatar answered Nov 15 '22 00:11

abbot