From: Guenter M. <mi...@us...> - 2022-03-05 12:15:12
|
Dear Hoze, thank you for reporting. On 2022-03-04, Hoze wrote: > In Babel class of the docutils.writers.latex2e module, > the language_codes variable lacks 'ko': 'korean'. > That causes a warning message, "no Babel option known for language > 'ko'" every time I run sphinx or jupyter-book. It makes nearly no > problem, yet annoying. > It'll be appreciated if you add 'ko': 'korean'. There are a number of problems: 1. Missing Babel support: After adding 'ko': 'korean':: diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 71ac6bebe..6e62ac131 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -356,6 +356,7 @@ class Babel: 'is': 'icelandic', 'it': 'italian', 'ja': 'japanese', + 'ko': 'korean', 'kk': 'kazakh', 'la': 'latin', 'lt': 'lithuanian', I get a minimal LaTeX document:: \documentclass[a4paper]{article} % generated by Docutils <https://docutils.sourceforge.io/> \usepackage{cmap} % fix search and cut-and-paste in Acrobat \usepackage{ifthen} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[korean,english]{babel} %%% Body \begin{document} 한국어(韓國語)또는 \end{document} However, this does not compile. The error is :: ! Package babel Error: Unknown option `korean'. Either you misspelled it (babel) or the language definition file korean.ldf was not found . I cannot find a Babel language file "korean.ldf" on CTAN. So, IMO, the currently reported error is correct: the LaTeX package Babel does not support Korean, there is "no Babel option known for language 'ko'". 2. It works with "Polyglossia" (and `xelatex` or `lualatex`): What I do find is "latex/polyglossia/gloss-korean.ldf", so it makes sense, to add ``'ko': 'korean'`` to the polyglossia languages supported by the "xetex" writer (for the UTF8-aware LaTeX engines `xelatex` and `lualatex`). Testing the minimal example does not work out of the box, because the default font "LatinModern" does not support the Korean script. However, this can be soved by users via a custom LaTeX preamble or stylesheet, e.g. :: \usepackage{fontspec} \setmainfont{Noto Sans CJK SC}[Language=Korean] 2. Sphinx uses a fork of the Docutils "latex" writer that is developed independently. Any fixes in Docutils will not help users of Sphinx -- unless ported over by Sphinx developers. I don't know about the situation with jupyter. Günter |