當我使用LaTeX宏(例如\ newcommand)時,它佔用頁面中的空間。這裏是一個示例代碼來演示我面臨的問題。MathJax中的 newcommand宏不必要的額外空間
代碼:
<!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>
我該如何擺脫這個額外的空間?
從未來注:CDN .mathjax.org即將結束生命週期,請查看https://www.mathjax.org/cdn-shutting-down獲取遷移提示(也許可以爲未來的讀者更新您的文章)。 – 2017-04-21 07:48:27