Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
JavaScript library for converting TeX / LaTeX math formula code to Typst
A Web UI wrapper is available at https://qwinsi.github.io/tex2typst-webapp/.
npm install tex2typst
<script src="https://cdn.jsdelivr.net/npm/tex2typst@0.2.7/dist/tex2typst.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/tex2typst@0.2.7/dist/tex2typst.min.js"></script>
Replace 0.2.7
with the latest version number in case this README is outdated.
The size of minimized library tex2typst.min.js
is about 23 KB.
import { tex2typst } from 'tex2typst';
let output = tex2typst("\\zeta(s) = \\sum_{n=1}^{\\infty}\\frac{1}{n^s}");
console.log(output);
// zeta(s) = sum_(n = 1)^infinity frac(1, n^s)
If you are using the library in a web page via a <script>
tag, you don't need the line of import
, function tex2typst
should be available in the global scope.
For example,
let macros = {
"\\sgn": "\\operatorname{sgn}"
};
let input = "y = \\sgn(x)";
let output = tex2typst(input, {customTexMacros: macros});
console.log(output);
// y = op("sgn")(x)
graph LR
tex[TeX code] --parser--> tex_ast[TeX AST] --converter--> typst_ast[Typst AST] --writer--> typst[Typst code]
LatexParser
.convertTree
.TypstWriter
.Feel free to open an issue or submit a pull request.
FAQs
JavaScript library for converting TeX code to Typst
The npm package tex2typst receives a total of 159 weekly downloads. As such, tex2typst popularity was classified as not popular.
We found that tex2typst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.