Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX: partially fix color issues for wrapped code lines with pagebreak #10616

Merged
merged 1 commit into from Jun 29, 2022

Conversation

jfbu
Copy link
Contributor

@jfbu jfbu commented Jun 29, 2022

This does not fix entirely #10610 but it does sufficiently for it not to
require reverting #10577 which tried to solve #8686 conundrum. In
extreme cases, the #8686 problem meant that some contents disappeared
at page bottom, so it is probably better to maintain #10577 which
will avoid any such overflow of code beyond its frame, even though in
some specific cases (a colored entity such as a long string is partly on
both pages), some syntax highlighting gets lost.

There are anyhow other issues with colors for wrapped code lines, even
with no pagebreaks involved, such as #10615. This patch does not change
the situation there.

Prior to this patch (but after #10577):
Capture d’écran 2022-06-29 à 18 42 36

With this patch
Capture d’écran 2022-06-29 à 18 41 36

This patch does some change to private Sphinx LaTeX macro \spx@fcolorbox and \spx@CustomFBox.

There is no CHANGES entry because it fixes issues with #10577 which has been merged but not released yet.

test done with

Test
----


.. raw:: latex

   \vspace*{15cm}%\showoutput

.. code-block:: python

   A = [x for x in range(10)]
   print("a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line")
   A = [x for x in range(10)]


ABC

This does not fix entirely sphinx-doc#10610 but it does sufficiently for it not to
require reverting sphinx-doc#10577 which tried to solve sphinx-doc#8686 conundrum.  In
extreme cases, the sphinx-doc#8686 problem meant that some contents disappeared
at page bottom, so it is probably better to maintain sphinx-doc#10577 which
will avoid any such overflow of code beyond its frame, even though in
some specific cases (a colored entity such as a long string is partly on
both pages), some syntax highlighting gets lost.

There are anyhow other issues with colors for wrapped code lines, even
with no pagebreaks involved, such as sphinx-doc#10615.  This patch does not change
the situation there.
@jfbu
Copy link
Contributor Author

jfbu commented Jul 14, 2022

complete fix came with #10648

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant