Open tecosaur opened 9 months ago
Some details:
org-odt--translate-latex-fragments
uses LaTeX preview code.org-format-latex
was usedorg-latex-preview-replace-fragments
(non-existing) is used: https://code.tecosaur.net/tec/org-mode/src/branch/dev/lisp/ox-odt.el#L3819 (so, ox-odt is broken on dev branch for now)@tecosaur By "halfway there", do you mean you've done some of it already? If yes, is your work committed?
I looked closer into this and the way we need to change ox-odt is probably similar to what org-html-prepare-latex-images
does. However, I am concerned that org-html-prepare-latex-images
is using internal org-latex-preview API. It would be better if org-latex-preview exposed (and documeted!) better API to retrieve fragments programatically.
I implemented latex preview support for ox-odt over the weekend. I ended up duplicating a bunch of code from ox-html, so I agree with the point about org-latex-preview exposing a better way to get preview images. I'll work on this in the coming weekend.
On Wed, Mar 13, 2024, 4:58 AM Ihor Radchenko @.***> wrote:
I looked closer into this and the way we need to change ox-odt is probably similar to what org-html-prepare-latex-images does. However, I am concerned that org-html-prepare-latex-images is using internal org-latex-preview API. It would be better if org-latex-preview exposed (and documeted!) better API to retrieve fragments programatically.
— Reply to this email directly, view it on GitHub https://github.com/tecosaur/org-latex-preview-todos/issues/21#issuecomment-1994213847, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBVOLENRPLXBFJ3IT2YTUDYYA5ODAVCNFSM6AAAAABBPMKF7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJUGIYTGOBUG4 . You are receiving this because you commented.Message ID: @.***>
A couple of updates:
ox-odt
as well: svg image exports via the dvisvgm
are now supported, and there is some support for scaling images to match the text size. Baseline alignment for inline fragments is not available, and it doesn't look like this is possible. The current state of LaTeX preview based image exports for ODT is still much better than before, so I'm content to leave this be.org-latex-preview
now provides an external API for export backends and for general elisp scripting to generate preview images for a parse tree. Both the ox-html
and ox-odt
backends are now using this API.This issue can be closed after someone tests ODT exports.
I should add that ox-odt
is quite broken on the whole. Several of my test exports failed because of errors unrelated to org-latex-preview, i.e. errors with the preexisting version. I tracked a couple of the errors down, and I can fix it but I don't understand the original intent of that code so I don't want to touch it.
I'm not sure I would call it usable.
karthink @.***> writes:
- ODT export support has been added. In the process, there are a couple of improvements to
ox-odt
as well: svg image exports via thedvisvgm
are now supported, and there is some support for scaling images to match the text size. Baseline alignment for inline fragments is not available, and it doesn't look like this is possible. The current state of LaTeX preview based image exports for ODT is still much better than before, so I'm content to leave this be.
AFAIU, the "proper" way to export formulas to odt is via mathml convertor.
Is there any place where I can test the update? I only know Timothy's repo, but I do not see any new commits there.
-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
karthink @.***> writes:
I should add that
ox-odt
is quite broken on the whole. Several of my test exports failed because of errors unrelated to org-latex-preview, i.e. errors with the preexisting version. I tracked a couple of the errors down, and I can fix it but I don't understand the original intent of that code so I don't want to touch it.I'm not sure I would call it usable.
A number of people use it without issues. If you encountered issues, please do report them.
-- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
AFAIU, the "proper" way to export formulas to odt is via mathml convertor.
That makes sense given the ODT format. Basic support for image-based LaTeX preview means this is at least not a blocker any more.
Is there any place where I can test the update? I only know Timothy's repo, but I do not see any new commits there.
He hasn't applied the patches yet, they should be on the repo soon.
A number of people use it without issues. If you encountered issues, please do report them
Will do. The issues mostly center on image links (not LaTeX preview images) being malformed.
He hasn't applied the patches yet, they should be on the repo soon.
They were applied about an hour ago :slightly_smiling_face:
Can someone test exporting an Org doc with equations to ODT via dvisvgm/dvipng? It should be working, but I'd like confirmation before closing this.
It's halfway there, but it's a pain (to me at least) and love it if somebody else could do it :pray:.