Ich mache MathJax mit WordPress arbeiten, indem Sie den folgenden Code footer.php
hinzufügen. Es funktioniert für einfache mathematische Symbole und Gleichungen.Wie entkomme ich doppelte Backslashes für MathJax?
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
Aber es funktioniert nicht für die Gleichungen mit mehrzeiligen arbeiten, wie
Es wird als eine Linie wiedergegeben, wie unten dargestellt.
Dies wird durch Rendering \\
als \
standardmäßig in Wordpress oder Abschlag Editor verursacht. Eine mögliche Lösung besteht darin, alle \\
innerhalb $$...$$
in \\\\
zu schalten.
Ich erwarte, dass ich \\
als einen Zeilenumbruch direkt verwenden kann. Es funktioniert auf StackEdit, aber ich weiß nicht, wie, wahrscheinlich entkommen \\
für MathJax.
Hier ist der Quellcode. (Ich benutze Abschlags-Editor.)
$$
\begin{bmatrix}
PR(p_1) \\
PR(p_2) \\
\vdots \\
PR(p_N)
\end{bmatrix} =
\begin{bmatrix}
{(1-d)/ N} \\
{(1-d)/N} \\
\vdots \\
{(1-d)/N}
\end{bmatrix}
+ d
\begin{bmatrix}
\ell(p_1,p_1) & \ell(p_1,p_2) & \cdots & \ell(p_1,p_N) \\
\ell(p_2,p_1) & \ddots & & \vdots \\
\vdots & & \ell(p_i,p_j) & \\
\ell(p_N,p_1) & \cdots & & \ell(p_N,p_N)
\end{bmatrix}
\cdot
\begin{bmatrix}
PR(p_1) \\
PR(p_2) \\
\vdots \\
PR(p_N)
\end{bmatrix}
$$
Hinweis aus der Zukunft: cdn.mathjax.org wird seine End-of-Life kurz vor, überprüfen https://www.mathjax.org/cdn-shutting-down/ für Migration Tipps. –