Replies: 3 comments
-
I tried to use the js code specified in the email in two ways.
LATEX_CSS = """
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" });</script>
"""
from markdown_pdf import Section, MarkdownPdf
pdf = MarkdownPdf()
pdf.add_section(
Section("# Latex test\n$$\\sum_1^n x_n$$"),
user_css=LATEX_CSS
)
pdf.save("latex.pdf") Both options did not lead to the desired result. I myself have encountered the need to include mathematical formulas in a pdf document created from markdown a couple of times. I solved this problem by creating a formula in MS Word. Then I took a screenshot of this formula and added this screenshot to markdown as an image. For me, this method turned out to be quite working, because I very rarely encounter the need to use mathematical formulas in documents. But with intensive use of mathematical formulas, this method becomes inconvenient. |
Beta Was this translation helpful? Give feedback.
-
I think this task could be automated in When loading markdown content, To implement this task, a python library is required that meets the following conditions.
I rarely deal with mathematical formulas and have almost never used I ask for help from members of the Please, recommend a python library with the properties described above and then we will be able to implement support for |
Beta Was this translation helpful? Give feedback.
-
Math support in Markdown |
Beta Was this translation helpful? Give feedback.
-
I recently received an email.
Example.
Beta Was this translation helpful? Give feedback.
All reactions