Skip to content

Conversation

@atsuoishimoto
Copy link
Contributor

Fix Unicode character error building Japanese PDF documents.

See python/python-docs-ja#31, python/python-docs-ja#35

  • Use LuaTex instead of pLatex.
  • use ltjsbook and ltjsarticle as document class.

@atsuoishimoto atsuoishimoto changed the title [WIP] Fix Unicode character error building Japanese PDF documents Fix Unicode character error building Japanese PDF documents Jan 17, 2023
"-D latex_elements.fontenc=",
)

PLATEX_DEFAULT = (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
PLATEX_DEFAULT = (
LUALATEX_DEFAULT = (

Should the variable name be updated too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I updated in #149.

build_docs.py Outdated
Language("id", "id", "Indonesian", False, XELATEX_DEFAULT),
Language("it", "it", "Italian", False, XELATEX_DEFAULT),
Language("ja", "ja", "Japanese", True, PLATEX_DEFAULT, html_only=True), # See https://github.com/python/python-docs-ja/issues/35
Language("ja", "ja", "Japanese", True, PLATEX_DEFAULT, html_only=True),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Language("ja", "ja", "Japanese", True, PLATEX_DEFAULT, html_only=True),
Language("ja", "ja", "Japanese", True, LUALATEX_DEFAULT, html_only=True),

Also later in the file there's a piece of code that prints the platex version, that should be updated to print the lualatex version instead if platex is no longer used anywhere.

@JulienPalard
Copy link
Member

If I undertand correctly this PR is stuck with the newlines in the preamble?

@JulienPalard
Copy link
Member

As a「 « "temporary" » 」fix, would running:

sed -i $'s/\xef\xbf\xbd/\xef\xa3\xbd/g' Doc/**/*.rst

help? It could be easily added to docsbuild script inside an if language.tag == "ja" and with a big comment explaining why.

@atsuoishimoto
Copy link
Contributor Author

Sorry, I had to start over with a new branch. Please take a look at #149.

@atsuoishimoto
Copy link
Contributor Author

sed -i $'s/\xef\xbf\xbd/\xef\xa3\xbd/g' Doc/**/*.rst

With this change, the pdf is fine. But unfortunately, the HTML document will be messed up. I gave up to support U+FFFD with luatex(for now). Please refer #149.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants