Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latex_engine = 'xelatex' if language != 'ja' else 'platex' #4150

Closed
JulienPalard opened this issue Oct 13, 2017 · 3 comments
Closed

latex_engine = 'xelatex' if language != 'ja' else 'platex' #4150

JulienPalard opened this issue Oct 13, 2017 · 3 comments

Comments

@JulienPalard
Copy link
Contributor

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?

Reproducible project / your project

Environment info

  • OS: Linux
  • Python version: 3.4.3 and 3.5.4
  • Sphinx version: 1.6.4
@tk0miya
Copy link
Member

tk0miya commented Oct 17, 2017

Unfortunately Sphinx does not support configuration per languages. Please use -D option of sphinx-build command 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
Copy link
Member

tk0miya commented 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 of language.
(I know some built-in config values are enabled here, but ...)

JulienPalard added a commit to JulienPalard/docsbuild-scripts that referenced this issue Oct 17, 2017
This will have to be ported to cpython Doc/conf.py, if we find a way
to do it cleanly. For the moment, it looks like we don't know the
language in conf.py so it's hard, see:

sphinx-doc/sphinx#4150 (comment)
@JulienPalard
Copy link
Contributor Author

@tk0miya Thanks for the clarification. We're currently using -D (python/docsbuild-scripts#34).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants