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

PDF do not include math formulas #1450

Closed
KyrylR opened this issue Oct 8, 2023 · 2 comments
Closed

PDF do not include math formulas #1450

KyrylR opened this issue Oct 8, 2023 · 2 comments

Comments

@KyrylR
Copy link

KyrylR commented Oct 8, 2023

Observed vs. expected behavior

In the Asciidoctor plugin, when I preview the .adoc file or export it as a PDF, I notice that the math formulas are not rendered correctly. They appear as plain text or not at all in the PDF. The expected behavior is for the math formulas to be rendered correctly, just as they appear in the Asciidoctor preview within the IDE.

Steps to reproduce

  1. Create a new .adoc file within IntelliJ IDEA.
  2. Add some content that includes math formulas, for instance:
[latexmath]
++++
\frac{n!}{k!(n-k)!} = \binom{n}{k}
++++
  1. Preview the document using the Asciidoctor plugin. Note that the formula is correctly rendered in the preview.
  2. Export the document as a PDF.
  3. Open the PDF and observe that the math formulas are either missing or not rendered correctly.

Environment

Plugin Version: 0.40.4

IntelliJ Details: RustRover 2023.2 EAP
Build #RR-232.9921.62, built on September 15, 2023
Licensed to RustRover EAP user: Kiril Riabov
Expiration date: October 15, 2023
Runtime version: 17.0.8+7-b1000.22 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.5-1-manjaro
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Registry:
ide.experimental.ui=true

Non-Bundled Plugins:
com.github.copilot (1.3.0.3323)
nl.rubensten.texifyidea (0.9.1)
org.asciidoctor.intellij.asciidoc (0.40.4)
nix-idea (0.4.0.10)

Current Desktop: KDE

@KyrylR KyrylR added the bug label Oct 8, 2023
@ahus1
Copy link
Contributor

ahus1 commented Oct 8, 2023

Thanks for reaching out with this topic. Unfortunately there is no straight good answer for this.

  • Asciidocotor PDF (which is used in the plugin) doesn't have math support which I could bundle in the plugin. You might want to try doing a conversion on the command line instead.
  • There is an experimental Web PDF support in the IntelliJ plugin which needs to be enabled first. It will render the preview 1:1 (but you'll miss out on, for example, page numbers). See information on enabling the internal mode for this experimental feature.
  • Similar to that is opening the HTML in a browser either by using the browser preview, or pressing the HTML button, and creating a PDF from that. With some configuration you should be able to add page numbers
  • Convert the document to DOCX first. While that should work, it might be necessary to double-check the converted formulas. This conversion is powered by Pandoc.

See #1321 for a longer discussion. Let me know if this information is helpful.

@ahus1 ahus1 self-assigned this Oct 8, 2023
@KyrylR
Copy link
Author

KyrylR commented Oct 12, 2023

Ohh, I got it, thanks

It works fine with DOCX

@KyrylR KyrylR closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants