<h3 dir="auto">Problem</h3>
<p dir="auto">Latex compilers are very slow.</p>
<h3 dir="auto">Proposed solution</h3>
<p dir="auto"><a href="https://github.com/typst/typst">Typst</a> is orders of magnitude faster than any latex compiler (runs in milliseconds) and has a much easier to use syntax than latex (subjective but I think most agree). I'd like to request support for it as a rendering engine for math in figures.</p>
<p dir="auto">I'm not sure how rendering is currently done, but here's an example of a 0-margin document with math using typst:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#set page(width: auto, height: auto, margin: 0pt)
$ y = integral_(x_0)^x f(s) d s $"><pre lang="typst" class="notranslate"><code class="notranslate">#set page(width: auto, height: auto, margin: 0pt)
$ y = integral_(x_0)^x f(s) d s $
</code></pre></div>
<p dir="auto"><a href="https://typst.app/project/r4trB2mMP5Njm3x_X8teFo" rel="nofollow">Live preview on typst.app</a></p>
<h3 dir="auto">Problem</h3>
<p dir="auto">I don't use Texlive, I use <a href="https://github.com/tectonic-typesetting/tectonic">Tectonic</a>, and I using <code class="notranslate">plt.rcParams['text.usetex']</code> requires me to download a different LaTeX engine, not only because the <code class="notranslate">latex</code> binary is searched, but also because the <code class="notranslate">tex</code> files that are meant for compilation are meant for <code class="notranslate">pdflatex</code>, and not <code class="notranslate">xetex</code>, which tectonic essentially wraps.</p>
<h3 dir="auto">Proposed solution</h3>
<p dir="auto">Add a new option to <code class="notranslate">rcParams</code> which will enable using a different LaTeX engine, and another option that will control whether the generated <code class="notranslate">tex</code> files should be intended for xetex or <code class="notranslate">pdftex</code>.</p>
<p dir="auto">This seems not too complicated to solve, but I wish to know what do you think, and whether you'd be willing to add more moving parts to <a href="https://github.com/matplotlib/matplotlib/blob/2e921df22ba6b2a7782241798b042403c04cbdaf/lib/matplotlib/texmanager.py#L56"><code class="notranslate">TexManager</code> class</a>, especially since the generated tex files for a <code class="notranslate">xetex</code> engine should be substantially different.</p>