Skip to content

Conversation

@catloversg
Copy link
Collaborator

@catloversg catloversg commented Jan 20, 2026

We used remark-math to render math notations in the in-game markdown docs viewer. Under the hood, remark-math uses micromark-extension-math. When writing Tex with these plugins, we need to use their syntax. There are two "modes": inline (also called "text") and block (also called "flow").

This is an example:

Inline 1: $x+y$

Inline 2: $$x+y$$

Block:

$$
x+y
$$

Notice how the "block" mode requires a newline after the opening $$ and the closing $$. If $$ (the "fence") is on the same line as the notation, the notation is always considered "inline". However, this is their rule, not a universal rule. In fact, there are no universal rules when it comes to math notation in markdown. Let's render this example in GitHub UI and VSCode's markdown preview mode:

Foo: $$x+y$$

$$x+y$$

$$
x+y
$$

GitHub UI:

github-1

VSCode:

vscode

As you can see in the screenshots, $$x+y$$ can be inline or block, depending on the renderer.

In our corp docs, we usually $$foo$$ (no newlines), so the math notations are rendered differently on GitHub UI and the in-game viewer:
GitHub:

github-2

In-game viewer (current):

before

This PR changes most of $$foo$$ (no newlines) to the ones with newlines. After the changes:

after

Note that there are still some unchanged notations. They are notations used in a multi-level list. For example:

- foo 1
  - bar 1
  - bar 2:
    $$x + y$$
  - bar 3
- foo 2

In these cases, we have a problem with GitHub UI and prettier.

On GitHub, the example above is rendered in the inline mode, if we want it to render in the block mode, we need to write it like this:

- foo 1
  - bar 1
  - bar 2:

$$x + y$$

  - bar 3
- foo 2

Or

- foo 1
  - bar 1
  - bar 2:

$$
x + y
$$

  - bar 3
- foo 2

However, prettier will reformat it like this (notice how - bar 3 is moved):

- foo 1
  - bar 1
  - bar 2:

$$
x + y
$$

- bar 3
- foo 2

I tried to find a workaround, but I did not find any good ones, so I decided to accept it as a small drawback.

@d0sboots d0sboots merged commit 2edad3e into bitburner-official:dev Jan 20, 2026
7 checks passed
@catloversg catloversg deleted the pull-request/documentation/Update-math-notations-in-corporation-docs branch January 21, 2026 04:36
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