From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH v2 9/9] docs: staging: use small font for literal includes
Date: Wed, 24 Jun 2020 07:29:36 +0200 [thread overview]
Message-ID: <20200624072936.3700fae0@coco.lan> (raw)
In-Reply-To: <f47454785a47df6758625d52974753d1a519163d.camel@perches.com>
Em Tue, 23 Jun 2020 16:12:04 -0700
Joe Perches <joe@perches.com> escreveu:
> On Tue, 2020-06-23 at 11:53 +0200, Mauro Carvalho Chehab wrote:
> > The normal font is too big to display 80 columns, causing extra
> > breaks to be added at weird places.
> >
> > change to the footnotesize, as this would fit a little bit
> > better.
> []
> > diff --git a/Documentation/staging/index.rst b/Documentation/staging/index.rst
> []
> > @@ -19,14 +19,41 @@ Unsorted Documentation
> > Atomic Types
> > ============
> >
> > -.. literalinclude:: ../atomic_t.txt
> > +.. raw:: latex
> > +
> > + \footnotesize
> > +
> > +.. include:: ../atomic_t.txt
> > + :literal:
> > +
> > +.. raw:: latex
> > +
> > + \normalsize
>
> Is there something like push/pop for styles?
> Maybe some variant of include:: with a style?
Well, one could use, instead:
.. css-class:: some_footnote_class
Which should then require a "some_footnote_class" css file defined for
html output and a set of macros to be added at the "latex_elements"
section of conf.py.
If properly defined, I guess it should be possible to avoid the need
of returning to the normal size after using it.
This is easily said than done.
One of the problems with using such macros is that the macro
should be prepared to work not only with plain text but also with
more complex structures like tables or graphics.
We do need to use tricks like changing the font size on media docs,
in order to display tables with long lines. We have several of them
there, with bit mappings.
I tried a few times to play with that for PDF. I ended needing to
revert all such attempts[1]. The main problem playing with those is that
You'll end needing to play with the already defined macros found on
sphinx.sty, which is shipped together with Sphinx. The macros there
changed a lot over the time. Making something that would work with
different versions is really hard.
[1] I used those when I ported media docs from DocBook, but had to
drop several macros because version 1.7 broke the ones I defined.
On that time, I spent several days writing the first version, and,
when they broke, I spent a long time figuring out what would be the
best.
At the end, using the "raw:: latex" like the above was the only
thing that worked reliable among different Sphinx versions.
Thanks,
Mauro
next prev parent reply other threads:[~2020-06-24 5:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 9:52 [PATCH v2 0/9] Convert the remaining text files to ReST and add SPDX for GFDL Mauro Carvalho Chehab
2020-06-23 9:52 ` [PATCH v2 1/9] docs: dt: convert booting-without-of.txt to ReST format Mauro Carvalho Chehab
2020-06-23 9:52 ` [PATCH v2 2/9] LICENSES: add GFDL licenses Mauro Carvalho Chehab
2020-06-23 11:47 ` Kate Stewart
2020-06-23 9:52 ` [PATCH v2 4/9] docs: trace: ring-buffer-design.txt: convert to ReST format Mauro Carvalho Chehab
2020-06-23 9:52 ` [PATCH v2 5/9] docs: move nommu-mmap.txt to admin-guide and rename to ReST Mauro Carvalho Chehab
2020-06-23 15:56 ` Mike Rapoport
2020-06-23 9:52 ` [PATCH v2 6/9] docs: move mailbox.txt to driver-api and rename it Mauro Carvalho Chehab
2020-06-23 9:53 ` [PATCH v2 7/9] docs: move other kAPI documents to core-api Mauro Carvalho Chehab
2020-06-23 9:53 ` [PATCH v2 8/9] docs: Add remaining Documentation/*.txt at staging/index.rst Mauro Carvalho Chehab
2020-06-23 9:53 ` [PATCH v2 9/9] docs: staging: use small font for literal includes Mauro Carvalho Chehab
2020-06-23 23:12 ` Joe Perches
2020-06-24 5:29 ` Mauro Carvalho Chehab [this message]
2020-06-23 11:58 ` [PATCH v2 0/9] Convert the remaining text files to ReST and add SPDX for GFDL Kate Stewart
2020-06-23 13:37 ` Mauro Carvalho Chehab
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=20200624072936.3700fae0@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=corbet@lwn.net \
--cc=joe@perches.com \
--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;
as well as URLs for NNTP newsgroup(s).