Skip to content

Fix LaTeX formatting for proper math rendering in report.md - #1

Merged
jserv merged 2 commits into
sysprog21:mainfrom
yenslife:patch-1
Sep 28, 2026
Merged

jserv merged 2 commits into
sysprog21:mainfrom
yenslife:patch-1

Conversation

@yenslife

@yenslife yenslife commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Updated LaTeX syntax in report.md so mathematical formulas render correctly in Markdown.


Summary by cubic

Fixes LaTeX formulas in report.md so they render correctly in Markdown.

  • Uses GitHub's backtick-delimited math syntax for inline math to avoid Markdown parser collisions.
  • Collapses multi-line $$ display math blocks into single-line formulas.
  • Indents display equations under their list items and corrects list numbering.

Written for commit a2a6e78. Summary will update on new commits.

Review in cubic

cubic-dev-ai[bot]

This comment was marked as resolved.

Updated LaTeX syntax in report.md so mathematical formulas render correctly in Markdown.

ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

You’re at about 94% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="report.md">

<violation number="1" location="report.md:172">
P3: These are the only two places in report.md that put spaces between the parentheses and the math (`( $...$ )`); every other inline-math-in-parentheses instance uses the tight `($...$)` style (lines 15, 51, 116, 137, 286). In standards-compliant renderers (GitHub, Pandoc/KaTeX) `($p \in [0, 7!)$)` already renders correctly, so the added spaces don't fix anything and instead render these items with extra widening, inconsistently with the rest of the doc. Revert both lines to the tight style, or widen all other math-in-parens instances for consistency.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread report.md Outdated
The state is encoded into a dense integer in the range $[0, 3{,}674{,}160)$ using two rank components:

1. Permutation Lehmer rank ($p \in [0, 7!)$), computed with the factoradic numeral system:
1. Permutation Lehmer rank ( $p \in [0, 7!)$ ), computed with the factoradic numeral system:

ghost Sep 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: These are the only two places in report.md that put spaces between the parentheses and the math (( $...$ )); every other inline-math-in-parentheses instance uses the tight ($...$) style (lines 15, 51, 116, 137, 286). In standards-compliant renderers (GitHub, Pandoc/KaTeX) ($p \in [0, 7!)$) already renders correctly, so the added spaces don't fix anything and instead render these items with extra widening, inconsistently with the rest of the doc. Revert both lines to the tight style, or widen all other math-in-parens instances for consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At report.md, line 172:

<comment>These are the only two places in report.md that put spaces between the parentheses and the math (`( $...$ )`); every other inline-math-in-parentheses instance uses the tight `($...$)` style (lines 15, 51, 116, 137, 286). In standards-compliant renderers (GitHub, Pandoc/KaTeX) `($p \in [0, 7!)$)` already renders correctly, so the added spaces don't fix anything and instead render these items with extra widening, inconsistently with the rest of the doc. Revert both lines to the tight style, or widen all other math-in-parens instances for consistency.</comment>

<file context>
@@ -169,13 +169,13 @@ $$
 The state is encoded into a dense integer in the range $[0, 3{,}674{,}160)$ using two rank components:
 
-1. Permutation Lehmer rank ($p \in [0, 7!)$), computed with the factoradic numeral system:
+1. Permutation Lehmer rank ( $p \in [0, 7!)$ ), computed with the factoradic numeral system:
 
    $$p = \sum_{i=0}^6 c_i \times (6 - i)!, \quad c_i = \sum_{j=i+1}^6 [s.p[j] < s.p[i]]$$
</file context>

Comment thread report.md Outdated
The state is encoded into a dense integer in the range $[0, 3{,}674{,}160)$ using two rank components:

1. Permutation Lehmer rank ($p \in [0, 7!)$), computed with the factoradic numeral system:
1. Permutation Lehmer rank ( $p \in [0, 7!)$ ), computed with the factoradic numeral system:

ghost Sep 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The spaces inside the parentheses are not needed, and they land in the rendered output as ( p ∈ [0, 7!) ). GitHub's inline math only forbids whitespace immediately inside the $ delimiters, and the content here starts at p and ends at ) either way. This document already writes ($R$), ($B$), ($D$) and ($d$) with no padding, so the spaces make this the one spot that differs.

Suggested change
1. Permutation Lehmer rank ( $p \in [0, 7!)$ ), computed with the factoradic numeral system:
1. Permutation Lehmer rank ($p \in [0, 7!)$), computed with the factoradic numeral system:

Comment thread report.md Outdated
`rank_state` evaluates this by Horner's rule, `p = p * (7 - i) + c_i`, which needs no factorial table and keeps every partial value below 5,040.

2. Orientation rank ($o \in [0, 3^6)$), evaluated as a base-3 integer over the first 6 orientations:
2. Orientation rank ( $o \in [0, 3^6)$ ), evaluated as a base-3 integer over the first 6 orientations:

ghost Sep 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same padding here: the rendered text becomes ( o ∈ [0, 3^6) ). Drop the spaces to match the paren-wrapped inline math used through the rest of the document.

Suggested change
2. Orientation rank ( $o \in [0, 3^6)$ ), evaluated as a base-3 integer over the first 6 orientations:
2. Orientation rank ($o \in [0, 3^6)$), evaluated as a base-3 integer over the first 6 orientations:

Comment thread report.md
$$
p = \sum_{i=0}^6 c_i \times (6 - i)!, \quad c_i = \sum_{j=i+1}^6 [s.p[j] < s.p[i]]
$$
$$p = \sum_{i=0}^6 c_i \times (6 - i)!, \quad c_i = \sum_{j=i+1}^6 [s.p[j] < s.p[i]]$$

ghost Sep 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This block is indented three spaces, which keeps it inside its list item. The matching equation under 2. Orientation constraint in the validity list above sits at column zero, so it closes that list and renders detached from the item it belongs to. Giving it the same three-space indent would make the two sections consistent, as a follow-up beyond this change.

Use GitHub's backtick-delimited math syntax to avoid Markdown parser
collisions, and indent the display equation under its list item.
@jserv
jserv merged commit 231796c into sysprog21:main Sep 28, 2026
@jserv

ghost commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Thank @yenslife for contributing!

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