mitex-rs / mitex

LaTeX support for Typst, powered by Rust and WASM. https://mitex-rs.github.io/mitex/
https://mitex-rs.github.io/mitex/tools/underleaf.html
Apache License 2.0
240 stars 8 forks source link

feature request to support raw macro or \texttt{} translation in mitex #129

Closed xiaodong-hu closed 4 months ago

xiaodong-hu commented 4 months ago

For example,

#import "@preview/mitex:0.2.1": *
#mitext(`
        The torus geometry paratermized with fluxes $phi_1,phi_2$ can be described with the struct:
        ```julia
        struct Torus_Sample
            L1::Float64
            τ::ComplexF64
            Ns::Int64
            mag_trans_units::Vector{ComplexF64}
            phase_twists_over_2π::Vector{Float64} # fluxes (ϕ1,ϕ2)
        end
    where we introduce the *minimal* quantized intervals of the sample along two oblique directions $(\delta L_1,\delta L_2)=(\frac{L_1}{N_s},\frac{L_1\tau}{N_s})$, such that each thin rectangular is pierced with just *one* quantum flux
    \begin{equation*}
        \delta L_1\times L_2 = 2\pi\ell^2,\quad \delta L_2\times L_1 = 2\pi\ell^2.
    \end{equation*}

`)


does not render at all.

**I encounter this problem because I am transferring my academical notes from markdown (very long and hundreds of huge equations, so rendering slow in markdown) to typst (which is really fast)**.

Maybe `#raw()` macro support can be added for pair of \`...\` and \```...\```, which is not the keyword in latex so should work out without any ambiguities.
OrangeX4 commented 4 months ago

``` isn't a latex syntax, and we shouldn't consider adding support for this markdown syntax? You might consider using \iftypst.

But the actual problem here is that ``` conflicts with the ` of #mitex(`, which is already a limitation of the typst syntax.

xiaodong-hu commented 4 months ago

I understand, thx.