cabo / kramdown-rfc

An XML2RFC (RFC799x) backend for Thomas Leitner's kramdown markdown parser
MIT License
195 stars 83 forks source link

tex2svg issue #209

Open kesara opened 1 year ago

kesara commented 1 year ago

README file states that kramdown-rfc will use tex2svg from https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg

But this is not true. I think kramdow-rfc uses tex2svg from https://github.com/mathjax/mathjax-node-cli

kramdown-rfc specifies --font flag and --speech flag in tex2svg. But tex2svg from https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg doesn't support them (see --help outputs below).

It would be better to use tex2svg from https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg because it's up-to-date. But the downside is you can't install that as a package using npm.

Help from tex2svg from https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg

tex2svg [options] "math" > file.svg

Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  --inline        process as inline math                               [boolean]
  --em            em-size in pixels                                [default: 16]
  --ex            ex-size in pixels                                 [default: 8]
  --width         width of container in pixels                   [default: 1280]
  --packages      the packages to use, e.g. "base, ams"
      [default: "action, ams, amscd, base, bbox, boldsymbol, braket, bussproofs,
       cancel, cases, centernot, color, colortbl, configmacros, empheq, enclose,
  extpfeil, gensymb, html, mathtools, mhchem, newcommand, noerrors, noundefined,
                       tagformat, textcomp, textmacros, unicode, upgreek, verb"]
  --styles        include css styles for stand-alone image
                                                       [boolean] [default: true]
  --container     include <mjx-container> element                      [boolean]
  --css           output the required CSS rather than the SVG itself   [boolean]
  --fontCache     whether to use a local font cache or not
                                                       [boolean] [default: true]
  --assistiveMml  whether to include assistive MathML output
                                                      [boolean] [default: false]

Help from tex2svg from https://github.com/mathjax/mathjax-node-cli/blob/master/bin/tex2svg

tex2svg [options] 'math' > file.svg

Options:
  --help        Show help                                              [boolean]
  --version     Show version number                                    [boolean]
  --inline      process as in-line TeX                                 [boolean]
  --speech      include speech text                    [boolean] [default: true]
  --linebreaks  perform automatic line-breaking                        [boolean]
  --font        web font to use                                 [default: "TeX"]
  --ex          ex-size in pixels                                   [default: 6]
  --width       width of container in ex                          [default: 100]
  --extensions  extra MathJax extensions e.g. 'Safe,TeX/noUndefined'
                                                                   [default: ""]