title: Print long strings of text LaTeX / Sweave
body: <p>At the end of a survey I've conducted, we give respondents an open ended box to tell us anything we didn't cover in the survey.These comments will often span several pages. I am familiar with the <code>longtable</code> package for LaTeX and here is the solution I have mocked up:</p>
  
  <pre><code>&lt;&lt;results = tex&gt;&gt;=
  cat("\\begin{longtable}{p{14cm}}\n")
  cat("\\hline\n")
  write.table(toBePrinted, eol = "\\\\\n", col.names = FALSE)
  cat("\\hline\n")
  cat("\\end{longtable}")
  @
  </code></pre>
  
  <p>While this solution technically works, it doesn't look terribly polished and needs to be improved. I have two related questions:</p>
  
  <ol>
  <li>Text sanitation tips for Sweave output that is to be treated as <code>tex</code>. For example, if someone says <code>Your survey is awesome &amp; I would take more surveys for  $$$ 100% of the time!</code> the special characters <code>&amp;, $, %</code> reak havok when processing through <code>LaTeX</code>. Is there something more efficient than a list of <code>gsub</code> calls to replace the offending characters with something benevolent?</li>
  <li>Suggestions for a better way to print these long comments with <code>Sweave &amp; LaTeX</code>.</li>
  </ol>