brechtm / rinohtype

The Python document processor
http://www.mos6581.org/rinohtype
GNU Affero General Public License v3.0
499 stars 59 forks source link

item too long to fit on line is stuck without any progress #351

Open sachin-suresh-rapyuta opened 2 years ago

sachin-suresh-rapyuta commented 2 years ago

Is there an existing issue for this?

Sphinx or rinoh output

rinohtype 0.5.4 (2022-06-17)  Copyright (c) Brecht Machiels and contributors
This program comes with ABSOLUTELY NO WARRANTY. Its use is subject
to the terms of the GNU Affero General Public License version 3.
rendering... 
TeX Gyre Pagella does not include a normal medium upright font. Falling back to normal regular upright
item too long to fit on line (page 4)         ] ETA 00:26 (00:00) page 4
item too long to fit on line (page 12)        ] ETA 00:35 (00:01) page 11
item too long to fit on line (page 13)
item too long to fit on line (page 15)        ] ETA 00:35 (00:02) page 15
item too long to fit on line (page 20)        ] ETA 00:38 (00:02) page 20
item too long to fit on line (page 21)
item too long to fit on line (page 23)
item too long to fit on line (page 24)
item too long to fit on line (page 25)
item too long to fit on line (page 31)        ] ETA 00:30 (00:04) page 31
item too long to fit on line (page 32)
 14% [=====                                   ] ETA 00:28 (00:04) page 36

$ 

Source files

In conf.py file, on using the below config, and when I run the command: sphinx-build -b rinoh source build/rinoh, the message - "item too long to fit on line" hangs indefinitely and doesn't progress.

rinoh_documents = [dict(doc='index',        
                       target='pa-amr-specification-doc',
                        template='rinohtype.rtt',
                        logo='_static/rr-logo-vertical2022-1100px-transp.png')]

Versions

$ sphinx-build --version
sphinx-build 4.5.0

$ python --version
Python 3.8.10
brechtm commented 2 years ago

Do you mean that the rendering ends up in an endless loop?

Note that, as the new issue form mentions, I cannot debug this without having access to your Sphinx project or a minimal example reproducing the issue.

sachin-suresh-rapyuta commented 2 years ago

Yes, as you can see from the output screenshot, the pdf generation is stuck at 14% and I don't know where or which .rst file it is pointing to to correct the "item too long" message. Here is the link of the project: project link docs folder

brechtm commented 2 years ago

There are several things in your document that cause the rendering loop to get stuck:

  1. You are running into bug #283, triggered by _fuzzy_pattern_withoutborder.png and other tall images. Scaling these down works around this problem:

    .. figure:: ./images/getting_started/map_creation_checklist/fuzzy_pattern_without_border.png
      :scale: 50%
      ...

    This is a high-priority bug, but I'm not sure when I'll be able to fix it.

  2. rinohtype is not yet able to split table cells across two pages. This also leads to an infinite rendering loop when the contents of a cell do not fit on a page. For example, the Comparison between Full-fledged WCS vs Minimalistic WCS table triggers this issue. Removing the :widths: option happens to make the contents fit. There are however other tables (often containing images) in the document that trigger this bug.

    This is also an important bug, but you should ask yourself whether tables are the best choice for that kind of content. Do you really want table cells that span multiple pages?

Some general remarks about your document that occurred to me when trying to debug this: