title: How do I escape double backslashes for MathJax?
body: <p>I make MathJax work with WordPress by adding the following code to <code>footer.php</code>. It works for simple math symbols and equations.</p>
  
  <pre><code>&lt;script type="text/x-mathjax-config"&gt;
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"] ],
              processEscapes: true
      }
  });
  &lt;/script&gt;
  
  &lt;script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But it doesn't work for the equations with multiline, such as,</p>
  
  <p><a href="https://i.stack.imgur.com/Fn4lt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fn4lt.png" alt="enter image description here"></a></p>
  
  <p>It is rendered as one line as shown below.</p>
  
  <p><a href="https://i.stack.imgur.com/aKkuH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aKkuH.png" alt="enter image description here"></a></p>
  
  <p>This is caused by rendering <code>\\</code> as <code>\</code> by default in WordPress or markdown editor. One possible solution is to turn all <code>\\</code> within <code>$$...$$</code> into <code>\\\\</code>. </p>
  
  <p>I expect I can use <code>\\</code> as a line break directly. It works on <a href="https://stackedit.io/" rel="nofollow noreferrer">StackEdit</a>, but I don't know how, probably escaping <code>\\</code> for MathJax. </p>
  
  <hr>
  
  <p>Here is the source code. (I use markdown editor.)</p>
  
  <pre><code>$$
  \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) &amp; \ell(p_1,p_2) &amp; \cdots &amp; \ell(p_1,p_N) \\
  \ell(p_2,p_1) &amp; \ddots &amp;  &amp; \vdots \\
  \vdots &amp; &amp; \ell(p_i,p_j) &amp; \\
  \ell(p_N,p_1) &amp; \cdots &amp; &amp; \ell(p_N,p_N)
  \end{bmatrix} 
  \cdot
  \begin{bmatrix}
  PR(p_1) \\
  PR(p_2) \\
  \vdots \\
  PR(p_N)
  \end{bmatrix}
  $$
  </code></pre>