当我使用 LaTeX 宏(例如 \newcommand)时,它会占用页面中的空间。这是一个示例代码来演示我面临的问题。
网址:http: //jsfiddle.net/Lkeus/
代码:
<!DOCTYPE html>
<html>
<head>
<title>MathJax Example</title>
<script
type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default">
</script>
</head>
<body>
<p>
\(\newcommand{\N}{\mathbb{N}}\)
\(\newcommand{\R}{\mathbb{R}}\)
\(\newcommand{\Z}{\mathbb{Z}}\)
Let \(x \in \N\). Then \(x^2\) is called a perfect square.
</p>
<p>
Let \(x \in \N\). Then \(x^2\) is called a perfect square.
</p>
</body>
</html>
这是它自己页面中的输出:http: //fiddle.jshell.net/Lkeus/show/
在输出中,您可以看到第一行在一些空格之后开始。这个空间来自那里使用宏。Firebug 将 MathJax 创建的这段代码显示为额外空间的原因:
<span class="math" id="MathJax-Span-1">
<span style="display: inline-block; position: relative; width: 0em;
height: 0pt; font-size: 130%;">
<span style="position: absolute; top: -1em; left: 0em; clip:
rect(0.856em, 1000em, 1.144em, -0.433em);">
<span class="mrow" id="MathJax-Span-2"></span>
<span style="display: inline-block; width: 0pt; height: 1em;"></span>
</span></span>
<span style="border-left: 0em solid; display: inline-block; overflow:
hidden; width: 0pt; height: 0em; vertical-align: 0em;"></span></span>
我怎样才能摆脱这个额外的空间?