From nobody Mon Jun 29 23:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1E67C433FE for ; Tue, 1 Feb 2022 00:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229898AbiBAAAF (ORCPT ); Mon, 31 Jan 2022 19:00:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbiBAAAE (ORCPT ); Mon, 31 Jan 2022 19:00:04 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15CB3C061714; Mon, 31 Jan 2022 16:00:04 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id i65so14268728pfc.9; Mon, 31 Jan 2022 16:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=pOvdxwNu0aCxPhjOkTQG4+wa9GYqirD+kwvDetyDjpk=; b=Sho7e8/eoHtTyCU8+A18o2EYGFcGkbVajS2+AUq75ecTJ/FzwIqwCO7QtCmbkP3D6C C90Fy9K+cyhpDJxx1vH3bXofZNiiGBhM52AotrcPLpmZTA+ASOsTWH2ru6qxNvFEdZgU egeVWjrqnpTqgmnoKT3rdp2DGmSVjI5Y519e+X6bHrEnwNW/U0s18vRI19ff7Szq4AWL M3XmbBX3yJXMLhOJn123ykp+GU7gANfpA51V7iRnf+nB9z/ZImbpj/l/gxQMjUpZL37S uY5nG4N55laW66tTHtOh2uu4d40BmmSLT1l3tNjR0isuchF++R/rWpS9btrSkI3CzUxf RI0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=pOvdxwNu0aCxPhjOkTQG4+wa9GYqirD+kwvDetyDjpk=; b=Vhv9IgrV1uRkpJdWZU4bhtYVxQyTJn7WdwHO4Yu/EIYyVkaDRthUXbiVdXSQIErB2X wiGEjpzphhvlHImESuFfNOuFZukKXgZkdLBtDDeH2Rx8kiJCUyMO7rJ3nTNsyIxhfsFe TAVuraXriVkNfMQOYQbl3uMAduFlia5VrTnTz45N86JVnFuqo+fZh952tJ8Ym4t6pCvw acDjB/WtKqewhU2+mrtuYgulspu/yCd4fb9gQ0yrLiycShQchsdLh7x5WMRUsk3ddHMX CTXwH+w+WpicH2VTrBDpbfHmRuyrk9sP2tPt3MpuYKTZcqggT+mEk3T6aa9LJBQCvJGy zu3w== X-Gm-Message-State: AOAM530UzFqqbGIRtHlgbpiEcfEghMxfPuCV8kRu+iMa0Eb112lKng92 pfnA1zMLWYLfWb4fzqARnGMZtiMBrAI= X-Google-Smtp-Source: ABdhPJwnw80vuMi8nIQOiUXPls0N87Lns5agH4rI24kKwyY/obU2gdUtbkQtKicxKj3gulyq4I+Raw== X-Received: by 2002:a62:15c3:: with SMTP id 186mr22294832pfv.59.1643673603549; Mon, 31 Jan 2022 16:00:03 -0800 (PST) Received: from [192.168.11.5] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id pc4sm437936pjb.3.2022.01.31.16.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 16:00:02 -0800 (PST) Message-ID: Date: Tue, 1 Feb 2022 08:59:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH 1/5] docs: pdfdocs: Tweak width params of TOC Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: From: Akira Yokosawa In-Reply-To: Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Sphinx has its own set of width parameters of Table of Contents (TOC) for LaTeX defined in its class definition of sphinxmanual.cls. It also inherits parameters for chapter entries from report.cls of original LaTeX base. However, they are optimized assuming small documents with tens of pages and chapters/sections of less than 10. To cope with some of kernel-doc documents with more than 1000 pages and several tens of chapters/sections, definitions of those parameters need to be adjusted. Unfortunately, those parameters are hard coded in the class definitions and need low-level LaTeX coding tricks to redefine. As Sphinx 1.7.9 does not have \sphinxtableofcontentshook, which defines those parameters in later Sphinx versions, for compatibility with both pre-1.8 and later Sphinx versions, empty the hook altogether and redefine \@pnumwidth, \l@chapter, \l@section, and \@subsection commands originally defined in report.cls. Summary of parameter changes: Width of page number (\@pnumwidth): 1.55em -> 2.7em Width of chapter number: 1.5em -> 1.8em Indent of section number: 1.5em -> 1.8em Width of section number: 2.6em -> 3.2em Indent of subsection number: 4.1em -> 5em Width of subsection number: 3.5em -> 4.3em Notes: 1. Parameters for subsection become relevant only when ":maxdepth: 3" is specified under "toctree::" (e.g., RCU/index.rst). They can hold subsection numbers up to 5 digits such as "18.7.13" (in RCU.pdf). 2. Number of chapters in driver-api.pdf is getting closer to 100. When it reaches 100, another set of tweaks will be necessary. 3. The low-level LaTeX trick is mentioned in "Unofficial LaTeX2e reference manual" at: http://latexref.xyz/Table-of-contents-etc_002e.html Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet --- Documentation/conf.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/conf.py b/Documentation/conf.py index f07f2e9b9f2c..e5c13dee2de8 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -409,6 +409,37 @@ latex_elements =3D { =20 # Additional stuff for the LaTeX preamble. 'preamble': ''' + % Custom width parameters for TOC --- Redefine low-level commands + % defined in report.cls + \\makeatletter + %% Redefine \\@pnumwidth (page number width) + \\renewcommand*\\@pnumwidth{2.7em} + %% Redefine \\l@chapter (chapter list entry) + \\renewcommand*\\l@chapter[2]{% + \\ifnum \\c@tocdepth >\\m@ne + \\addpenalty{-\\@highpenalty}% + \\vskip 1.0em \\@plus\\p@ + \\setlength\\@tempdima{1.8em}% + \\begingroup + \\parindent \\z@ \\rightskip \\@pnumwidth + \\parfillskip -\\@pnumwidth + \\leavevmode \\bfseries + \\advance\\leftskip\\@tempdima + \\hskip -\\leftskip + #1\\nobreak\\hfil + \\nobreak\\hb@xt@\\@pnumwidth{\\hss #2% + \\kern-\\p@\\kern\\p@}\\par + \\penalty\\@highpenalty + \\endgroup + \\fi} + %% Redefine \\l@section and \\l@subsection + \\renewcommand*\\l@section{\\@dottedtocline{1}{1.8em}{3.2em}} + \\renewcommand*\\l@subsection{\\@dottedtocline{2}{5em}{4.3em}} + \\makeatother + %% Sphinx < 1.8 doesn't have \\sphinxtableofcontentshook + \\providecommand{\\sphinxtableofcontentshook}{} + %% Undefine it for compatibility with Sphinx 1.7.9 + \\renewcommand{\\sphinxtableofcontentshook}{} % Empty the hook % Prevent column squeezing of tabulary. \\setlength{\\tymin}{20em} % Use some font with UTF-8 support with XeLaTeX --=20 2.17.1 From nobody Mon Jun 29 23:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B338EC433FE for ; Tue, 1 Feb 2022 00:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiBAACT (ORCPT ); Mon, 31 Jan 2022 19:02:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiBAACS (ORCPT ); Mon, 31 Jan 2022 19:02:18 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0792DC061714; Mon, 31 Jan 2022 16:02:18 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id h20-20020a17090adb9400b001b518bf99ffso825318pjv.1; Mon, 31 Jan 2022 16:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Z0XgTk76ywjS8fg7jX/3lUVAUlkvwgxnb1BEJ1GEsnc=; b=euhd8+BDHWELpy6ZWmuHm8wjIMgv869CnWKXQwbJ/WPtnLw2yzWuiMBqK0FNPTcUpK PhnfbrWdjXryMLSKolN2KRn2PbzQKj7RE2Eo6/5LmfWIJlvrEAMwbT3zg3gKX9wCCyut KUDZoKfN02cq4N6Tv0xgTWe7QD7EsLQ3Xg9rh90podRztDhhY4b7V9Iwm0lQy4J03Drg N4OrPl2wuASsJI/xriuddAlswYv4vlYsnlt2IZASWPEiWiBOY895jKqiikgKuBtGYURQ R/N7rMjNcMBdz02y4ZCsNXElKqXTCU2hOZ9KnvcoLalu4Ev2TaGamSegbi+IuUIP7At5 BPAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z0XgTk76ywjS8fg7jX/3lUVAUlkvwgxnb1BEJ1GEsnc=; b=ymJobXOiByqpRSXskoZLsflmAjBKDCQwpSoG8FVpk88nIftE6sQCe94nE1Lrlge9RN WyS4TcUpY7C9UisSGyzXzIUcWiJ81U+CKI5n3WDYtM7dJWbKlZ0rRwpJ6UUQJU9f0frU fzUoSDw/CgjKl/hA5zsTCtkruzgtGewKMT5v0DDSzf1rXMaHBTfFcnLWgTW6BLq/nxmN BvwmaQZd0LScKSCo/hoePAVlUMyujI5RNZ2pmG/3nrkD8Bz83c309yStqq8mOOLJybXB IhHGgue6Y9IngHtnHibHVF9tlZ4arup0Vo1ikFY2ongNZw1wcpWuTsK00VlGnN3RzH7l 5kHQ== X-Gm-Message-State: AOAM531XoNi5JPVBlmFWccKwIaZDNzr4a7J04siA1VEWhoASg+UiRZp8 Rqg2YtPSiYc1dbEt9iLWLX4= X-Google-Smtp-Source: ABdhPJyrnn7CzOgFqXAQV5iY4F3jw1Q8PuwkIBwvYtZ5ZJlKjxqrKIZvr/v59hMx9c7Nm7gew71SDA== X-Received: by 2002:a17:90b:4f44:: with SMTP id pj4mr27136304pjb.167.1643673737554; Mon, 31 Jan 2022 16:02:17 -0800 (PST) Received: from [192.168.11.5] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id pi9sm432786pjb.46.2022.01.31.16.02.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 16:02:17 -0800 (PST) Message-ID: <0c8ea878-0a6f-ea01-ab45-4e66c5facee9@gmail.com> Date: Tue, 1 Feb 2022 09:02:14 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH 2/5] docs: pdfdocs: Switch default CJK font to KR variants Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: From: Akira Yokosawa In-Reply-To: Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" xeCJK is enabled in Table of Contents (TOC) so that translations.pdf built by top-level "make pdfdocs" can have its TOC typeset properly. This causes quotation marks and apostrophe symbols appear too wide in Latin-script docs. This is because (1) Sphinx converts ASCII symbols into multi-byte UTF-8 ones in LaTeX and (2) in the SC variant of "Noto CJK" font families, those UTF-8 symbols have full-width glyph. The KR variant of the font families has half-width glyph for those symbols and TOC pages should look nicer when it is used instead. Switch the default CJK font families to the KR variant and teach xeCJK of those symbols' widths. To compensate the switch, teach xeCJK of the width in the SC and TC variants. Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet --- Documentation/conf.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index e5c13dee2de8..e70aa5fd969f 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -460,13 +460,15 @@ latex_elements['preamble'] +=3D ''' \\IfFontExistsTF{Noto Sans CJK SC}{ % This is needed for translations \\usepackage{xeCJK} - \\IfFontExistsTF{Noto Serif CJK SC}{ - \\setCJKmainfont{Noto Serif CJK SC}[AutoFakeSlant] + \\IfFontExistsTF{Noto Serif CJK KR}{ + \\setCJKmainfont{Noto Serif CJK KR}[AutoFakeSlant] }{ - \\setCJKmainfont{Noto Sans CJK SC}[AutoFakeSlant] + \\setCJKmainfont{Noto Sans CJK KR}[AutoFakeSlant] } - \\setCJKsansfont{Noto Sans CJK SC}[AutoFakeSlant] - \\setCJKmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant] + \\setCJKsansfont{Noto Sans CJK KR}[AutoFakeSlant] + \\setCJKmonofont{Noto Sans Mono CJK KR}[AutoFakeSlant] + \\xeCJKDeclareCharClass{HalfLeft}{`=E2=80=9C,`=E2=80=98} + \\xeCJKDeclareCharClass{HalfRight}{`=E2=80=9D,`=E2=80=99} % CJK Language-specific font choices \\IfFontExistsTF{Noto Serif CJK SC}{ \\newCJKfontfamily[SCmain]\\scmain{Noto Serif CJK SC}[AutoFakeSlant] @@ -513,11 +515,18 @@ latex_elements['preamble'] +=3D ''' \\newcommand{\\kerneldocBeginSC}{% \\begingroup% \\scmain% + \\xeCJKDeclareCharClass{FullLeft}{`=E2=80=9C,`=E2=80=98}% + \\xeCJKDeclareCharClass{FullRight}{`=E2=80=9D,`=E2=80=99}% + \\renewcommand{\\CJKrmdefault}{SCserif}% + \\renewcommand{\\CJKsfdefault}{SCsans}% + \\renewcommand{\\CJKttdefault}{SCmono}% } \\newcommand{\\kerneldocEndSC}{\\endgroup} \\newcommand{\\kerneldocBeginTC}{% \\begingroup% \\tcmain% + \\xeCJKDeclareCharClass{FullLeft}{`=E2=80=9C,`=E2=80=98}% + \\xeCJKDeclareCharClass{FullRight}{`=E2=80=9D,`=E2=80=99}% \\renewcommand{\\CJKrmdefault}{TCserif}% \\renewcommand{\\CJKsfdefault}{TCsans}% \\renewcommand{\\CJKttdefault}{TCmono}% @@ -525,8 +534,6 @@ latex_elements['preamble'] +=3D ''' \\newcommand{\\kerneldocEndTC}{\\endgroup} \\newcommand{\\kerneldocBeginKR}{% \\begingroup% - \\xeCJKDeclareCharClass{HalfLeft}{`=E2=80=9C,`=E2=80=98}% - \\xeCJKDeclareCharClass{HalfRight}{`=E2=80=9D,`=E2=80=99}% \\krmain% \\renewcommand{\\CJKrmdefault}{KRserif}% \\renewcommand{\\CJKsfdefault}{KRsans}% @@ -536,8 +543,6 @@ latex_elements['preamble'] +=3D ''' \\newcommand{\\kerneldocEndKR}{\\endgroup} \\newcommand{\\kerneldocBeginJP}{% \\begingroup% - \\xeCJKDeclareCharClass{HalfLeft}{`=E2=80=9C,`=E2=80=98}% - \\xeCJKDeclareCharClass{HalfRight}{`=E2=80=9D,`=E2=80=99}% \\jpmain% \\renewcommand{\\CJKrmdefault}{JPserif}% \\renewcommand{\\CJKsfdefault}{JPsans}% --=20 2.17.1 From nobody Mon Jun 29 23:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBD3BC433F5 for ; Tue, 1 Feb 2022 00:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbiBAADV (ORCPT ); Mon, 31 Jan 2022 19:03:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiBAADU (ORCPT ); Mon, 31 Jan 2022 19:03:20 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29B12C061714; Mon, 31 Jan 2022 16:03:20 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id y17so13937935plg.7; Mon, 31 Jan 2022 16:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=byIwpZW1+792EbjDkg1ohZm56x0AtTx/j3R8ifq04Tk=; b=OC6g9sIwVLmpJK5a0yxAuIRC5UToV3kc0cV3/CDSPolzZvwlm7i0u4F/BQYWJAIKYE Zs/pyZloZpukhRmAGPFyctiWhUx418re/9SstLtuob/KwsTLtchieK3Clvxbmhlfo9wN yrpSMk3jlwvmGNldNjTy1zUPynWdFdzirOqVS99IUGgCxv0+vnjZ6/tPPGpJAE+sIngi NsnAZ2eTTD0mUmywakWyqFYe40oD6kWkyJOfeOw0XMLQVH4LEguZF/panpLPY1z+MYhF fsVNEF2kW/7mlRORQmDgWbtTRkxF9Cmz0tP1uqFBY78AXiakWP/DgBgfw3DCl/dP16KA XKLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=byIwpZW1+792EbjDkg1ohZm56x0AtTx/j3R8ifq04Tk=; b=AAD8o7wFhsRL2ZYDbhKJKDL/Z9nUMlFTV1Aazc55qQ35jOLCCF8gOyFUvqpZ712eoi 5MrULr7iZWXdqshqzj8HavYz6z2d4mH2wmPHNjhMjgeoE0GcVrv0hcWUkgsg2+gz7gUG PZFgtqMLhQfbfOcRrSaxIcfHANepX60oQd64ySImLmfN2ONHh8vkjwY59UHZLYkd2J72 n2OX1Mka4D82uXtNVQAGPPIRaiwyoVzWJibtW+z/A95VWJyAR6TXbBGkuH0jAV1o0Aed tGTVVOdlPc7fbNwPRmjnGGjC8NxmOs5ju5uxeC7pweoa3/a+H0CT342g38Hv4Svc/Pgk fXDg== X-Gm-Message-State: AOAM530wCMX+qY6BZbaS77oEG5HJ2vdPkVue6RHLwtspRr/RjQdpmCgs /ZSSyIsDP4b9kCT12dda83o= X-Google-Smtp-Source: ABdhPJxlo7Fwv5G+tjmfuaCsgR1Yd9JiEC47kb5auZf+LV+JjbpDLX0X1G253BME1pvcwABO2aVNlw== X-Received: by 2002:a17:902:e550:: with SMTP id n16mr22526321plf.151.1643673799610; Mon, 31 Jan 2022 16:03:19 -0800 (PST) Received: from [192.168.11.5] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id r11sm19735446pff.81.2022.01.31.16.03.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 16:03:19 -0800 (PST) Message-ID: <19141b3e-01d9-1f6d-5020-42fbda784831@gmail.com> Date: Tue, 1 Feb 2022 09:03:16 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH 3/5] docs: pdfdocs: Enable CJKspace in TOC for Korean titles Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: From: Akira Yokosawa In-Reply-To: Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Korean (Hangul) titles in Table of Contents of translations.pdf don't have inter-phrase spaces. This is because the CJKspace option of xeCJK is disabled by default. Restore the spaces by enabling the option at the beginning of every document and disable it in the \kerneldocBegin{SC|TC|JP} commands. Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet --- Documentation/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index e70aa5fd969f..ded49b8e9bf6 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -520,6 +520,7 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKrmdefault}{SCserif}% \\renewcommand{\\CJKsfdefault}{SCsans}% \\renewcommand{\\CJKttdefault}{SCmono}% + \\xeCJKsetup{CJKspace =3D false}% } \\newcommand{\\kerneldocEndSC}{\\endgroup} \\newcommand{\\kerneldocBeginTC}{% @@ -530,6 +531,7 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKrmdefault}{TCserif}% \\renewcommand{\\CJKsfdefault}{TCsans}% \\renewcommand{\\CJKttdefault}{TCmono}% + \\xeCJKsetup{CJKspace =3D false}% } \\newcommand{\\kerneldocEndTC}{\\endgroup} \\newcommand{\\kerneldocBeginKR}{% @@ -538,7 +540,7 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKrmdefault}{KRserif}% \\renewcommand{\\CJKsfdefault}{KRsans}% \\renewcommand{\\CJKttdefault}{KRmono}% - \\xeCJKsetup{CJKspace =3D true} % For inter-phrase space + % \\xeCJKsetup{CJKspace =3D true} % true by default } \\newcommand{\\kerneldocEndKR}{\\endgroup} \\newcommand{\\kerneldocBeginJP}{% @@ -547,6 +549,7 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKrmdefault}{JPserif}% \\renewcommand{\\CJKsfdefault}{JPsans}% \\renewcommand{\\CJKttdefault}{JPmono}% + \\xeCJKsetup{CJKspace =3D false}% } \\newcommand{\\kerneldocEndJP}{\\endgroup} % Single spacing in literal blocks @@ -555,6 +558,7 @@ latex_elements['preamble'] +=3D ''' \\usepackage{etoolbox} % Inactivate CJK after tableofcontents \\apptocmd{\\sphinxtableofcontents}{\\kerneldocCJKoff}{}{} + \\xeCJKsetup{CJKspace =3D true} % For inter-phrase space of Korean TOC }{ % No CJK font found % Custom macros to on/off CJK (Dummy) \\newcommand{\\kerneldocCJKon}{} --=20 2.17.1 From nobody Mon Jun 29 23:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4154C433FE for ; Tue, 1 Feb 2022 00:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiBAAEp (ORCPT ); Mon, 31 Jan 2022 19:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiBAAEo (ORCPT ); Mon, 31 Jan 2022 19:04:44 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B07F7C061714; Mon, 31 Jan 2022 16:04:44 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id k17so14034206plk.0; Mon, 31 Jan 2022 16:04:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=CEEo2n33BUrBfLTjQUqFbQ013BsFfsxgxTbhBfnlILU=; b=jsqoWp3F7r7B6FaiIB2/L3BmTS37N3WZj8qUxWpLd4lbL0WffX4t7Xhhbkb8+wSs9r M20NVdIf1Lfocd97Zo2FBm+kZGD9fLYqHYXT9lWfHuz+f/00oUdPH1PVN3PkSCVvvYsa Msu2L35exs1rXtIBk22Xd9wE748g3nqTfLqNYDEid8IVp4qWY6ovemh+gkTKvQDooMuF E7eXjv9pzKL72acDUNhvD0Pn+2EIXr77/P0VcNB7XPEE07oYIiwceCq+7/911NThFFWo +xVxqyVHV2A1CNFsCIMkZswBZOn8K+AnsxX/w29gkBhkFWDmPdyKzK1jonweHK/294WN dfcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=CEEo2n33BUrBfLTjQUqFbQ013BsFfsxgxTbhBfnlILU=; b=ymusOtPkUAMD+qhDUrTfOGkyD9mZhI9P+eoHbK8xH8KrPoLYYILdrO7Zw1Hd64De70 HWyMOxdWqQ2W4wXTB06A5+08e2x4CTfwXqrkkEpGSIVfoRdL5dGe0eM6jB6Nh0zHzBlz 6gFyX0+6gFrS1em0QETUlwP/aOGvu1mdtFUA/QgCzFOEEd4LbQkaaJC2ZJ1PPmrmAmSt wbZ3iDGgWe/nfEK0eltS8CqB73OQG20OIeuWIl0VES7s5kCIBxRAclzbqK8HLtrEDvCy jAsH0RCXymBq1poSrQKKbhQGjhv6TmfeU5MHhRj+MtGwp41L39WfsD8mxrx2BTfMhRPb Ht8w== X-Gm-Message-State: AOAM530Wyor3zLjpYzlZcQwZZ88SrKFWRNAwAHBmA5+0HHE7i2tYF6UM ijdSgPwyCccNJirUBi2QbHM= X-Google-Smtp-Source: ABdhPJw9vUT4PgB56q99z2nirH/GgAnDdBqkKOExaJex6C22nDbqZEytFnY96ws2OA7Z0+YC7FWz1w== X-Received: by 2002:a17:902:da8b:: with SMTP id j11mr23435910plx.90.1643673884221; Mon, 31 Jan 2022 16:04:44 -0800 (PST) Received: from [192.168.11.5] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id mi11sm396601pjb.37.2022.01.31.16.04.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 16:04:43 -0800 (PST) Message-ID: <3359ca41-b81d-b2c7-e437-7618efbe241d@gmail.com> Date: Tue, 1 Feb 2022 09:04:40 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH 4/5] docs/translations: Skip CJK contents if suitable fonts not found Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: From: Akira Yokosawa In-Reply-To: Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On systems without "Noto Sans CJK" fonts, CJK chapters in translations.pdf are full of "TOFU" boxes, with a long build time and a large log file containing lots of missing-font warnings. Avoid such waste of time and resources by skipping CJK chapters when CJK fonts are not available. To skip whole chapters, change the definition of \kerneldocBegin{SC|TC|KR|JP} commands so that they can have an argument to be ignored. This works as far as the argument (#1) is not used in the command. In place of skipped contents, put a note on skipped contents at the beginning of the PDF. Change the call sites in index.rst of CJK translations accordingly. When CJK fonts are available, existing command definitions with no argument just work. LaTeX engine will see additional pairs of "{" and "}", which add a level of grouping without having any effect on typesetting. Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet --- Documentation/conf.py | 13 +++++++++---- Documentation/translations/ja_JP/index.rst | 4 ++-- Documentation/translations/ko_KR/index.rst | 5 ++--- Documentation/translations/zh_CN/index.rst | 4 ++-- Documentation/translations/zh_TW/index.rst | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index ded49b8e9bf6..62cd0e472b3b 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -563,13 +563,18 @@ latex_elements['preamble'] +=3D ''' % Custom macros to on/off CJK (Dummy) \\newcommand{\\kerneldocCJKon}{} \\newcommand{\\kerneldocCJKoff}{} - \\newcommand{\\kerneldocBeginSC}{} + \\newcommand{\\kerneldocBeginSC}[1]{% + \\begin{sphinxadmonition}{note}{Note:} + ``Noto Sans CJK'' fonts are not found while building this PDF\\@. + Translations of zh\\_CN, zh\\_TW, ko\\_KR, and ja\\_JP are + skipped. + \\end{sphinxadmonition}} \\newcommand{\\kerneldocEndSC}{} - \\newcommand{\\kerneldocBeginTC}{} + \\newcommand{\\kerneldocBeginTC}[1]{} \\newcommand{\\kerneldocEndTC}{} - \\newcommand{\\kerneldocBeginKR}{} + \\newcommand{\\kerneldocBeginKR}[1]{} \\newcommand{\\kerneldocEndKR}{} - \\newcommand{\\kerneldocBeginJP}{} + \\newcommand{\\kerneldocBeginJP}[1]{} \\newcommand{\\kerneldocEndJP}{} } ''' diff --git a/Documentation/translations/ja_JP/index.rst b/Documentation/tra= nslations/ja_JP/index.rst index 88d4d98eed15..20738c931d02 100644 --- a/Documentation/translations/ja_JP/index.rst +++ b/Documentation/translations/ja_JP/index.rst @@ -3,7 +3,7 @@ \renewcommand\thesection* \renewcommand\thesubsection* \kerneldocCJKon - \kerneldocBeginJP + \kerneldocBeginJP{ =20 Japanese translations =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -15,4 +15,4 @@ Japanese translations =20 .. raw:: latex =20 - \kerneldocEndJP + }\kerneldocEndJP diff --git a/Documentation/translations/ko_KR/index.rst b/Documentation/tra= nslations/ko_KR/index.rst index f636b482fb4c..4add6b2fe1f2 100644 --- a/Documentation/translations/ko_KR/index.rst +++ b/Documentation/translations/ko_KR/index.rst @@ -3,7 +3,7 @@ \renewcommand\thesection* \renewcommand\thesubsection* \kerneldocCJKon - \kerneldocBeginKR + \kerneldocBeginKR{ =20 =ED=95=9C=EA=B5=AD=EC=96=B4 =EB=B2=88=EC=97=AD =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -26,5 +26,4 @@ =20 .. raw:: latex =20 - \normalsize - \kerneldocEndKR + }\kerneldocEndKR diff --git a/Documentation/translations/zh_CN/index.rst b/Documentation/tra= nslations/zh_CN/index.rst index 46e14ec9963d..3d8e130a5a92 100644 --- a/Documentation/translations/zh_CN/index.rst +++ b/Documentation/translations/zh_CN/index.rst @@ -5,7 +5,7 @@ \renewcommand\thesection* \renewcommand\thesubsection* \kerneldocCJKon - \kerneldocBeginSC + \kerneldocBeginSC{ =20 .. _linux_doc_zh: =20 @@ -198,4 +198,4 @@ TODOList: =20 .. raw:: latex =20 - \kerneldocEndSC + }\kerneldocEndSC diff --git a/Documentation/translations/zh_TW/index.rst b/Documentation/tra= nslations/zh_TW/index.rst index f56f78ba7860..e1ce9d8c06f8 100644 --- a/Documentation/translations/zh_TW/index.rst +++ b/Documentation/translations/zh_TW/index.rst @@ -5,7 +5,7 @@ \renewcommand\thesection* \renewcommand\thesubsection* \kerneldocCJKon - \kerneldocBeginTC + \kerneldocBeginTC{ =20 .. _linux_doc_zh_tw: =20 @@ -174,4 +174,4 @@ TODOList: =20 .. raw:: latex =20 - \kerneldocEndTC + }\kerneldocEndTC --=20 2.17.1 From nobody Mon Jun 29 23:25:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39E03C433F5 for ; Tue, 1 Feb 2022 00:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230053AbiBAAFp (ORCPT ); Mon, 31 Jan 2022 19:05:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiBAAFo (ORCPT ); Mon, 31 Jan 2022 19:05:44 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C95C061714; Mon, 31 Jan 2022 16:05:44 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id 192so14303900pfz.3; Mon, 31 Jan 2022 16:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=GLOHoY1dKulHTeMDIa0XS5wbWpIlVfyrhIiTKyT03qg=; b=q13L8wwtqt32L9uGLqVXs2KNtcJGVvTB6VKIKNcAoCOmWkgxB1MB+wCnu3POczUwXu I8DOk85GMeAOq1Sgr4iAk1hPOJ7De8neoCHDCJh/6l1lYnZ5bCqQvL9tqsoKL5IVFaxA eZq6531/CB5WRIkmfm1u9xsRAX4edqKg93PqzDrm+zlTKcr9A9dJ2Q0tWjRieFhIxIAE qsG+BNgW69TnFeO9m+b0BVGIYWbn13sCRmgItldelS95cCK//y405GalDzIZRdSadtIW jMMlMUOm3p8dU14iZAxtZxgC2yW5u0gZrGbTUQbJroX5l2FNI7QZfG6P8O0JkTlL5A+Q 9QGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=GLOHoY1dKulHTeMDIa0XS5wbWpIlVfyrhIiTKyT03qg=; b=CwataCMMWyh8NRdLzprPYTXFSeVMsQMO3ngtaAgxbzGQ6c9QqBpAU4lnXiflaR3WfR jryCJI1E97511LzYJIiyLjqT/xEw1SRDP3lFbovnssDZzpL4tBbEEUMWJw9qzsTW628+ 9Uky4ycqkdbBc1SCoJC8A+b1t6cEqwaW9Zdv31nd+oerhBiaNcyVe3WNXXS7lt3jn6Pd PYv4CK/M9/kMF2TgXBt/9yyr8VOXYdYZZhj1p8e8zK1ELz4xutncYLA4UsKLoxYyyTyf N7KFapleAoQJR4FsvToj/wC/OuEl4oZBryDggwklusYKTHVUuC3Gxl+CS4L3+n42MdXi TDAA== X-Gm-Message-State: AOAM530lYScyvPkUV8xj6QSMR64l7xhJ/q+UjwJeT9PDmvc2b/qg2lAF GrjTJhHsXGI1nHMGWDOWDhI= X-Google-Smtp-Source: ABdhPJxSdamC98Zh+YnclIb1u+vrcJxU9V4blRZhMAhtigz4WcS96lW2O+vzJ7L0dvnvR/NanR/CYQ== X-Received: by 2002:a62:3303:: with SMTP id z3mr22193512pfz.54.1643673943707; Mon, 31 Jan 2022 16:05:43 -0800 (PST) Received: from [192.168.11.5] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id k3sm20828742pfu.180.2022.01.31.16.05.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Jan 2022 16:05:43 -0800 (PST) Message-ID: Date: Tue, 1 Feb 2022 09:05:40 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: [PATCH 5/5] docs: pdfdocs: Move CJK monospace font setting to main conf.py Content-Language: en-US To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: From: Akira Yokosawa In-Reply-To: Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" As LaTeX macros for CJK font settings can have Latin-script font settings as well, settings under Documentation/translations/ can be moved to the main conf.py. By this change, translations.pdf built by top-level "make pdfdocs" can have properly aligned ascii-art diagrams except for Korean ones. For the reason of remaining misalignment in Korean diagrams, see changelog of commit a90dad8f610a ("docs: pdfdocs: Add conf.py local to translations for ascii-art alignment"). Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet --- Documentation/conf.py | 8 ++++++++ Documentation/translations/conf.py | 12 ------------ 2 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 Documentation/translations/conf.py diff --git a/Documentation/conf.py b/Documentation/conf.py index 62cd0e472b3b..fb8f69fc4d38 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -521,6 +521,8 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKsfdefault}{SCsans}% \\renewcommand{\\CJKttdefault}{SCmono}% \\xeCJKsetup{CJKspace =3D false}% + % For CJK ascii-art alignment + \\setmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant]% } \\newcommand{\\kerneldocEndSC}{\\endgroup} \\newcommand{\\kerneldocBeginTC}{% @@ -532,6 +534,8 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKsfdefault}{TCsans}% \\renewcommand{\\CJKttdefault}{TCmono}% \\xeCJKsetup{CJKspace =3D false}% + % For CJK ascii-art alignment + \\setmonofont{Noto Sans Mono CJK TC}[AutoFakeSlant]% } \\newcommand{\\kerneldocEndTC}{\\endgroup} \\newcommand{\\kerneldocBeginKR}{% @@ -541,6 +545,8 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKsfdefault}{KRsans}% \\renewcommand{\\CJKttdefault}{KRmono}% % \\xeCJKsetup{CJKspace =3D true} % true by default + % For CJK ascii-art alignment (still misaligned for Hangul) + \\setmonofont{Noto Sans Mono CJK KR}[AutoFakeSlant]% } \\newcommand{\\kerneldocEndKR}{\\endgroup} \\newcommand{\\kerneldocBeginJP}{% @@ -550,6 +556,8 @@ latex_elements['preamble'] +=3D ''' \\renewcommand{\\CJKsfdefault}{JPsans}% \\renewcommand{\\CJKttdefault}{JPmono}% \\xeCJKsetup{CJKspace =3D false}% + % For CJK ascii-art alignment + \\setmonofont{Noto Sans Mono CJK JP}[AutoFakeSlant]% } \\newcommand{\\kerneldocEndJP}{\\endgroup} % Single spacing in literal blocks diff --git a/Documentation/translations/conf.py b/Documentation/translation= s/conf.py deleted file mode 100644 index 92cdbba74229..000000000000 --- a/Documentation/translations/conf.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# SPDX-License-Identifier: GPL-2.0 - -# -- Additinal options for LaTeX output ---------------------------------- -# font config for ascii-art alignment - -latex_elements['preamble'] +=3D ''' - \\IfFontExistsTF{Noto Sans CJK SC}{ - % For CJK ascii-art alignment - \\setmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant] - }{} -''' --=20 2.17.1