<p>In an <a href="https://stats.stackexchange.com/a/70529/1390">answer of mine on CV</a> I have the following code chunk, indicated via indentation by 4 spaces at the start of the line.</p>

<pre>
> AIC(gam_example$lme)
[1] -2.136317
&gt; AIC(gamm_example$lme)
[1] -1286.448
</pre>

<p>(Note that to illustrate this I have wrapped the above in HTML <code>&lt;pre&gt;</code> tags - the layout above is how it was entered in the edit window in the Answer.)</p>

<p>The displayed code block is rendered as</p>

<pre>
> AIC(gam_example$lme)
    [1] -2.136317
    &gt; AIC(gamm_example$lme)
[1] -1286.448
</pre>

<p>(Again, here this is wrapped in <code>&lt;pre&gt;</code> in the editor, but only to show the problem.)</p>

<p>Clearly the alignment in the code block is wrong. I wonder if this is something to do with MathJax (note the <code>$</code> in both chunks). Compare these two blocks, both entered without <code>&lt;pre&gt;</code> tags in the editor:</p>

<pre><code>&gt; AIC(gam_example$lme)
[1] -2.136317
&gt; AIC(gamm_example$lme)
[1] -1286.44
</code></pre>

<p>and</p>

<pre><code>&gt; AIC(gam_example$lme)
[1] -2.136317
&gt; AIC(gamm_example)
[1] -1286.44
</code></pre>

<p>The first chunk of these two is a live example of the problem I report here. Note the lack of a second <code>$</code> in the second code block allows this to render with the correct, intended alignment.</p>

<p>Is there anything that can be done about this, or is it an unfortunate clash of R syntax and MathJax? Or something else?</p>
