From: Akira Yokosawa <akiyks@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH 1/3] docs: pdfdocs: Pull LaTeX preamble part out of conf.py
Date: Sat, 26 Feb 2022 10:31:51 +0900 [thread overview]
Message-ID: <d70b88c0-037e-13fc-667b-de71bf4f0fde@gmail.com> (raw)
In-Reply-To: <875yp4kqka.fsf@meer.lwn.net>
On Thu, 24 Feb 2022 12:33:25 -0700,
Jonathan Corbet wrote:
> Akira Yokosawa <akiyks@gmail.com> writes:
>
>> Quote from Jon's remark [1]:
>>
>> I do notice that Documentation/conf.py is getting large and
>> unapproachable. At some future point, it might be nice to pull
>> all of the latex stuff out into a separate file where it won't
>> scare people who stumble into it by accident.
>>
>> Pull LaTeX preamble settings added since commit 3b4c963243b1 ("docs:
>> conf.py: adjust the LaTeX document output") out into
>> sphinx/kerneldoc-preamble.sty.
>>
>> It will be copied to the build directory by the added
>> "latex_additional_files" setting in conf.py.
>>
>> As a bonus, LaTeX/TeX code can be maintained without escaping backslashes.
>
> I've applied the set, thanks. Still testing the pdfdocs build (and will
> be for some time, naturally)
>
> One little note, since you mentioned the need for backslash escapes:
>
>> +# Load kerneldoc specific LaTeX settings
>> +latex_elements['preamble'] += '''
>> + % Load kerneldoc specific LaTeX settings
>> + \\input{kerneldoc-preamble.sty}
>> +'''
>
> You can avoid that problem in Python code with the use of raw strings:
>
> latex_elements['preamble'] += r'''
> % Load kerneldoc specific LaTeX settings
> \input{kerneldoc-preamble.sty}
> '''
>
> (note the "r" on the first line). Something for future reference.
Thank you for the tip.
It turns out that I unknowingly used a raw string in commit
77abc2c230b1 ("docs: pdfdocs: One-half spacing for CJK translations").
I think I copy-pasted an example from "extrapackages" key documentation.
Now I understand the use of raw string.
I will convert remaining LaTeX code in conf.py to raw string(s)
when I need to edit it in the future.
Thanks, Akira
>
> Thanks,
>
> jon
prev parent reply other threads:[~2022-02-26 1:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 14:11 [PATCH 1/3] docs: pdfdocs: Pull LaTeX preamble part out of conf.py Akira Yokosawa
2022-02-18 14:13 ` [PATCH 2/3] docs: kerneldoc-preamble.sty: Expand comments in LaTeX code Akira Yokosawa
2022-02-18 14:26 ` [PATCH 3/3] Reword note on missing CJK fonts Akira Yokosawa
2022-02-24 19:33 ` [PATCH 1/3] docs: pdfdocs: Pull LaTeX preamble part out of conf.py Jonathan Corbet
2022-02-26 1:31 ` 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=d70b88c0-037e-13fc-667b-de71bf4f0fde@gmail.com \
--to=akiyks@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.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