You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
latex_engine = 'xelatex' if language != 'ja' else 'platex' #4150
Subject: I can either build french or japanese but not both with the same conf.py
Problem
Building PDFs for the cPython documentation works for french using xelatex and for japanese with platex, but while initializing latex_engine value we don't have access to the language value.
I'd like to configure something like:
latex_engine = 'xelatex' if language != 'ja' else 'platex'
But we're giving language from a script via the makefile using the form -D language=fr.
Maybe we're doing it the wrong way, and by doing it more naturally we would not enconter this issue? Maybe we should pass latex_engine from the makefile too and have the 'xelatex' if language != 'ja' else 'platex' in our script?
Note:
Internally, Sphinx does not know what configuration values are specified at reading conf.py. Because extensions are not loaded here (They are listed at conf.py!). so it is hard to provide the value of language.
(I know some built-in config values are enabled here, but ...)
Activity
tk0miya commentedon Oct 17, 2017
Unfortunately Sphinx does not support configuration per languages. Please use
-Doption ofsphinx-buildcommand to override configuration.BTW, I made very simple extension to realize your idea:
https://gist.github.com/tk0miya/8e9aa5aaa7d83a27a013839ad5463354
I wish this helps you.
tk0miya commentedon Oct 17, 2017
Note:
Internally, Sphinx does not know what configuration values are specified at reading
conf.py. Because extensions are not loaded here (They are listed at conf.py!). so it is hard to provide the value oflanguage.(I know some built-in config values are enabled here, but ...)
Configuration to properly generate french and japanese PDF.
JulienPalard commentedon Oct 17, 2017
@tk0miya Thanks for the clarification. We're currently using
-D(python/docsbuild-scripts#34).