linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "Linux Doc Mailing List" <linux-doc@vger.kernel.org>,
	linux-kernel@vger.kernel.org, "Vlastimil Babka" <vbabka@suse.cz>,
	dri-devel@lists.freedesktop.org,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pragat Pandya" <pragat.pandya@gmail.com>,
	"Joel Fernandes (Google)" <joel@joelfernandes.org>,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"Phong Tran" <tranmanphong@gmail.com>,
	"Patrick Bellasi" <patrick.bellasi@arm.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Harald Seiler" <hws@denx.de>, "David Airlie" <airlied@linux.ie>,
	"Stephen Kitt" <steve@sk2.org>,
	"Ricardo Cañuelo" <ricardo.canuelo@collabora.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Daniel Jordan" <daniel.m.jordan@oracle.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Nitin Gupta" <nigupta@nvidia.com>,
	"Peter Collingbourne" <pcc@google.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	linux-mm@kvack.org,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
	"Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Harry Wei" <harryxiyou@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Mike Leach" <mike.leach@linaro.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	"Alex Shi" <alex.shi@linux.alibaba.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	"Jason Gunthorpe" <jgg@ziepe.ca>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Sami Tolvanen" <samitolvanen@google.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Will Deacon" <will@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	devicetree@vger.kernel.org, "Mike Rapoport" <rppt@linux.ibm.com>,
	"Daniel Vetter" <daniel@ffwll.ch>
Subject: Re: [PATCH v3 0/7] Convert the remaining text files to ReST
Date: Sun, 28 Jun 2020 10:40:11 +0200	[thread overview]
Message-ID: <20200628104011.7f7e8814@coco.lan> (raw)
In-Reply-To: <20200626113459.413c3843@lwn.net>

Em Fri, 26 Jun 2020 11:34:59 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> On Tue, 23 Jun 2020 15:31:33 +0200
> Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:
> 
> > The main goal of this series is to finish the ReST conversion. After this
> > series, we have just those files still in plain old format:
> > 
> > 	- Documentation/RCU/RTFP.txt
> > 	- Documentation/atomic_bitops.txt
> > 	- Documentation/memory-barriers.txt
> > 	- Documentation/atomic_t.txt
> > 	- Documentation/filesystems/dax.txt
> > 	- Documentation/filesystems/path-lookup.txt
> > 	- Documentation/virt/kvm/devices/README  
> 
> OK, I've applied this set - glad to see the last one!

Yeah! we can now focus on keeping it updated and re-organizing
things, for the docs to look more like a real book.

> Still *not* glad to see the LaTeX markup in the staging stuff; hopefully
> we can do something about that soon.

Agreed.

The problem here is that, using the normal sized monospaced font, the maximum
line width will be 67 columns[1]. The way Sphinx deals with mono-spaced
texts is that it doesn't allow LaTeX to split lines. So, Sphinx sets LaTeX to
truncate long lines, forcing it to honor the line breaks generated by Sphinx.

At least newer versions of Sphinx have an optimization the LaTeX output
code: on some cases Sphinx detect long lines and adds an artificial line
break, preceded by a markup to indicate that the text would be otherwise
truncated at the LaTeX output. Yet, if it is a single long word, it will
just let it go past the margins and be truncated.

For the files under staging, using this optimization will look really 
weird, as the text output would be (with the enclosed path, meant to
show the soft and hard line size limits)[2]:


	"         1         2         3         4         5         6       ␣
	 →   7         8
	 12345678901234567890123456789012345678901234567890123456789012345678901234567890
	 →text here

	 On atomic types (atomic_t atomic64_t and atomic_long_t).

	 The atomic type provides an interface to the architecture's means␣
	 → of atomic
	 RMW operations between CPUs (atomic operations on MMIO are not␣
	 → supported and
	 can lead to fatal traps on some platforms)."

What the LaTeX raw macro does is to use a smaller font that will allow 
an 80-columns text to fit without those artificial breaks. I had to
manually check what font size would work, and this might require 
future changes, if Sphinx changes the default mono-spaced font or
its default size.

For the documents on staging, the solution is really simple from
technical standpoint: just convert them to ReST. This would allow 
Sphinx to use a proportional spaced font most of the time, which
passes texts in paragraphs to LaTeX. This way, the line breaks 
will be at the right places.

I remember I tried doing it a few times, but there were strong 
resistance.

It could be possible to do some tricks at the conf.py to change
some defaults, but anyone willing to do that will also need to 
test the PDF output with all supported Sphinx versions,
as the LaTeX output macros is not an stable API: we had to add
several version-dependent stuff there, and even remove some
features (like /resizebox for tables with many columns), as
maintaining it was spending too much time and efforts.

-

[1] If you want to check, try building with the enclosed patch.

[2] The output of the second line from the file shows some artifacts
    introduced: 

    - the word "some" disappeared, as it was truncated at the output;
    - the last "0" was half-truncated;
    - the symbol indicating that a conditional line would exist
      ("␣") was also truncated.


Thanks,
Mauro

-

diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt
index 0f1fdedf36bb..9488c35ec608 100644
--- a/Documentation/atomic_t.txt
+++ b/Documentation/atomic_t.txt
@@ -1,3 +1,5 @@
+         1         2         3         4         5         6         7         8
+12345678901234567890123456789012345678901234567890123456789012345678901234567890some text here
 
 On atomic types (atomic_t atomic64_t and atomic_long_t).
 
diff --git a/Documentation/staging/index.rst b/Documentation/staging/index.rst
index 184e6aece0a7..0c3acf27e1ff 100644
--- a/Documentation/staging/index.rst
+++ b/Documentation/staging/index.rst
@@ -19,17 +19,9 @@ Unsorted Documentation
 Atomic Types
 ============
 
-.. raw:: latex
-
-    \footnotesize
-
 .. include:: ../atomic_t.txt
    :literal:
 
-.. raw:: latex
-
-    \normalsize
-
 Atomic bitops
 =============
 



      reply	other threads:[~2020-06-28  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 13:31 Mauro Carvalho Chehab
2020-06-23 13:31 ` [PATCH v3 3/7] docs: move nommu-mmap.txt to admin-guide and rename " Mauro Carvalho Chehab
2020-06-26 17:34 ` [PATCH v3 0/7] Convert the remaining text files " Jonathan Corbet
2020-06-28  8:40   ` Mauro Carvalho Chehab [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=20200628104011.7f7e8814@coco.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=alex@ghiti.fr \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=bigeasy@linutronix.de \
    --cc=corbet@lwn.net \
    --cc=daniel.m.jordan@oracle.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ebiederm@xmission.com \
    --cc=frank@generalsoftwareinc.com \
    --cc=hannes@cmpxchg.org \
    --cc=harryxiyou@gmail.com \
    --cc=hws@denx.de \
    --cc=j.neuschaefer@gmx.net \
    --cc=jgg@ziepe.ca \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=krzk@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=masahiroy@kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mhiramat@kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=mripard@kernel.org \
    --cc=nigupta@nvidia.com \
    --cc=patrick.bellasi@arm.com \
    --cc=pcc@google.com \
    --cc=peterz@infradead.org \
    --cc=pragat.pandya@gmail.com \
    --cc=ricardo.canuelo@collabora.com \
    --cc=robh+dt@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rppt@linux.ibm.com \
    --cc=samitolvanen@google.com \
    --cc=sboyd@kernel.org \
    --cc=steve@sk2.org \
    --cc=tglx@linutronix.de \
    --cc=tranmanphong@gmail.com \
    --cc=tzimmermann@suse.de \
    --cc=vbabka@suse.cz \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=yamada.masahiro@socionext.com \
    /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