GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — html backend: persistent katex macros by dlesbre · Pull Request #1391 · ocaml/odoc

Conversation

@dlesbre

@dlesbre dlesbre commented Nov 18, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Previously, if you defined a macro using \gdef in a math block, that macro would only be scoped to that block in the HTML KaTeX render. This PR adds persistent macros, allowing you to reuse that same macro in all subsequent math blocks.

Locally scoped macros are still possible using the \def command.

This is in accordance to the KaTeX documentation on macros:

Macros defined by \gdef, \xdef, \global\def, \global\edef, \global\let, and \global\futurelet will persist between math expressions.

The solution I used here is explained in the KateX API documentation.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dlesbre added 3 commits November 18, 2025 10:13
@dlesbre
Persistent KaTeX macros
60b1b97
@dlesbre
Promote tests
e60f8c2
@dlesbre
Changelog
8398950
@jonludlam

jonludlam commented Nov 21, 2025

Copy link
Copy Markdown
Member

Thanks @dlesbre !

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jonludlam
jonludlam merged commit 40bae1e into ocaml:master Nov 21, 2025
10 of 11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

jonludlam added a commit to jonludlam/opam-repository that referenced this pull request May 1, 2026
@jonludlam
[new release] odoc (5 packages) (3.2.0)
af658c8
CHANGES:

- Allow persistent latex macros in HTML/KaTeX backend (@dlesbre, ocaml/odoc#1391)
- `markdown-generate` command now accepts multiple `.odocl` files in a single
  invocation, eliminating the need for shell scripting (@davesnx, ocaml/odoc#1387)
- Support for OxCaml (@lukemaurer, @art-w, ocaml/odoc#1399)
- OCaml 5.5.0 support (@panglesd, @xvw, ocaml/odoc#1406)

- Fix compile-time crashing bugs ocaml/odoc#930 and ocaml/odoc#1385 (@jonludlam, ocaml/odoc#1400)
- Markdown backend assumes ocaml as langId on declarations
- Markdown backend collects all code snippets and render a single code block with comments, rather than split the variants/records per constructor/field
- Fix URL remapping for page references (@jonludlam, ocaml/odoc#1395)
- Fix ocaml/odoc#1396, which broke incrememntal builds (@jonludlam, ocaml/odoc#1402)
- Ensure all warnings turn into errors with --warn-error (@jonludlam, ocaml/odoc#1402)
- Fix missing parentheses for polymorphic arguments (@art-w, ocaml/odoc#1404)
@jonludlam jonludlam mentioned this pull request May 1, 2026
[new release] odoc (5 packages) (3.2.0) ocaml/opam-repository#29834
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@dlesbre @jonludlam
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.