How to force chapters start by uneven index page - r

I need my thesis chapters start by uneven index page.
My YAML header is:
---
output:
pdf_document:
number_sections: true
toc_depth: 4
fontsize: 11pt
geometry: margin=1in
header-includes:
- \usepackage[spanish]{babel}
- \usepackage{cite}
- \usepackage{xcolor}
- \definecolor{grey}{rgb}{0.9,0.9,0.9}
- \usepackage{array}
- \usepackage{multirow}
bibliography: biblio.bib
csl: biomed-central.csl
link-citations: true
---
Some LaTeX packages?

No packages, it's part of the documentclass. To do this in knitr, add these to your YAML header:
classoption: twoside
classoption: openright

Related

Using custom LaTeX class changes numbering in R Markdown

I recently discovered that you can include your own LaTeX class in an R-Markdown doc to change the appearance of the PDF. Here is a minimal example:
R Markdown
---
title: "Test"
date: "`r format(Sys.time(), '%d %B, %Y')`"
documentclass: book
output:
pdf_document:
citation_package: natbib
toc: yes
toc_depth: 3
number_sections: true
fontsize: 12pt
---
# A
## AA
### AAA
### AAA
## AB
# B
This works as intended.
But when I define my own class, the numbering is preceded by 0s and the page numbering is off.
myclass.cls
I place a file called "myclass.cls" in the same direcoty as the RMD file above and change documentclass: myclass:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{glasgowthesis}
\LoadClass{book}
My understanding is that this should simply call the same class as above but the file now looks like this:
Maybe somebody can give me a hint what I'm doing wrong. I would like to copy the book class 1:1 before starting to change things.
I found the solution in the bookdown book and wanted to share it in case anyone wanders off to this question through google etc.
Note that when you change documentclass, you are likely to specify an
additional Pandoc argument --top-level-division=chapter so that Pandoc
knows the first-level headers should be treated as chapters instead of
sections (this is the default when documentclass is book)
So this YAML header solved the issue:
---
title: "Test"
date: "`r format(Sys.time(), '%d %B, %Y')`"
documentclass: myclass
output:
pdf_document:
pandoc_args: --top-level-division=chapter
citation_package: natbib
toc: yes
toc_depth: 3
number_sections: true
fontsize: 12pt
---
# A
## AA
### AAA
### AAA
## AB
# B

rticles and rmarkdown not removing table of contents

I cannot seem to remove the table of contents from my RMarkdown pdf document. I have tried a number of different things such as.
Changing toc: no to false
using differrent base_format: rticles::ieee_article artiles from the getNamespaceExports("rticles").
removing csl: elsevier-harvard.csl
Nothing seems to work and everytime I compile the table of contents appears - what am I missing?
Markdown:
---
title: some title
author:
- name: some name
email: some email
affiliation: some department
footnote: some footnote
- name: some name
email: some email
affiliation: some department
footnote: 2
footnote:
- code: 1
text: "Corresponding Author"
- code: 2
text: "Corresponding Author"
abstract: |
some abstract here
journal: "An awesome journal"
date: "`r Sys.Date()`"
bibliography: mybibfile.bib
#linenumbers: true
#numbersections: true
csl: elsevier-harvard.csl
output:
bookdown::pdf_document2:
base_format: rticles::ieee_article
number_sections: no
toc: no
tables: true
header-includes:
- \usepackage{floatrow}
- \floatplacement{figure}{H}
- \usepackage{booktabs}
- \usepackage{array}
---
Try to format your output section of the YAML header as follows:
output:
bookdown::pdf_document2:
number_sections: no
toc: no
tables: true
base_format: rticles::ieee_article
Then the TOC should disappear. I hope that the base_format argument will be taken into consideration. Please try and report.

How to wrap output in R markdown using pdf_document

How do I get this result in which both the source code and the output appear wrapped by a line in R markdown using a pdf_document.
My yaml is configured as follows:
---
title: 'Applied Econometrics using R'
subtitle: 'Federal University of Paraiba'
author: 'Alexandre Loures'
date: "`r Sys.Date()`"
documentclass: book
bibliography: [econometrics.bib]
biblio-style: apalike
link-citations: yes
colorlinks: yes
lot: yes
lof: yes
output:
html_document:
theme: united
pdf_document:
highlight: tango
description: "A book example for a Chapman & Hall book."
github-repo: yihui/bookdown-crc
graphics: yes
#cover-image: images/cover.jpg
---

unnumbered special headers in rmarkdown [duplicate]

I have an rmarkdown document (.Rmd) that I want to knit into a pdf document. number_sections has been put to 'yes' and toc to 'true'. How can I add appendix sections that appear in the table of contents but don't have a section number?
Here is an example .Rmd code. How can I let appendix A and appendix B be numberless sections and let them appear in the table of contents at the same time?
---
title: "Test"
author: "test test"
geometry: margin=1in
output:
pdf_document:
keep_tex: yes
latex_engine: xelatex
number_sections: yes
toc: yes
toc_depth: 3
header-includes:
- \usepackage[dutch]{babel}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LE,RO]{this is a fancy foot}
- \usepackage{dcolumn}
- \usepackage{here}
- \usepackage{longtable}
- \usepackage{caption}
- \captionsetup{skip=2pt,labelsep=space,justification=justified,singlelinecheck=off}
subtitle: test test test
fontsize: 12pt
---
# start
# second
```{r results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA,fig.height=4}
cat("and here some R")
```
# appendix A
# appandix B
Just add {-} after the section name. Thus, for your appendices, you should do something like:
# appendix A {-}
# appendix B {-}
For more details, see this section of the docs.
Result:

How to make part of rmarkdown document without section numbering?

I have an rmarkdown document (.Rmd) that I want to knit into a pdf document. number_sections has been put to 'yes' and toc to 'true'. How can I add appendix sections that appear in the table of contents but don't have a section number?
Here is an example .Rmd code. How can I let appendix A and appendix B be numberless sections and let them appear in the table of contents at the same time?
---
title: "Test"
author: "test test"
geometry: margin=1in
output:
pdf_document:
keep_tex: yes
latex_engine: xelatex
number_sections: yes
toc: yes
toc_depth: 3
header-includes:
- \usepackage[dutch]{babel}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LE,RO]{this is a fancy foot}
- \usepackage{dcolumn}
- \usepackage{here}
- \usepackage{longtable}
- \usepackage{caption}
- \captionsetup{skip=2pt,labelsep=space,justification=justified,singlelinecheck=off}
subtitle: test test test
fontsize: 12pt
---
# start
# second
```{r results="asis",eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE, comment = NA,fig.height=4}
cat("and here some R")
```
# appendix A
# appandix B
Just add {-} after the section name. Thus, for your appendices, you should do something like:
# appendix A {-}
# appendix B {-}
For more details, see this section of the docs.
Result:

Resources