<p>I <a href="https://stats.meta.stackexchange.com/q/1792/1390">recently came across</a> the niggle of odd formatting of code chunks when the code chunk includes R syntax with a number of <code>$</code> characters. @whuber <a href="https://stats.meta.stackexchange.com/a/1793/1390">has suggested a workaround</a> that involves adding an extra <code>$</code> in a comment, which resolves the problem.</p>

<p>As my question showed, the problem doesn't arise if one explicitly marks the block up with <code>&lt;pre&gt;...&lt;/pre&gt;</code> tags, presumably because the chunk is included verbatim and not rendered by the Markdown (MD) processor. However, there are subtle differences in styling of blocks marked up  with <code>&lt;pre&gt;...&lt;/pre&gt;</code> tags and those marked as code chunks in MD. The latter are rendered as <code>&lt;pre&gt;&lt;code&gt;....&lt;/code&gt;&lt;/pre&gt;</code>.</p>

<p>Is it possible to tweak the CSS here to render plain <code>&lt;pre&gt;....&lt;/pre&gt;</code> marked sections with the same styles as <code>&lt;pre&gt;&lt;code&gt;....&lt;/code&gt;&lt;/pre&gt;</code>? That would make using this as a work around less noticeable but not require the user to remember to nest <code>&lt;code&gt;</code> within <code>&lt;pre&gt;</code> to get the required styling?</p>

<h3>Example</h3>

<p>First a standard code block indicated using MD</p>

<pre><code>foo &lt;- lm(y ~ x1 + x2)
summary(foo)
</code></pre>

<p>Next a chunk entered as verbatim HTML via <code>&lt;pre&gt;...&lt;/pre&gt;</code> tags only</p>

<pre>
foo &lt;- lm(y ~ x1 + x2)
summary(foo)
</pre>

<p>Finally, a chunk entered verbatim but wrapped in <code>&lt;pre&gt;&lt;code&gt;...&lt;/code&gt;&lt;/pre&gt;</code></p>

<pre><code>foo &lt;- lm(y ~ x1 + x2)
summary(foo)
</code></pre>

<p>Notice the subtle styling differences in sizes.</p>
