Mathematics Diagram
Use the online version of “Mathcha“.
Use the “GeoGebra“ application which is available on “macOS/iOS”.
Mathematics Equation(Markdown + LateX)
Plan A: write LaTeX in markdown content directly
Install MacTeX
MacTeX is required by the “pandoc” command below. So please install it from this, or install the basic version(which is smaller and I installed this version) from this.
Use the following command to convert “markdown + Latex” into HTML file(from this):
1
2
3
4
5
6
7
8
9
10
11# Export to HTML.
pandoc --standalone --mathjax -f markdown -t html sample.md -o sample.html
# Export to PDF(it seems the full version of "MacTeX" is required by this,
# otherwise the Chinese characters cannot be displayed properly).
# You may be prompted "weasyprint not found. Please select a different
# --pdf-engine or install weasyprint", if so, install it first with
# "brew install weasyprint".
pandoc sample.md --pdf-engine=xelatex -V CJKmainfont="PingFang SC" \
--from=markdown+raw_html --resource-path=.:svg \
-V geometry:margin=1.5cm -o sample.pdfUse the online tool “latex2image-web“ to convert a given LaTeX expression to local image(SVG/PNG) file.
Plan B: use online “markdown+LaTeX” editor
Use the online editor “upmath“ to write the markdown, and render the generated HTML content into PDF with the printing feature provided by browser like Chrome.
Content of “sample.md”
Here is the file content used in the commands above. The “./svg/equation.svg” file is an equation image made with “latex2image-web“.
1 | # Abstract |