Can I use the XeLaTeX constructor with Sphinx?

Although the final problem this will solve is TeX (installing a new font for PDF output), this particular solution I'm looking for is a Sphinx problem. Sphinx uses the standard LaTeX when creating PDF files, which is still fine, but I need to install a new font and tried and failed. I understand that this is much simpler using XeLateX, so I would like to know if there is an extension or some way to configure Sphinx to use the XeLaTeX builder instead.

+5
source share
3 answers

I think it comes down to getting into some LaTeX instructions before the sphinx starts its work.

index.rst "" , :

.. raw:: latex

   \setyournicefontorwhatever(beautiful.ttf)

? , (\setcounter{secnumdepth}{-1} "" ).

, Sphinx , . documentclass latex_documents.

+2

sphinx xelatex make xelatex doc .... make latex, then xelatex yourdoc.tex. , : fontenc, inputenc babel, eithier . , leiu babel, . , xelatex ( ) , inputenc [utf8].

conf.py, , " ":

https://github.com/jterrace/sphinxtr/blob/master/conf.py

0

: conf.py xelatex:

latex_elements = {

# Additional stuff for the LaTeX preamble.
    'preamble': ''' \usepackage{fontspec} \setmainfont{Times New Roman}
    ''',
    'inputenc': '',
    'fncychap': '',
    'utf8extra': '',
    'times': '',
    'babel': '\usepackage{polyglossia}',
    'cmap': '',
    'fontenc': '',
    'releasename': '', }

, xelatex .

0

All Articles