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

use dvisvgm for latex equation export #327

Closed
andreyorst opened this issue Feb 4, 2020 · 4 comments · Fixed by #497
Closed

use dvisvgm for latex equation export #327

andreyorst opened this issue Feb 4, 2020 · 4 comments · Fixed by #497

Comments

@andreyorst
Copy link
Contributor

Hello. I'm trying to set up latex exporting to svg via dvisvgm instead of relying on mathjax. Currently if I set this option at the top of my org mode file I see exported images in resulting markdown files in this facion:

Org file:

#+options: tex:dvisvgm
... text ...
\[ a + b \]
... text ...

Markdown:

... text ...
<object type="image/svg+xml" data=".ltximg/blog_bbacb5f50664161c1c001269e2c3c77fd5202d24.svg" class="org-svg">
Sorry, your browser does not support SVG.</object>
... text ...

Which will not work because the path to the image is wrong after hugo builts the page.

There's an option for that org-preview-latex-image-directory but if I set it to something like ./static/ltximg it still doesn't work because of wrong path.

Is it possible to set the correct path or configure ox-latex in a way that it will copy images somewhere?

@kaushalmodi
Copy link
Owner

I just realized that I forgot to reply to this thread after reading the issue. This is not being ignored.

I'll see if I can get time to implement this feature in next 2 weeks. PR's are always welcome.

In the meanwhile, would the Mathjax solution work for you?

@andreyorst
Copy link
Contributor Author

andreyorst commented Feb 9, 2020 via email

kaushalmodi added a commit that referenced this issue Jan 4, 2022
This option exports inline and block LaTeX equations as SVG
files. ox-hugo then takes care of copying the exported SVG files to
the site's `static/ltximg/` directory.

NOTE: The user will need to take care of deleting all the old SVG
files which are no longer used.

Fixes #327.
@kaushalmodi
Copy link
Owner

@andreyorst Hello! I am replying to this thread after a while. If you are still using ox-hugo, try out the latest commit on the main branch and let me know if it works as expected for you.

It worked well for me from my local testing.

@andreyorst
Copy link
Contributor Author

Just tested and it seems to work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants