1

I read here how to add what is needed to give me the ability to change my page to landscape: enter link description here

However I have saved the header.tex file everyplace I could think of and I still end up getting the following error:

Called from: (function (e) 
{
if (inherits(e, "shiny.silent.error")) 
    return()
handle <- getOption("shiny.error")
if (is.function(handle)) 
    handle()
})(list(message = "pandoc document conversion failed with error 43", 
call = NULL))
Browse[1]> 

I know this is do to me typing \blandscape and \elandscape because the PDF works as soon as I delete those commands. What I need help with is figuring out where to save the header.tex file to so that Rmarkdown knows how to locate it. Thanks in advance for everyone's your help!

Follow up: Taking scoa's advice about adding it to my header I edited the top of my Rmd file to the following. Unfortunately it still didn't work.

---
title: "Lake Report"
output: pdf_document
header-includes:
- \usepackage{lscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
---
\newpage
\blandscape
```{r Non-Seasonal MK results, echo=FALSE}
# MKanalysis <- reactive(HM_MK(data = NonSeasonalData(),n = 4))
kable(MKanalysis(), caption = "Non-Seasonal Trend Analysis")
```
The results of the Mann Kendall analysis....
\elandscape

Latex program/verision: pdfTex, Version 3.14159265-2.6-1.40.17

Community
  • 1
  • 1
Tj Laroue
  • 23
  • 7
  • to debug the issue, it usually helps to convert to latex first (`pandoc input.md -o file.tex`) and running that with `pdflatex file.tex` to see what exactly the issue is... – mb21 Dec 17 '16 at 11:23
  • The issue is that Rmarkdown is unable to recognize the commands \blandscape and \elandscape. When those two commands are removed the PDF exports. Thanks for your help! – Tj Laroue Dec 19 '16 at 13:35

1 Answers1

2

Save the header.tex in the same directory your Rmd file is. Also, rather than an external file, you could just add those commands in your yaml front matter, a more portable solution:

---
title: "Lake Report"
output: pdf_document
header-includes:
- \usepackage{lscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
---
scoa
  • 19,359
  • 5
  • 65
  • 80
  • --- title: "Lake Report" output: pdf_document: header-includes: - \usepackage{lscape} - \newcommand{\blandscape}{\begin{landscape}} - \newcommand{\elandscape}{\end{landscape}} --- – Tj Laroue Dec 16 '16 at 13:50
  • I tried your new edits and I still get the same error. At the top is what I changed it to – Tj Laroue Dec 16 '16 at 15:31
  • Do I need to add usepackage{lscape} to my code or install something? Sorry if this is painstakingly easy, I am fairly new to Rmarkdown! – Tj Laroue Dec 16 '16 at 15:55
  • your example works fine on my machine. It may depend on your latex installation – scoa Dec 16 '16 at 15:58
  • I currently have pdfTex, Version 3.14159265-2.6-1.40.17 is there a better LaTex program you would recommend that would be better? – Tj Laroue Dec 16 '16 at 19:12