# How to activate latex rendering

**URL:** <https://forum.gitea.com/t/how-to-activate-latex-rendering/6355>\
**Category:** General\
**Created:** [December 2, 2022, 12:05am UTC](https://forum.gitea.com/t/how-to-activate-latex-rendering/6355 "2022-12-02T00:05:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davenovo](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@davenovo](https://forum.gitea.com/u/davenovo)\
**Post date:** [December 2, 2022, 12:05am UTC](https://forum.gitea.com/t/how-to-activate-latex-rendering/6355/1 "2022-12-02T00:05:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eeyrjmr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/eeyrjmr/32/1095_2.png) [@eeyrjmr](https://forum.gitea.com/u/eeyrjmr)\
**Post date:** [December 2, 2022, 10:14pm UTC](https://forum.gitea.com/t/how-to-activate-latex-rendering/6355/2 "2022-12-02T22:14:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![davenovo](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@davenovo](https://forum.gitea.com/u/davenovo)\
**Post date:** [December 4, 2022, 12:39am UTC](https://forum.gitea.com/t/how-to-activate-latex-rendering/6355/3 "2022-12-04T00:39:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mikaela](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/mikaela/32/4922_2.png) [@Mikaela](https://forum.gitea.com/u/Mikaela)\
**Post date:** [January 26, 2023, 5:33pm UTC](https://forum.gitea.com/t/how-to-activate-latex-rendering/6355/4 "2023-01-26T17:33:57Z")

</div>

I did this by adding this to `app.ini`:

```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

```auto
$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:

> <https://github.com/go-gitea/gitea/issues/17635>
>
> \### Feature Description
> 
> In short: allow external renderers to output PDF, aut…omatically display it using pdf.js.
> Use case: PowerPoint (pptx) files cannot be easily converted to HTML, however, they can be quality printed to PDF.
> Printing files of a custom format to PDF may be a good alternative to a lossy conversion to HTML for some other formats too.
> I thought about working around this by outputting \`\<iframe ... src=".../viewer.html?file=..."\>\` from a renderer, but it's a hack.

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._
