Font size for `$...$` inside of `\text` inside of `\substack`
- Dominant language
- TypeScript
- Stars
- 20.4k
- Forks
- 1.3k
- Avg merge
- 14h 37m
- Merged PRs (30d)
- 7
Description
> Before reporting a bug
- [x] Check [common issues](https://katex.org/docs/issues.html).
- [x] Check the bug is reproducible in [the demo](https://katex.org). If not, check KaTeX is up-to-date and installed correctly.
- [x] Search for [existing issues](https://github.com/KaTeX/KaTeX/issues).
**Describe the bug:**
Font size is not set consistently when using inline math `$...$` and `\text{...}` inside of the `\substack` command.
**To Reproduce:**
Visit [katex.org](https://katex.org/) and enter the following:
```
\bigg\{ \;\mathbb{F}[x]\text{-modules } V\; \bigg\}
\longleftrightarrow
\bigg\{ \substack{\text{$\mathbb{F}$-vector spaces $V$ with a}\\ \text{linear map $T : V \rightarrow V$}} \bigg\}
```
KaTeX renders the inline math `$...$` with a normal-sized font, but renders the rest of the `\text{...}` with a smaller font.

**Expected behavior:**
The math font and text font should be the same size. For example, LaTeX produces:

**Workarounds:**
Explicitly including a size like `\small` or `\normalsize` produces more acceptable output:
```
\bigg\{ \;\mathbb{F}[x]\text{-modules } V\; \bigg\}
\longleftrightarrow
\bigg\{ \substack{\small\text{$\mathbb{F}$-vector spaces $V$ with a}\\\small \text{linear map $T : V \rightarrow V$}} \bigg\}
```

**Environment (please complete the following information):**
- KaTeX Version: 0.13.13
- Device: Desktop
- OS: Ubuntu 20.04
- Browser: Chrome
- Version: 92
**Additional context:**
N/A
Contributor guide
Assessment
This issue has not been assessed yet.