lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210525123012.GA16810@bobwxc.top>
Date:   Tue, 25 May 2021 20:30:12 +0800
From:   "Wu X.C." <bobwxc@...il.cn>
To:     Akira Yokosawa <akiyks@...il.com>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] docs: Activate exCJK only in CJK chapters

On Tue, May 25, 2021 at 08:17:26PM +0900, Akira Yokosawa wrote:
> Activating xeCJK in English and Italian-translation documents
> results in sub-optimal typesetting with wide-looking apostrophes
> and quotation marks.
> 
> The xeCJK package provides macros for enabling and disabling its
> effect in the middle of a document, namely \makexeCJKactive and
> \makexeCJKinactive.
> 
> So the goal of this change is to activate xeCJK in the relevant
> chapters in translations.
> 
> To do this:
> 
>     o Define custom macros in the preamble depending on the
>       availability of the "Noto Sans CJK" font so that those
>       macros can be used regardless of the use of xeCJK package.
> 
>     o Patch \sphinxtableofcontents so that xeCJK is inactivated
>       after table of contents.
> 
>     o Embed those custom macros in each language's index.rst file
>       as a ".. raw:: latex" construct.
> 
> Note: A CJK chapter needs \kerneldocCJKon in front of its chapter
> heading, while a non-CJK chapter should have \kerneldocCJKoff
> below its chapter heading.
> 
> This is to make sure the CJK font is available to CJK chapter's
> heading and ending page's footer.
> 
> Signed-off-by: Akira Yokosawa <akiyks@...il.com>

Test it, worked well.

Tested-by: Wu XiangCheng <bobwxc@...il.cn>

And one warning when am patch:

    .git/rebase-apply/patch:62: trailing whitespace.
	    \kerneldocCJKoff


> I think per-directory conf.py can be tried as a follow-up
> change after this patch is applied.

Agree, I think it's enough for this problem.
If we need more complex customization, per-directory conf.py then worth. 

> --- a/Documentation/translations/index.rst
> +++ b/Documentation/translations/index.rst
> @@ -18,6 +18,10 @@ Translations
>  Disclaimer
>  ----------
>  
> +.. raw:: latex
> +
> +	\kerneldocCJKoff	
> +
>  Translation's purpose is to ease reading and understanding in languages other
>  than English. Its aim is to help people who do not understand English or have
>  doubts about its interpretation. Additionally, some people prefer to read
> diff --git a/Documentation/translations/it_IT/index.rst b/Documentation/translations/it_IT/index.rst
> index bb8fa7346939..e80a3097aa57 100644
> --- a/Documentation/translations/it_IT/index.rst
> +++ b/Documentation/translations/it_IT/index.rst
> @@ -4,6 +4,10 @@
>  Traduzione italiana
>  ===================
>  
> +.. raw:: latex
> +
> +	\kerneldocCJKoff
> +
>  :manutentore: Federico Vaga <federico.vaga@...a.pv.it>
>  
>  .. _it_disclaimer:

And for above two, maybe better to put "raw:: latex" block above the
title, more beautiful, and CJKoff will be done before enter "Italiana"
chapter.

Thanks,
	Wu X.C.

Download attachment "signature.asc" of type "application/pgp-signature" (660 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ