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: color leaks for code-line inside a warning-type admonition since page-breaks can happen in the middle of wrapped highlighted code-lines #10650

Closed
jfbu opened this issue Jul 8, 2022 · 1 comment
Milestone

Comments

@jfbu
Copy link
Contributor

jfbu commented Jul 8, 2022

Describe the bug

This is a revival of #10615.

Here is an example (the emphasizing of the wrapped code line has no influence on this):

Capture d’écran 2022-07-08 à 14 15 56

Notice that the framing of the first part of the Danger notice has disappeared, and that on page 2 the string highlighting is gone.

How to Reproduce

Put near a pagebreak

* We can put code-blocks in nested lists

  - this is deeper

    1. let's go one more step

    2. let's go one more step

       - quite nested, I'll put the code-block directly in next item witout preceding text

       - .. danger:: A color leak is possible for a code-block inside a danger
            notice

            This is caused by usage of ``\fcolorbox`` and not yet of the Sphinx
            own sophisticated boxing, which LaTeX world envies us.

            .. code-block:: python
               :emphasize-lines: 2

               a = """This is some string"""
               b = """Since the epic fix of #8686, pagebreaks can occur even in the middle very long code line from the sources which are wrapped to not extend into the margin and there will be no color leak even in the middle of syntax highlighting; and even, the line can be emphasized, as here! (kudos to Sphinx LaTeX)"""
               c = """emphasized very long code line from the sources will be wrapped to not extend into the margin and there will be no color leak; to see this here one would need to move the box near bottom of page"""

Expected behavior

No color leaks

Your project

n/a

Screenshots

No response

OS

Mac

Python version

3.10.4

Sphinx version

5.x since fix of #8686 via #10577

Sphinx extensions

No response

Extra tools

No response

Additional context

The cause is simply that framing (of individual chunks) is done by \fcolorbox. The fix is easy as we have recently added to Sphinx a sophisticated enhancement of LaTeX's \fcolorbox which in particular solves this problem.

@jfbu jfbu added this to the 5.1.0 milestone Jul 8, 2022
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 8, 2022
@jfbu
Copy link
Contributor Author

jfbu commented Jul 8, 2022

Fixed in WIP #10648

Here is how it looks like now:
Capture d’écran 2022-07-08 à 14 38 21

jfbu added a commit to jfbu/sphinx that referenced this issue Jul 8, 2022
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 8, 2022
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 9, 2022
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii

- LaTeX: fix sphinx-doc#10650 via usage of our own sophisticated \fcolorbox

- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames

- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes

- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
  topics

- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
  (fix sphinx-doc#10651)

- LaTeX: documentation of the new CSS-like options
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 9, 2022
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii

- LaTeX: fix sphinx-doc#10650 via usage of our own sophisticated \fcolorbox

- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames

- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes

- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
  topics

- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
  (fix sphinx-doc#10651)

- LaTeX: documentation of the new CSS-like options
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 9, 2022
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii

- LaTeX: fix sphinx-doc#10650 via usage of our own sophisticated \fcolorbox

- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames

- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes

- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
  topics

- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
  (fix sphinx-doc#10651)

- LaTeX: documentation of the new CSS-like options
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 9, 2022
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii

- LaTeX: fix sphinx-doc#10650 via usage of our own sophisticated \fcolorbox

- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames

- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes

- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
  topics

- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
  (fix sphinx-doc#10651)

- LaTeX: documentation of the new CSS-like options
jfbu added a commit to jfbu/sphinx that referenced this issue Jul 10, 2022
- LaTeX: box padding (t,r,b,l), borders (t,r,b,l), shadows (x,y) or radii

- LaTeX: fix sphinx-doc#10650 via usage of our own sophisticated \fcolorbox

- LaTeX: user interface via 'sphinxsetup' to enhanced code-blocks frames

- LaTeX: user interface via 'sphinxsetup' to enhanced topic boxes

- LaTeX: CSS-named-alikes 'sphinxsetup' options for code-blocks and
  topics

- LaTeX: CSS-named-alikes 'sphinxsetup' keys for warning type notices
  (fix sphinx-doc#10651)

- LaTeX: documentation of the new CSS-like options
@jfbu jfbu closed this as completed in 64647ca Jul 14, 2022
@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

No branches or pull requests

1 participant