sphinx-doc / sphinx-doc/sphinx

LaTeX: background gray in PDF code-blocks has a lesser contrast for ``xelatex`` with non-highlighted tokens

Open
#11,269 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

builder:latex help wanted
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Example with 'xelatex' for latex_engine:
Capture d’écran 2023-03-29 à 09 47 59

Same with default 'pdflatex':
Capture d’écran 2023-03-29 à 09 47 30

The choice of default background gray was done with testing with pdflatex. If testing with xelatex, it could have been chosen possibly even lighter.

But this issue is mainly applying to the few non highlighted tokens.

It is a font issue, the one used for xelatex/lualatex is thinner than the one used for pdflatex. It may also be compounded with a PDF viewer anti-aliasing effect, for these thin glyphs on colored background.

How to Reproduce

Any project with code-blocks

Environment Information
Sphinx 6.1.3
Sphinx extensions

No response

Additional context

LaTeX installation from TeXLive 2023.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in any project with code blocks using Sphinx 6.1.3 and TeXLive 2023, comparing xelatex with pdflatex. Investigate the generated PDF background and non-highlighted tokens; done means improved contrast for xelatex/lualatex without regressing the pdflatex output.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.