Skip to content

Feat: Added support for Tectonic tex compiler - #4977

Draft
christopher-hampson wants to merge 7 commits into
ManimCommunity:mainfrom
christopher-hampson:feat_tectonic
Draft

Feat: Added support for Tectonic tex compiler#4977
christopher-hampson wants to merge 7 commits into
ManimCommunity:mainfrom
christopher-hampson:feat_tectonic

Conversation

@christopher-hampson

Copy link
Copy Markdown
Contributor

Overview: What does this pull request change?

Adds support for using Tectonic (https://tectonic-typesetting.github.io/) as an additional TeX compiler.

The main changes are:

  • Moves some hard-coded strings into a TexCompiler and TexOutputFormat constants (as StrEnums, which support backward compatibility for users to continue supplying kwargs as str).
  • Adds support for tectonic as a compiler with TexCompiler.TECTONIC, supporting XDV and PDF output formats (based on the suggestion in Support tectonic tex engine #4042)
  • Adds tecto (https://pypi.org/project/tecto/) as an optional dependency which provides the wheels for Tectonic.

Motivation and Explanation: Why and how do your changes improve the library?

  • Tectonic appears to have some quite nice features and, with tecto, the installation appears to be simpler and more uniform.

  • Removing some of the hard-coded strings should make it easier for users and their IDEs to identify available options for tex_compiler and output format.

Further Information and Comments

  • Closes Support tectonic tex engine #4042

  • There are some known issues with fraction lines when using pdf as the target output format; this does not seem to be unique to Tectonic but rather a common issue with all compilers compiling to pdf. The issue does not present when compiling to xdv (both for XeLaTeX and Tectonic) or dvi (for LaTeX, pdfLaTeX, and LuaLaTeX). This seems to be due to a difference in how dvisvgm converts the different formats into svg, with the pdf->svg conversion representing the fraction line as a path with non-zero stroke, whereas dvi/xdv->svg represents the fraction line as a rect.

  • This PR also removes luatex from the advertised list of available compilers as this did not appear to be functional due to the TexTemplate baking in LaTeX syntax with _BEGIN_DOCUMENT and _END_DOCUMENT. This is potentially a breaking-change, although I could not get this to work on main without the above changes, but could be added to TexCompiler if there is some use-case for this that I am missing?

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

@christopher-hampson
christopher-hampson marked this pull request as draft August 31, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support tectonic tex engine

1 participant