I have more open question about general problem with knitr that I recently discovered. When I compile documents via shiny simply with:
output$report = downloadHandler(
filename = reactive({paste0(input$filename,'.pdf')}),
content = function(file) {
out = knit2pdf(input = 'pdf_shell.Rnw')
file.rename(out, file)
},
contentType = 'application/pdf'
)
Some latex packages as eso-pic
or hyperref
are not working and result in error Running ' texi2div ' on ' pdf_shell.tex ' failed
. Including compiler = 'xelatex'
into the knit2pdf
helps with some functionality but corrupts other (For instance, \TextField
function does not work and covers text).
Therefore, my question is does anyone know how I could compile the PDF using default compiler pdflatex
, without getting the above mentioned error? Or you maybe have any pro tips that could solve the problems differently. Any input is much appreciated.
edit: I have to mention that when I run the app through R Studio everything works fine. App functionality ( and latex packages) breaks when I upload it to the shinyapps.io
edit 2: I discovered that when I include in my .Rnw file additional backslash the file compiles correctly. So version that is not working:
\begin{Form}
\begin{tabularx}{\textwidth}{p{8cm}}
Description \\
\TextField[name=1, multiline=true, width=\linewidth,height=0.6in, bordercolor = 1 1 1, charsize=0pt]{} \\
\end{tabularx}
\end{Form}
Version that works:
\begin{Form}
\begin{tabularx}{\textwidth}{p{8cm}}
Description \\\
\TextField[name=1, multiline=true, width=\linewidth,height=0.6in, bordercolor = 1 1 1, charsize=0pt]{} \\\
\end{tabularx}
\end{Form}
Is someone able to explain my why it is the case?