Skip to content

Conversation

@davidmerfield
Copy link
Owner

@davidmerfield davidmerfield commented Nov 24, 2025

  • tell omar

Summary

  • update the TeX formatting guide to note single-dollar inline math as the default and reserve double dollars for display blocks

Testing

  • not run (not requested)

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +51 to +54
if (isDigit(text.charAt(i - 1)) || isDigit(text.charAt(i + 1))) {
result += text.charAt(i);
i++;
continue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Permit inline math that starts with digits

The inline parser short-circuits whenever a $ is immediately next to a digit (lines 51-54), so expressions like $2x$ are treated as literal text and never sent through KaTeX. This defeats the new single-dollar inline support for any formula that begins with a numeric coefficient—a common pattern in math—and require("./katex")("Example $2x$ inline.") currently returns the unrendered string.

Useful? React with 👍 / 👎.

Comment on lines +86 to +88
if (isDigit(text.charAt(index - 1)) || isDigit(text.charAt(index + delimiter.length))) {
index += delimiter.length;
continue;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat inline math ending in digits as valid

The closing delimiter search skips any $ with a digit immediately before or after it (lines 86-88). As a result, inline expressions that end with numbers—such as $a^2$, $x_1$, or $b^2 + c^2$ from the new example—never find a closing delimiter and are left unrendered. Inline math containing numeric exponents or indices is therefore broken unless a non-digit trails the final $.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants