Why do HTML and PDF rmarkdown files react differently to the 'child =' code chunk option?

113 views
Skip to first unread message

Joe Hightower

unread,
Sep 28, 2017, 3:28:31 PM9/28/17
to knitr
If I give up on the idea of having separate folders to keep report .Rmd files in the app folder I can make the HTML work just fine. In the YAML the document type is set to html_document.  All the work appears to be done in a temporary folder as required.  each child document is correctly located and included in the report. 

But If I do exactly the same thing with the YAML header now set to pdf_document and using pdflatex as the latex engine, NONE of the children documents can be located, EVEN THOUGH they are in exactly the same folder as the html child files, and are specified in exactly the same way.

What the heck is wrong?

HTML Version: 

---
output: html_document
runtime: shiny
params:
  Author:  NA
  Title:  NA
  Date:  NA
  AR:  NA
  P10:  NA
  OID:  NA
  OIO:  NA
  DID:  NA
  DIO:  NA
  IID:  NA
  IIO:  NA
  lkMtrx:  NA
  rskMtrx:  NA
  ddir:  NA
---

<center> <h1>A Risk Analysis Report for `r params$Title`</h1> </center>


<center> <h3>Authored by: `r params$Author`</h1> </center>

<center> <h3>`r params$Date`</h1> </center>

<br> </br>
<br> </br>


```{r child = "introductionQA.Rmd"}
```

```{r child = 'summaryQA.Rmd'}
```

```{r child = 'resultsQA.Rmd'}
```

```{r child = 'LikeresultsQA.Rmd'}
```

```{r child = 'RiskresultsQA.Rmd'}
```


PDF File Version:

---
output:
  pdf_document: 
    latex_engine: pdflatex
header-includes:
- \usepackage{pdflscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
always_allow_html: yes
fontsize: 12pt
geometry: margin=0.75in
sansfont: Clibri Light
fig_width: 3
fig_heigth: 2
params:
  Author:  NA
  Title:  NA
  Date:  NA
  AR:  NA
  P10:  NA
  OID:  NA
  OIO:  NA
  DID:  NA
  DIO:  NA
  IID:  NA
  IIO:  NA
  lkMtrx:  NA
  rskMtrx:  NA
  ddir:  NA
---

\begin{center}
\bfseries\LARGE A Risk Analysis Report for `r params$Title`
\end{center}

\begin{center}
\bfseries\Large Authored by: `r params$Author`
\end{center}

\begin{center}
\bfseries\Large `r params$Date`
\end{center}

<br> </br>
<br> </br>

<br> </br>


```{r child = 'introductionQA_PDF.Rmd'}
```

```{r child = 'summaryQA_PDF.Rmd'}
```

```{r child = 'resultsQA_PDF.Rmd'}
```

```{r child = 'LikeresultsQA_PDF.Rmd'}
```

```{r child = 'RiskresultsQA_PDF.Rmd'}
```


Reply all
Reply to author
Forward
0 new messages