GitbookIO / plugin-katex

Math typesetting using KaTex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to change the math mode delimiters?

metasim opened this issue · comments

Trying to switch to katex from MathJax, but all my docs use single $ for inline math mode. Can this be configured in katex?

@metasim See discussion in #1 Sorry, was too quick. This is about delimiters and not the different modes

I'm recently using the \( \) notation and have the same question.

It would be nice if we could change delimiters so we can adapt to different markdown flavor/tools.
For example, I'm currently using GitLab and they have chosen $` `$ as delimiters as you can see here and here rendered correctly.

I would also like single $ delimiters for inline and double $$ delimiters for display. I thought this was the most common convention anyway. It is more compact and lets you use display mode in a sentence, for those odd occasions where you don’t want compact presentation inline.

Compare the following two examples.

CURRENT BEHAVIOUR

This is a fraction $$\frac{1}{2}$$.

This is a fraction:

$$
\frac{1}{2}
$$

DESIRED BEHAVIOUR

This is a fraction $\frac{1}{2}$.

This is a fraction:

$$\frac{1}{2}$$

As an added extra, it would be good if using double $$ delimiters inline forced display mode (i.e. not compact) but kept it inline.

This is a compact (inline mode) fraction $\frac{1}{2}$.
This is a full size (display mode) fraction $$\frac{1}{2}$$.

This is a fraction:

$$\frac{1}{2}$$