
我的 LaTeX 程式碼在foo.tex
:
\documentclass{article}
\usepackage{amsmath}
\title{Demo}
\begin{document}
\begin{align}
1 + 0 & = 1, \label{eq1} \\
1 + 1 & = 2. \label{eq2}
\end{align}
Equation \( \eqref{eq1} \) and \( \eqref{eq2} \) describe eternal
truths.
\end{document}
template.html
我要提供的HTML 範本檔案pandoc
:
<!DOCTYPE html>
<html lang="en">
<head>
<title>$title$</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>window.MathJax = {tex: {tags: 'ams'}}</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
$body$
</body>
</html>
我的 Pandoc 指令:
pandoc foo.tex --template=template --standalone --mathjax -o foo.html
輸出文件的樣子foo.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>window.MathJax = {tex: {tags: 'ams'}}</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<p><span class="math display">\[\begin{aligned}
1 + 0 & = 1, \label{eq1} \\
1 + 1 & = 2. \label{eq2}\end{aligned}\]</span></p>
<p>Equation <span class="math inline">\(\eqref{eq1}\)</span> and <span class="math inline">\(\eqref{eq2}\)</span> desc[![enter image description here][1]][1]ribe eternal truths.</p>
</body>
</html>
這裡的問題是,pandoc
我的align
環境已經改變了aligned
,所以我不再得到方程式編號。
我的問題:
- 是否有可能告訴
pandoc
人們停止擾亂align
環境並將其改為aligned
環境?有沒有辦法讓它們完好無損? - 如果無法
pandoc
停止破壞align
環境,我該如何解決這個問題並使方程式編號發揮作用?