title: knitr: code in chunks gets wrapped unexpectedly
body: <p>In a beamer presentation using knit2pdf() and LaTeX, I sometimes
  find that code in chunks gets wrapped, even though I have set
  <code>tidy=FALSE</code> globally.  For example, this chunk:</p>
  <pre><code>\item Fit this using \func{glm}:
  &lt;&lt;berk-logit2, size='footnotesize'&gt;&gt;=
  berkeley &lt;- as.data.frame(UCBAdmissions)
  berk.logit2 &lt;- glm(Admit == &quot;Admitted&quot; ~ Dept + Gender,
                     data = berkeley, weights = Freq, family = &quot;binomial&quot;)
  @
  </code></pre>
  <p>Appears like this:</p>
  <p><a href="https://i.stack.imgur.com/ZuXeV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZuXeV.png" alt="enter image description here" /></a></p>
  <p>Note that all three lines are wrapped, as if in paragraph mode. The indented line in the code chunk uses spaces, not tabs.</p>
  <p>When I look at the .tex file produced, nothing looks strange, that is the lines given to <code>alltt</code> look OK.</p>
  <pre><code>\item Fit this using \func{glm}:
  \begin{knitrout}\footnotesize
  \definecolor{shadecolor}{rgb}{1, 0.961, 0.933}\color{fgcolor}\begin{kframe}
  \begin{alltt}
  \hlstd{berkeley} \hlkwb{&lt;-} \hlkwd{as.data.frame}\hlstd{(UCBAdmissions)}
      \hlstd{berk.logit2} \hlkwb{&lt;-} \hlkwd{glm}\hlstd{(Admit} \hlopt{==} \hlstr{&quot;Admitted&quot;} \hlopt{~} \hlstd{Dept} \hlopt{+} \hlstd{Gender,}
                         \hlkwc{data} \hlstd{= berkeley,} \hlkwc{weights} \hlstd{= Freq,} \hlkwc{family} \hlstd{=} \hlstr{&quot;binomial&quot;}\hlstd{)}
  \end{alltt}
  \end{kframe}
  \end{knitrout}
  </code></pre>
  <p>Most other chunks produce the properly formatted output.  E.g.,</p>
  <pre><code>&lt;&lt;mice-tab, size='footnotesize' &gt;&gt;=
  data(Mice, package=&quot;vcdExtra&quot;)
  mice.tab &lt;- xtabs(Freq ~ litter + treatment + deaths, data=Mice)
  ftable(litter + treatment ~ deaths, data=mice.tab)
  @
  </code></pre>
  <p>gives:
  <a href="https://i.stack.imgur.com/yFGJi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yFGJi.png" alt="enter image description here" /></a></p>
  <p>What could be causing this?  My setup is complex, so I don't have a MWE, but it would be helpful if I knew what to look for.</p>