Open to a PR that adds some level of support to it!

# Discourse Math Plugin

**self_shadow**(Stephen Hill) #104

I would gladly do that except that I donāt know the first thing about the discourse codebase. Do you have any pointers as to how to approach this particular problem? For instance, is there an existing mechanism/feature that I could use as a template for how to inject html code from a plugin into a `.erb`

?

**terraboss**(Markus) #105

Can someone explain me, how to increase the font / overall size of KaTeX formula? I found this on the KaTeX docs, but donāt know how to work with thatā¦ solved by using `\cfrac`

`\displaystyle`

**My example:**

```
**for** $t = 1$ to $t_{max}$ **do**
$$
\vec{x}_{min+} = \text{arg min } s_i \vec{w}^T \vec{x}_i , \text{wobei } (X^+= \{\vec{x_i | s_i = 1}\}\\
\vec{x}_{min-} = \text{arg min } s_i \vec{w}^T \vec{x}_i, \text{wobei } (X^-= \{\vec{x_i | s_i = -1}\}\\
\vec{w} = \vec{w} + \vec{x}^{\text{min + }} - \vec{x}^{\text{min - }}
$$
**end for**
$\theta = \frac{\vec{w} = \vec{w} + \vec{x}^{\text{min + }} - \vec{x}^{\text{min - }}}{2}$
```

Thanks in advance!

PS: How can I align multiple lines with the ā=ā as anker point? ā¦ solved

**deltamotion**(Don Turrentine) #106

Thanks so much for this plugin!

We just moved to Discourse from phpBB, where we used the [latex] and [/latex] codes ā¦ I was wondering if there would be any interest in expanding the pluginās markers to include such things ā¦

Otherwise Iām looking at search-and-replace across all our forum postsā¦

**danekhollas**(Daniel Hollas) #107

It seems it might not be too difficult to add a generic setting for a math block marker, by modifying this function:

Additional complexity here is that the end marker is different from the beginning marker.

I can take a crack at it if folks are open to a PR here, but citing from the OP:

Not sure whether this was intentinal or not. It would be a bit more difficult to have a generic setting for inline math due to the special heuristic that was implemented for this.

**deltamotion**(Don Turrentine) #108

Right, it doesnāt look too hard but maybe the plugin is supposed to be more lightweight. Thanks for chiming in!

**danekhollas**(Daniel Hollas) #109

Ha, good reminder. Forgot to write here that the support for KaTeX was added some time ago.

If you have a math-heavy forum, this should give you rather large speed boost. Editing a post is also a much nicer experience since equations do not flicker as you type. MathJax has generally better overall support for more obscure LaTeX and it remains a default for this plugin.

Iāve updated the OP accordingly, and also added a mention about support for asciimath that was added a while back.

**terraboss**(Markus) #110

It would be amazing if someone could integrate something like Detexify LaTeX handwritten symbol recognition as reference for that plugin. Any good reference for everyday use would be so great

What do you think?

It seems, there are multiple feature detection APIs / libs:

**sam**(Sam Saffron) #112

You are the major consumer here, if it makes sense to you, then I guess it sounds ok. That said I would urge to stay as close as possible to what folks at mathoverflow and stack exchange maths are using.

**terraboss**(Markus) #113

Just a small but very usefull side note for all math enthusiasts: https://mathpix.com

**danekhollas**(Daniel Hollas) #114

Thinking about this a bit moreā¦could you clarify, whether youād like to use the [latex] for math going forward even on the new forum or just for the old posts? i.e. would you like to support both `$$`

and `[latex]`

as delimiters or just one of them? Also, do your post look like this?

```
[latex]
math here
[/latex]
```

or is it also inline?

**pfaffman**(Jay Pfaffman) #115

Right. If the problem is imported data, the solution is to replace the delimiters in those posts. That said, when I tried recently, I failed and the site had only a dozen or so such posts and we didnāt find the problem until it was to late to run the import again.