Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConversionOptions not respected when converting to SVG #38

Open
nhojb opened this issue Jun 28, 2024 · 0 comments
Open

ConversionOptions not respected when converting to SVG #38

nhojb opened this issue Jun 28, 2024 · 0 comments

Comments

@nhojb
Copy link

nhojb commented Jun 28, 2024

I'm using MathJaxSwift to convert LaTex to SVG and then render in a macOS app.

I have one problem where the display property of ConversionOptions does not appear to be respected for inline equations. This is the output I get when setting display to false. It's the same if I don't set display or set to true:

Screenshot 2024-06-28 at 10 51 24

I'd expect inline rendering more like this (from mathjax.org):

Screenshot 2024-06-28 at 10 52 05

I've double-checked the SVG output is rendering correctly, so it seems like the tex2svg() function is not respecting the ConversionOptions for some reason.

Notes:
I'm initializing MathJax like this:

  mathJax = try MathJax(preferredOutputFormat: .svg)

And calling tex2svg like this:

  let svg = try mathJax.tex2svg(tex, conversionOptions: ConversionOptions(display: false))

The input I'm using in the above examples is below. My app parses the equations and removes the $ delimiters before passing to tex2svg().

The power rule states that the integral of $x^n$ is $\frac{1}{n+1}x^{n+1} + C$, where $n$ is any real number (except -1).
@nhojb nhojb changed the title ConversionOptions not respected when converted to SVG ConversionOptions not respected when converting to SVG Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant