shi-yang / jnoj

Jiangnan Online Judge
https://www.jnoj.dev
Other
241 stars 62 forks source link

关于Markdown中编辑数学公式的问题 #91

Open aaronlu1985 opened 4 years ago

aaronlu1985 commented 4 years ago

无法在行内插入数学表达式,同时数学表达式显示比例较大,不美观,望改正,谢谢!

bobby285271 commented 3 years ago

我这里可以插入行内公式的,要是调字号的话改这里就行:

https://github.com/shi-yang/jnoj/blob/5115f928d875951e3e7f44f021bae75b3ffc0ae5/components/Formatter.php#L123-L130

public function katex_src_inline( $matches ) {
    $katex = $matches[1];
    $katex = $this->katex_entity_decode_editormd( $katex );
    return '<span class="katex math inline" style="font: normal 1em KaTeX_Main, Times New Roman, serif !important;">' . $katex . '</span>';
}