linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: pdfdocs: Prevent column squeezing by tabulary
@ 2021-05-29 15:19 Akira Yokosawa
  2021-06-01 22:50 ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Akira Yokosawa @ 2021-05-29 15:19 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab
  Cc: Wu X.C., linux-doc, linux-kernel, Akira Yokosawa

Setting a reasonable width to \tymin prevents column squeezing
by tabulary.
Width of 20em works well in almost all the tables still in the
ascii-art format.

Excerpt from tabulary package documentation at [1]:

    To stop very narrow columns being too 'squeezed' by this process
    any columns that are narrower than \tymin are set to their natural
    width.

[1]: https://mirrors.ctan.org/macros/latex/contrib/tabulary/tabulary.pdf

Note: Sphinx has its own default value of \tymin set in
sphinxlatextables.sty (Sphinx 4.0.2) and sphinxmulticell.sty
(Sphinx 2.4.4) as follows:

    \setlength{\tymin}{3\fontcharwd\font`0 }

, which is not sufficient for kernel-doc.

Tested against Sphinx versions 2.4.4 and 4.0.2.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
---
Hi all,

This is another attempt to improve pdfdocs output.
As far as I see, I don't see any obvious regression by
this change.

The effect of this change can be seen in (not limited to)
the MODULE_LICENSE section in process.pdf (pages 10 and 11).

I'd like to know this change looks reasonable to you.

Any feedback is welcome!

        Thanks, Akira

--
 Documentation/conf.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 25aa00c707b0..a05225056e08 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -353,6 +353,8 @@ latex_elements = {
 
     # Additional stuff for the LaTeX preamble.
     'preamble': '''
+	% Prevent column squeezing of tabulary.
+	\\setlength{\\tymin}{20em}
         % Use some font with UTF-8 support with XeLaTeX
         \\usepackage{fontspec}
         \\setsansfont{DejaVu Sans}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: pdfdocs: Prevent column squeezing by tabulary
  2021-05-29 15:19 [PATCH] docs: pdfdocs: Prevent column squeezing by tabulary Akira Yokosawa
@ 2021-06-01 22:50 ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2021-06-01 22:50 UTC (permalink / raw)
  To: Akira Yokosawa, Mauro Carvalho Chehab
  Cc: Wu X.C., linux-doc, linux-kernel, Akira Yokosawa

Akira Yokosawa <akiyks@gmail.com> writes:

> Setting a reasonable width to \tymin prevents column squeezing
> by tabulary.
> Width of 20em works well in almost all the tables still in the
> ascii-art format.
>
> Excerpt from tabulary package documentation at [1]:
>
>     To stop very narrow columns being too 'squeezed' by this process
>     any columns that are narrower than \tymin are set to their natural
>     width.
>
> [1]: https://mirrors.ctan.org/macros/latex/contrib/tabulary/tabulary.pdf
>
> Note: Sphinx has its own default value of \tymin set in
> sphinxlatextables.sty (Sphinx 4.0.2) and sphinxmulticell.sty
> (Sphinx 2.4.4) as follows:
>
>     \setlength{\tymin}{3\fontcharwd\font`0 }
>
> , which is not sufficient for kernel-doc.
>
> Tested against Sphinx versions 2.4.4 and 4.0.2.
>
> Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
> ---
> Hi all,
>
> This is another attempt to improve pdfdocs output.
> As far as I see, I don't see any obvious regression by
> this change.
>
> The effect of this change can be seen in (not limited to)
> the MODULE_LICENSE section in process.pdf (pages 10 and 11).
>
> I'd like to know this change looks reasonable to you.
>
> Any feedback is welcome!
>
>         Thanks, Akira
>
> --
>  Documentation/conf.py | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-01 22:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 15:19 [PATCH] docs: pdfdocs: Prevent column squeezing by tabulary Akira Yokosawa
2021-06-01 22:50 ` Jonathan Corbet

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).