Skip to content

[BUG] mitex-cli fails to compile a compilable typst file when missing aliases #219

@Yousa-Mirage

Description

@Yousa-Mirage

Describe

When using mitex-cli to compile a LaTeX document containing standard environments like pmatrix into Typst code, the resulting Typst code fails to render. Typst throws an unknown variable: pmatrix error because the generated prelude lacks the corresponding #let binding for these environments.

To Reproduce

  1. Create a minimal LaTeX file main.tex:
\begin{pmatrix}
    1 & 0 \\
    0 & 1
\end{pmatrix}
  1. Compile it using mitex-cli:
mitex compile main.tex main.typ
  1. The generated main.typ looks like this and fails to compile:
#import "@preview/mitex:0.2.6": *

// many aliases bindings like
// #let Big = mitex-scope.at("Big", default: none);

$ pmatrix(  // error: unknown variable: pmatrix
1  zws , 0  zws ;
0  zws , 1 
) $

But with Typst Package, this is fine:

#import "@preview/mitex:0.2.6": *
#mitex(`
  \begin{pmatrix}
      1 & 0 \\
      0 & 1
  \end{pmatrix}
`)

Expect

mitex-cli works well and could compile a compilable typst file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions