html - 从 Latex 和 Pandoc 创建的 Mathjax 中方程的标签和引用
问题描述
我是 Mathjax 的新手,如果我的问题很明显,我很抱歉。浏览互联网对我没有帮助。
我尝试从乳胶文件 test.tex 生成一个 html 页面,并引用标记的方程。
我的乳胶文件
\documentclass[12pt]{article}
\begin{document}
An equation
\begin{equation}
\label{test}
x=3.
\end{equation}
Here a reference to equation (\ref{test}).
\end{document}
命令生成的html代码:pandoc test.tex -s --mathjax -o test.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>test</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" type="text/javascript"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<p>An equation <span class="math display">\[\label{test}
x=3.\]</span> Here a reference to equation (<a href="#test" data-reference-type="ref" data-reference="test">[test]</a>).</p>
</body>
</html>
我的 Chrome 浏览器中的结果,方程式没有标签,并且参考不是我想要的:
谢谢你的帮助 !
解决方案
推荐阅读
- swift - 如何在 Swift 5 中获得安全区域顶部和底部插图
- python-requests - Python-如何解决【WinError 10061】No connection could be made because the target machine主动拒绝
- php - POST请求上的laravel 7 api CSRF令牌不匹配
- vb.net - vb.net 构造后触发
- javascript - 我无法将表单输入中的数据添加到 Firestore 集合中,也无法找出问题所在
- python - 带有字符串和整数的递归函数
- python - Python添加文本和合并视频文件
- python - 2 个已处理的共享内存(应用程序崩溃)
- javascript - 将颜色转换为图像?
- javascript - 无法从发出的事件接收有效负载 - Socket.io