How to render LaTeX in Forĝejo/Gitea? #1

Closed
opened 2022-10-31 20:58:50 +02:00 by Aminda Suomalainen ⚧ · 0 comments

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"

basic.html

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

Adjusted from pandoc -D html (mainly stripping HTML and HEAD), by improving it, it could likely look even better.

See also https://github.com/go-gitea/gitea/issues/17635 which I think will make it even better.

# `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" ``` # basic.html ```html $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$ ``` Adjusted from `pandoc -D html` (mainly stripping HTML and HEAD), by improving it, it could likely look even better. See also https://github.com/go-gitea/gitea/issues/17635 which I think will make it even better.
Aminda Suomalainen ⚧ changed title from How to render LaTeX in Gitea? to How to render LaTeX in Forĝejo/Gitea? 2023-01-24 13:38:30 +02:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mikaela.suomalainen/testi#1
No description provided.