Repository navigation
Fix LaTeX formatting for proper math rendering in report.md - #1
Conversation
Updated LaTeX syntax in report.md so mathematical formulas render correctly in Markdown.
left a comment
There was a problem hiding this comment.
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
| 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: |
There was a problem hiding this comment.
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>
| 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: |
There was a problem hiding this comment.
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.
| 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: |
| `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: |
There was a problem hiding this comment.
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.
| 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: |
| $$ | ||
| 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]]$$ |
There was a problem hiding this comment.
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.
commented
Sep 28, 2026
|
Thank @yenslife for contributing! |
Updated LaTeX syntax in report.md so mathematical formulas render correctly in Markdown.
Summary by cubic
Fixes LaTeX formulas in
report.mdso they render correctly in Markdown.$$display math blocks into single-line formulas.Written for commit a2a6e78. Summary will update on new commits.