title: R gt package: error in latex ("there's no line here to end")
body: <p>I am trying to include a table generated with the gt() function in a tex file. I create a .Rnw file, then weave it with knitr and compile with pdflatex. During compilation I get an error: "there no line here to end", caused by a newline inserted by gt() in the table header. This is a MWE:</p>
  
  <pre><code>\documentclass{article}
  \usepackage[utf8]{inputenc}
  \usepackage{booktabs}
  \usepackage{longtable}
  \usepackage{caption}
  
  \begin{document}
  &lt;&lt;setup, include=FALSE&gt;&gt;=
  library(knitr)
  library(tidyverse)
  library(gt)
  opts_chunk$set(echo=FALSE)
  @
  
  This is a dataframe formatted with the \texttt{gt} package.
  
  &lt;&lt;&gt;&gt;=
  tibble(
    group=rep(c("A", "B"), each=5),
    age = c(20, 24, 22, 27, 29, 21, 24, 23, 30, 31)) %&gt;%
      gt %&gt;%
        tab_header(title="Some title")
  @
  
  \end{document}
  </code></pre>
  
  <p>The resulting table in the tex file is:</p>
  
  <pre><code>\begin{longtable}{lr}
  \caption*{
  \large Some title\\ 
  \small \\ % This newline causes the error
  } \\ 
  \toprule
  group &amp; age \\ 
  \midrule
  A &amp; 20 \\ 
  A &amp; 24 \\ 
  A &amp; 22 \\ 
  A &amp; 27 \\ 
  A &amp; 29 \\ 
  B &amp; 21 \\ 
  B &amp; 24 \\ 
  B &amp; 23 \\ 
  B &amp; 30 \\ 
  B &amp; 31 \\ 
  \bottomrule
  \end{longtable}
  </code></pre>
  
  <p>(I added the comment manually after weaving)</p>
  
  <p>Because of the newline (<code>\\</code>) in the caption I get: <code>./mwe.tex:69: LaTeX Error: There's no line here to end</code>. Without that newline, the PDF is created as expected. Is there a way to fix this without having to manually edit the tex file?</p>