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

ODT export support #21

Open
tecosaur opened this issue Jan 6, 2024 · 10 comments
Open

ODT export support #21

tecosaur opened this issue Jan 6, 2024 · 10 comments
Labels
blocker A problem that blocks merging help wanted Extra attention is needed ox HTML export issue

Comments

@tecosaur
Copy link
Owner

tecosaur commented Jan 6, 2024

It's halfway there, but it's a pain (to me at least) and love it if somebody else could do it 🙏.

@tecosaur tecosaur added help wanted Extra attention is needed ox HTML export issue labels Jan 6, 2024
@tecosaur tecosaur added the blocker A problem that blocks merging label Feb 20, 2024
@yantar92
Copy link

yantar92 commented Feb 20, 2024

Some details:

  1. org-odt--translate-latex-fragments uses LaTeX preview code.
  2. On main, now-obsolete org-format-latex was used
  3. On dev org-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)
  4. One needs to rewrite that part of the function to use the new org-latex-preview API.

@karthink
Copy link
Collaborator

karthink commented Mar 9, 2024

@tecosaur By "halfway there", do you mean you've done some of it already? If yes, is your work committed?

@yantar92
Copy link

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.

@karthink
Copy link
Collaborator

karthink commented Mar 13, 2024 via email

@karthink
Copy link
Collaborator

karthink commented Apr 7, 2024

A couple of updates:

  1. ODT export support has been added. In the process, there are a couple of improvements to 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.
  2. 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.

@karthink
Copy link
Collaborator

karthink commented Apr 7, 2024

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.

@yantar92
Copy link

yantar92 commented Apr 7, 2024 via email

@yantar92
Copy link

yantar92 commented Apr 7, 2024 via email

@karthink
Copy link
Collaborator

karthink commented Apr 7, 2024

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.

@tecosaur
Copy link
Owner Author

tecosaur commented Apr 7, 2024

He hasn't applied the patches yet, they should be on the repo soon.

They were applied about an hour ago 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker A problem that blocks merging help wanted Extra attention is needed ox HTML export issue
Projects
None yet
Development

No branches or pull requests

3 participants