← Back to DAGDA | Support | Source: https://github.com/sphinx-doc/sphinx/issues/4150
Skip to content

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

Closed

Description

@JulienPalard

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

Activity

  1. tk0miya commented on Oct 17, 2017

    @tk0miya
    Member

    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.

  2. tk0miya commented on Oct 17, 2017

    @tk0miya
    Member

    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 ...)

  3. JulienPalard commented on Oct 17, 2017

    @JulienPalard
    ContributorAuthor

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

  4. locked as resolved and limited conversation to collaborators on Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions