Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,29 @@

# Get LaTeX to handle Unicode correctly
latex_elements = {
'passoptionstopackages': r'''
\PassOptionsToPackage{T2A}{fontenc}% for cyrillic Є
\PassOptionsToPackage{warn}{textcomp}% unneeded with Sphinx 1.6.6 or later
''',
}

# Additional stuff for the LaTeX preamble.
# Additional stuff for the LaTeX preamble (inc. handling of stray Unicode chars)
latex_elements['preamble'] = r'''
\authoraddress{
\sphinxstrong{Python Software Foundation}\\
Email: \sphinxemail{[email protected]}
}
\let\Verbatim=\OriginalVerbatim
\let\endVerbatim=\endOriginalVerbatim
\ifx\XeTeXinterchartoks\undefined % not for xelatex
\ifx\directlua\undefined % not for lualatex
\ifx\kanjiskip\undefined % not for platex
\usepackage{newunicodechar}
\newunicodechar{ſ}{{\fontencoding{TS1}\fontfamily{lmr}\selectfont s}}
\newunicodechar{K}{\ensuremath{\mathrm K}}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JulienPalard in this line when one copy pastes from inside Firefox from the github web view one gets a standard ascii K in as first argument to \newunicodechar. But in my commit it really is U+212A (KELVIN SIGN).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for notifying. I used curl | git apply if I remember correcly and everything is fine. Errors I still have come from translations strings on 2.7 so we should just fix them in our translation repositories.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got trapped myself because I copied pasted from the web view directly to Doc/conf.py rather than git applying my patch to another branch.

\newunicodechar{−}{\textminus}
\newunicodechar{Є}{{\fontencoding{T2A}\fontfamily{cmr}\selectfont\IeC{\CYRIE}}}
\fi\fi\fi
'''

# The paper size ('letter' or 'a4').
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Provide latex Unicode configuration for successful PDF builds with pdfLaTeX.
Patch by jfbu.