tex 0.0.1 copy "tex: ^0.0.1" to clipboard
tex: ^0.0.1 copied to clipboard

outdated

Tiny TeX to SVG engine by Andreas Schwenk

tex is a tiny TeX engine that creates SVG images from TeX strings. Currently, only the math environment (e.g. $ f(x) = x^2 $) is supported. Compared to other TeX renderers, this package does NOT rely on JavaScript or any other dependencies.

You will find a playground at https://andreas-schwenk.github.io/tex. Alternatively, open file /docs/index.html in your browser. A local web server is not required.

Warning: this package is under development. Many TeX macros, e.g. \frac{1}{2}, will be supported soon

Features #

  • Rendering of SVG images from TeX sources
  • All data is packed into code. There is no need to load any data at runtime.

Getting started #

Add the package into your package's pubspec.yaml file:

dependencies:
  tex: ^0.0.1

Make sure to use the latest version!

Usage #

import 'package:tex';

void main() {
  var tex = TeX();
  var svgImageData = tex.tex2svg("f(x,y) = x^2 + y^2");
  if (svgImageData.isEmpty) {
    print('Errors occurred: ${tex.error}');
  } else {
    print(svgImageData);
  }
}

Output SVG:

[img/example.svg]

Additional information #

For building the fonts, Python and node must be installed. This is only required for developers of this package.

./build.sh

File meta/glyphs.csv specifies the glyphs.

License of MathJax #

This package extracts SVG image data of glyphs from MathJax. All rights remain to the authors. MathJax is licensed under the Apache2 license. You will find a copy of Apache2 license in folder ext-licenses/ of this repository.

All extracted data from MathJax can be found in variable svgData of file /lib/src/svg.dart.

11
likes
0
points
436
downloads

Publisher

verified publisherarts-and-sciences.com

Weekly Downloads

Tiny TeX to SVG engine by Andreas Schwenk

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on tex