MathJax 4, and diagram colours written in LaTeX both engines agree on - #1
Open
pyramation wants to merge 2 commits into
Open
MathJax 4, and diagram colours written in LaTeX both engines agree on#1pyramation wants to merge 2 commits into
pyramation wants to merge 2 commits into
Conversation
The arrow demos on both pages named colours that mean different things in
LaTeX and in a browser, and one that LaTeX does not define at all — so the
snippets shown as source could not be compiled by a reader who copied them.
purple xcolor's purple is crimson (#BF0040); the colour the diagram
wants is xcolor's violet (#800080), which is also what CSS calls
purple. Renamed, so it draws the same shade in both engines.
lightblue a browser colour name. Real LaTeX rejects it outright:
`! Package xcolor Error: Undefined color 'lightblue'.`
Now declared with \definecolor{lightblue}{RGB}{173,216,230},
which names the exact same shade in a line LaTeX accepts.
Also fixes a typo carried in both the live picture and the listing beneath it:
`(0,0)(2,2)(sin(x)}{-y}` opened the head function with a paren instead of a
brace. The renderer tolerated it; LaTeX would not.
The verbatim listings are updated alongside the pictures they document, so a
reader copying from the page gets source that compiles.
Verified in both directions rather than by inspection. The snippet now
compiles through latex -> dvips -> ps2pdf -> gs with zero errors and draws the
intended colours; in the browser the strokes come out rgb(128,0,128) and
rgb(173,216,230), the exact colours the pages had before.
The bundle carries the MathJax 4.1.3 upgrade and the label-centring fix that
goes with it. Both pages were checked warm and on a cold load with the MathJax
fetch throttled: 33 and 50 formulas typeset, 25 and 49 labels, none off-centre,
no console errors.
Text is grouped into real paragraphs now rather than separated by one <br> per blank line, so the gap between them is a style the sheet can set — --latex2js-parskip — instead of however many times the author pressed return. A figure takes the same value, so a picture and a paragraph sit apart by the same amount. The stylesheet here was an older copy of the one in the package; it is brought up to date wholesale. The diff is additions only, so nothing site-specific was carried in it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things: the bundle moves to MathJax 4, and the arrow demos are rewritten in LaTeX a reader could actually compile.
The colours
The arrow demos named colours that mean different things in LaTeX and in a browser, and one LaTeX does not define at all — so the snippets shown as source could not be compiled by anyone who copied them.
purple#BF0040in xcolor#800080, which xcolor callsvioletlightblue! Package xcolor Error: Undefined color 'lightblue'.lightblueis now declared:\definecolor{lightblue}{RGB}{173,216,230}Same shade, in a line LaTeX accepts.
Also fixes a typo carried in both the live picture and the listing beneath it —
(0,0)(2,2)(sin(x)}{-y}opened the head function with a paren instead of a brace. The renderer tolerated it; LaTeX would not.The verbatim listings are updated alongside the pictures they document, so copying from the page gives source that compiles.
Verified both directions
latex → dvips → ps2pdf → gswith zero errors and draws the intended colours.rgb(128, 0, 128)andrgb(173, 216, 230)— the exact colours the pages had before.The bundle
Carries MathJax 4.1.3 and the
\rputlabel-centring fix that goes with it. v4 needed no config migration. Both pages checked warm and on a cold load with the MathJax fetch throttled to 900ms:/index.html/examples/index.htmlWorth knowing: v4's payload is larger, so on a genuinely cold connection labels stay hidden about 4s before appearing correctly (415ms warm). Adding
<link rel="preconnect" href="https://cdn.jsdelivr.net">to the<head>would claw some of that back — happy to add it if you want.🤖 Generated with Claude Code
https://claude.ai/code/session_01HBYcp3Go9naDWgFThChaDf