How to activate latex rendering

Hello. I have just installed Gitea 1.17.3. I am trying to figure out how to render latex. Is there a document that goes step by step how to

a) activate latex rendering (if it is not activated by default)
b) enter latex code in the wiki

native latex support (via katex) is part of 1.18

To add support in <=1.17 you need to download katex, add it to your server and add a js snippit to a template

if I grab 1.18 are there any documentation how to start entering latex? Do I have to simply type $a_b$ in the wiki and it will work?

I did this by adding this to app.ini:



[markup.latex]
ENABLED         = true
FILE_EXTENSIONS = .tex,.latex
# docs maybe suggest adding --katex, but is anyone doing math? https://docs.gitea.io/en-us/external-renderers/
RENDER_COMMAND  = "timeout 30s pandoc -f latex -t html --self-contained --template /etc/gitea/basic.html"

and my /etc/gitea/basic.html is

$for(include-before)$
$include-before$
$endfor$
$if(title)$
$title$
$if(subtitle)$
$subtitle$
$endif$
$for(author)$
$author$
$endfor$
$if(date)$
$date$
$endif$
$endif$
$if(toc)$
$idprefix$TOC
$if(toc-title)$
$toc-title$
$endif$
$table-of-contents$
$endif$
$body$
$for(include-after)$
$include-after$
$endfor$

taken from pandoc -D html. I think this $\LaTeX$ could look better if it was rendered to pdf which has an issue at GitHub:

I haven’t seen or tried any integrated support $\LaTeX$ support and I don’t see my .tex files rendered on other Gitea instances where I have mrirors. I also haven’t tried putting .tex files from wiki, but as Gitea wikis are just git repos too, I would expect it to accept .tex files in addition to .md.


I know this is a bit old topic, but my friend found this by a search so I think having a working answer here is generally more beneficial than reviving an inactive topic.