7

I know MathJax, especially with ASCIIMath, processes a lot of different words into symbols. But is there any way to prevent it from converting specific words?

For example, it turns every instance of lt into <. Can I make it so that it keeps it as lt instead?

3 Answers3

4

I don't know if this is a correct way to do it, but I was able to get it to render as lt by putting a \ between the l and t like this: l\t.

MicahDev
  • 41
  • 5
1

I know this thread is very old. But I stumbled across the same problem while adding a math formula to an AsciiDoc text.

\frac{5\ \text{GT }}{\text{s}} \times \frac{1\ \text{Bit}}{\text{T} \times \text{Lane}} \times \frac{\text{8 Bit}}{\text{10 Bit}} \times 16\ \text{Lanes} = \frac{64\ \text{GBit}}{\text{s}} =  \frac{8\ \text{GByte}}{\text{s}}

I just added white-space after the GT to avoid rendering it to >.

Pawel Veselov
  • 3,996
  • 7
  • 44
  • 62
1

Double-quoted (") string works for me, see an example below:

<script>
MathJax = {
  loader: {
    load: ['input/asciimath', 'output/chtml', 'ui/menu']
  },
};
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/startup.js"></script>

<p>Without quotes: `c_in = c_out ^ gamma`</p>

<p>With quotes: `c_"in" = c_"out" ^ gamma`</p>
rmalviya
  • 1,847
  • 12
  • 39
  • Ran into this with things like `C^(combined)`. Yes, double quotes "work" (i.e., `C^("combined")`, but they change the rendering of the superscript from italics to regular, which ruins the visual, it's especially noticeable with `C^(comb"in"ed)` – Pawel Veselov Jul 30 '23 at 16:44