Skip to content

Give listing digit 1 a heavier base so it is not mistaken for l - #59

Open
frex-e wants to merge 2 commits into
mainfrom
cursor/distinguish-one-and-ell-844d
Open

Give listing digit 1 a heavier base so it is not mistaken for l#59
frex-e wants to merge 2 commits into
mainfrom
cursor/distinguish-one-and-ell-844d

Conversation

@frex-e

@frex-e frex-e commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Courier's 1 and l are too similar at footnotesize in the 3-column notebook, even with syntax colour (green literals vs black identifiers). That is a real mistype risk when copying code in contest (1LL vs ll, a[1] vs a[l], f1 vs fl).

This uses the same listings literate mechanism already used to fatten {}. Digit 1 is drawn in bold Courier with a wide overlapping base, so it cannot be read as a stick. Letter l is left alone: replacing it would split keywords (long, class, else, …) and recolor identifier letters.

Colour is inherited, so numeric 1 stays green. Italic comments (commentstyle is roman italic) skip the substitution, because 1/l are already distinct there.

Verified: full PDF still 30 pages (same as main's sty on current content); ll glyphs are byte-identical; 1LL in Floyd–Warshall is clearly heavier. PDF is not committed.

Floyd–Warshall listing after
1LL before vs after

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 28, 2026 05:31
Courier's 1/l serifs are too subtle at footnotesize, even with colour.
Literate-replace only the digit (replacing l would split keywords).

Co-authored-by: IndraK <frex-e@users.noreply.github.com>
The first pass only thickened Courier's existing foot; at footnotesize
that was a few pixels and still read as a stick. Bold plus a 0.55em
slab is obvious next to thin l, including on a B&W print. Non-typewriter
(commentstyle) keeps the italic roman 1.

Co-authored-by: IndraK <frex-e@users.noreply.github.com>
@frex-e
frex-e marked this pull request as ready for review August 28, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants