mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] docs: sphinx-pre-install: Reword warning on installing cjk font
Date: Fri, 21 May 2021 22:04:12 +0900	[thread overview]
Message-ID: <12a4169e-5c50-b6c3-64df-37a9d05199b3@gmail.com> (raw)
In-Reply-To: <20210521141952.2c575cbe@coco.lan>

On Fri, 21 May 2021 14:19:52 +0200, Mauro Carvalho Chehab wrote:
> Em Fri, 21 May 2021 18:00:00 +0900
> Akira Yokosawa <akiyks@gmail.com> escreveu:
> 
>> Hi Mauro,
>>
>> On Fri, 21 May 2021 09:54:42 +0200, Mauro Carvalho Chehab wrote:
>>> HI Akira,
>>>
>>> Em Fri, 21 May 2021 16:14:19 +0900
>>> Akira Yokosawa <akiyks@gmail.com> escreveu:
>>>   
>>>> Installing a ckj font as recommended by the warning message causes
>>>> generated latex code to have:
>>>>
>>>> 	% This is needed for translations
>>>> 	\usepackage{xeCJK}
>>>> 	\setCJKmainfont{Noto Sans CJK SC}
>>>>
>>>> in its preamble even for an English document.  
>>>
>>> Yes. The same LaTeX configuration is applied to all documents.
>>>
>>> While the standard Sphinx logic allows just one conf.py, there's
>>> a logic on Linux that allows a per-directory configuration.
>>> Perhaps it would be possible to set the font just for translations.
>>>
>>> Yet, this can't be easily done per-translation - Italian
>>> translation for instance doesn't need CJK fonts.  
>>
>> Yes, the Italian part looks ugly with xeCJK.
>>
>>>   
>>>> The package "xeCJK" changes wide characters' appearance including
>>>> apostrophe (single quote) and double quotes, and it changes line-break
>>>> behavior with regard to the boundary of narrow and wide characters.
>>>>
>>>> This greatly degrades readability of English PDFs typeset by xelatex.  
>>>
>>> Hmm... could you give an example where it looks ugly?
>>>
>>> At least on the documents I use to check the PDF output, I was unable
>>> to see any big issue.  
>>
>> Appended are screenshots from RCU.pdf built with and without xeCJK.
>>
>> They are built on Ubuntu Bionic based container with sphinx 2.4.4.
>>
>> I think you can see the difference of how apostrophes are rendered.
>> Line-break points are also affected by the widths of apostrophes.
>>
>> Can you spot the difference?
> 
> Ok, now I understand what you're meaning. We need to double check
> what's wrong there, as it doesn't make much sense to have a
> "`  " character instead of "`" on those places, nor to change
> the word's hyphenation logic.

No, I'm afraid you don't get the point yet.

The point is, just commenting out the lines:

 	% This is needed for translations
% 	\usepackage{xeCJK}
% 	\setCJKmainfont{Noto Sans CJK SC}

, xelatex renders both UTF8 and ASCII apostrophe characters in the
same way.

On the contrary, with xeCJK, UTF and ASCII code are handled
differently.
The reason is that in CJK typesetting, line breaks are permitted almost
anywhere in the text, with a few exceptions specific to each language.

So, sphinx is doing nothing wrong when it converts ASCII apostrophe in
.rst into the UTF8 in latex code.

Enabling xeCJK in English document is the very wrong thing to do in the
first place.

I hope I have made my point clear enough.

        Thanks, Akira

> 
>>
>> BTW, on current docs-next, wich the CJK font installed, "make pdfdocs"
>> stops while building s390.pdf.
> 
> That's weird.
> 
>> I needed to manually run "make latexdocs", then run
>> "latexmk -xelatex RCU.tex" under Documentation/output/latex/ to get
>> RCU.pdf.
> 
> Well, you can pass some options to latexmk when building a
> pdf via an environment var (LATEXMKOPTS), like (untested):
> 
> 	LATEXMKOPTS="-interaction=nonstopmode" make pdfdocs.
> 
> or change it to interactive mode, in order to show what part
> of the s390.tex is causing the issue.
> 
> Thanks,
> Mauro
> 

      reply	other threads:[~2021-05-21 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21  7:14 Akira Yokosawa
2021-05-21  7:54 ` Mauro Carvalho Chehab
2021-05-21  9:00   ` Akira Yokosawa
2021-05-21 12:19     ` Mauro Carvalho Chehab
2021-05-21 13:04       ` Akira Yokosawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12a4169e-5c50-b6c3-64df-37a9d05199b3@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®