Note prevents a section to be moved to the next page

28 views
Skip to first unread message

Josué Andrade Gomes

unread,
Jun 3, 2019, 8:04:37 PM6/3/19
to sphinx-users
Sphinx 2.0.1, latex target

If the first element in a section is a note and the section is near the end of the page the section title is not moved to the next page.

See screenshots

The note is the first element

note-1st.png


Normal paragraph is the first element

par-1st.png


Is this a Sphinx bug? Or a missing configuration?

Attached conf.py and index.rst

Thanks and regards,
josue


conf.py
index.rst

jfbu

unread,
Jun 4, 2019, 4:32:04 AM6/4/19
to sphinx...@googlegroups.com
Hi Josué,

Le 04/06/2019 à 02:04, Josué Andrade Gomes a écrit :
> Sphinx 2.0.1, latex target
>
> If the first element in a section is a note and the section is near the end of the page the section title is not moved to the next page.
>
> See screenshots
>
> The note is the first element
>
> note-1st.png
>
>
> Normal paragraph is the first element
>
> par-1st.png
>
>
> Is this a Sphinx bug? Or a missing configuration?

Yes it appears to be a bug of Sphinx LaTeX code.

It contains an `\allowbreak` causing this.

I presume the intent was to let TeX preferentially break the page right before the "note" frame (and note after the top line which is added above the note contents), but it causes the problem you report after a section title, and afaict it is in fact unneeded in other contexts.

Can you please open a ticket at https://github.com/sphinx-doc/sphinx/issues ? This will get fixed for next release.

On the positive side, the _heavy style_ admonitions warning, caution, error, danger, attention do not exhibit the same problem. This is only a bug of note, hint, important and tip (in the default implementation done by Sphinx LaTeX).


Thanks for reporting,

Unrelated : your conf.py contains language = '1.0' which is wrong configuration setting. Is this intentional?

Jean-François

>
> Attached conf.py and index.rst
>
> Thanks and regards,
> josue
>
>
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com <mailto:sphinx-users...@googlegroups.com>.
> To post to this group, send email to sphinx...@googlegroups.com <mailto:sphinx...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/sphinx-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/d4d82967-116c-45a6-9bf6-963fd5c79c8e%40googlegroups.com <https://groups.google.com/d/msgid/sphinx-users/d4d82967-116c-45a6-9bf6-963fd5c79c8e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


jfbu

unread,
Jun 4, 2019, 4:41:28 AM6/4/19
to sphinx...@googlegroups.com
Le 04/06/2019 à 02:04, Josué Andrade Gomes a écrit :
> Is this a Sphinx bug? Or a missing configuration?
>
forgot to say that if you need an immediate fix you can add this to conf.py

latex_elements = {
'preamble' : r'''
\usepackage{etoolbox}
\patchcmd{\sphinxlightbox}{\allowbreak}{}{}
''',
}



Josué Andrade Gomes

unread,
Jun 4, 2019, 7:14:34 AM6/4/19
to sphinx-users
Hi,

Thank you for your prompt reply.

I submitted a issue. Please see it at: https://github.com/sphinx-doc/sphinx/issues/6442

I can confirm the workaround works.

> Unrelated : your conf.py contains language = '1.0' which is wrong configuration setting. Is this intentional?

This is a leftover from a previous test with version 1.
But I did a clean test with version 2.0.1 and the issue is the same.

Thank you and regards,
josué


jfbu

unread,
Jun 4, 2019, 8:18:33 AM6/4/19
to sphinx...@googlegroups.com
Le 04/06/2019 à 13:14, Josué Andrade Gomes a écrit :
> > Em terça-feira, 4 de junho de 2019 05:41:28 UTC-3, jfbu escreveu:
> >
> >     Le 04/06/2019 à 02:04, Josué Andrade Gomes a écrit :
> >     > Is this a Sphinx bug? Or a missing configuration?
> >     >
> >     forgot to say that if you need an immediate fix you can add this to conf.py
> >
> >     latex_elements = {
> >          'preamble' : r'''
> >     \usepackage{etoolbox}
> >     \patchcmd{\sphinxlightbox}{\allowbreak}{}{}
> >     ''',
> >     }
>
>
> Hi,
>
> Thank you for your prompt reply.
>
> I submitted a issue. Please see it at: https://github.com/sphinx-doc/sphinx/issues/6442

Hi,

thanks for creating ticket,


see

https://github.com/sphinx-doc/sphinx/pull/6443

for fix
>
> I can confirm the workaround works.

ok,

>
> > Unrelated : your conf.py contains language = '1.0' which is wrong configuration setting. Is this intentional?
>
> This is a leftover from a previous test with version 1.
> But I did a clean test with version 2.0.1 and the issue is the same.

ok,

Best

Jean-François

>
> Thank you and regards,
> josué
>
>
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com <mailto:sphinx-users...@googlegroups.com>.
> To post to this group, send email to sphinx...@googlegroups.com <mailto:sphinx...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/sphinx-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/2a1eb147-8d33-4226-8009-35563b53ab58%40googlegroups.com <https://groups.google.com/d/msgid/sphinx-users/2a1eb147-8d33-4226-8009-35563b53ab58%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages