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 Requst: Support Citation `\cite{...}` in `#mitext` #134

Closed xiaodong-hu closed 4 months ago

xiaodong-hu commented 4 months ago

Right now the reference is not parsed in mitext. But I think it can be easily supported by breaking the macro by the parser if \cite is encountered.

For example, if I have a bib file containing one item called anderson1972more,

#import "@preview/mitex:0.2.1": *
#mitext(`This is reference test \cite{anderson1972more}. This is the text after.`)

I would expect it to be parsed into

#import "@preview/mitex:0.2.1": *
#mitext(`This is reference test `) @anderson1972 #mitext('. This is the text after.`)

where we can simply take advantage of the standard support of bib-file citation.