rticles and rmarkdown not removing table of contents - r

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.

Related

Add space between Author, Date, and Abstract in YAML header

My YAML header looks like this, and I would like to change only the space between the author/date, and abstract.
How can I achieve this? I have tried using \vspace{1cm} after the date (failed), and also at the start of the abstract text, but that only spaces the text, and not "Abstract" itself.
Any ideas?
---
title:
subtitle:
author: "Me "
date: "`r format(Sys.time(), '%B %d, %Y')`"
abstract: "The document shows the answer to all questions & the output (as it relates to each)"
output:
pdf_document:
keep_tex: false
toc: false
---
With an up-to-date latex installation, you can use the hook system to add a bit of space before the abstract environment or the \#date macro which inserts the date:
---
title: "test"
subtitle:
author: "Me "
date: "`r format(Sys.time(), '%B %d, %Y')`"
abstract: "The document shows the answer to all questions & the output (as it relates to each)"
output:
pdf_document:
keep_tex: false
toc: false
header-includes:
- \AddToHook{env/abstract/before}{\vspace*{4cm}}
- \makeatletter\AddToHook{cmd/#date/before}{\vspace*{4cm}}\makeatother
---
\maketitle
test

How can I add a table of contents in R Markdown?

I'm having a hard time trying to add a table of contents in R Markdown.
I want the table of contents to be on the left side of the document.
I tried this code, but it didn't work for me (when I knitr the document, it works fine, but the TOC is not available):
---
title: "Relatório VANT - P&D"
author: "Empresa: XXXX"
date: "Data: 24/05/2020"
output:
html_document:
toc: true
toc_float: true
---
How can I solve my problem?
It is important to indent toc, e.g.
---
title: "Relatório VANT - P&D"
author: "Empresa: XXXX"
date: "Data: 24/05/2020"
output:
html_document:
toc: true
toc_float: true
---
# h1
# h2
# h2.2

R Markdown affiliation doesn't appear in the pdf-document

I want to add the affiliation and the e-mail adress in a pdf-article in r-markdown. But with my code the affiliation and the e-mail adress doesn't appear.
Can someone tell me what I'm doing wrong?
---
title: "title"
subtitle: "subtitle"
date: "`r format(Sys.time(), '%B %d, %Y')`"
keywords: "keywords"
author:
-name: My Name
affiliation: University of somewhere
email: test#e-mail.com
output:
pdf_document:
fig_cap: yes
keep_tex: yes
bibliography: references.bib
biblio-style: "apalike"
link-citations: true
documentclass: article
capsize: normalsize
fontsize: 11pt
geometry: margin=1in
spacing: doublespacing
footerdate: yes
abstract: 'Insert abstract here'
---
Here is the Output with the help of the BiocManager-package.
Two things :
Space between "-" and "name" ?
Did you import BiocStyle 2.11.0 ?
src : https://www.bioconductor.org/packages/devel/bioc/vignettes/BiocStyle/inst/doc/AuthoringRmdVignettes.html
It's only a supposition, hope it'll do the job !
The regular pdf_document output format doesn't support affiliation etc. You need to output to BiocStyle::pdf_document. You also have the formatting for the author specification wrong, which causes troubles.
---
title: "title"
subtitle: "subtitle"
date: "`r format(Sys.time(), '%B %d, %Y')`"
keywords: "keywords"
author:
- name: My Name
affiliation: University of somewhere
email: test#e-mail.com
output:
BiocStyle::pdf_document:
fig_cap: yes
keep_tex: yes
bibliography: references.bib
biblio-style: "apalike"
link-citations: true
documentclass: article
capsize: normalsize
fontsize: 11pt
geometry: margin=1in
spacing: doublespacing
footerdate: yes
abstract: 'Insert abstract here'
---
To install BiocStyle if you haven't already got it, you first need to install BiocManager in the regular way, then use it to install BiocStyle:
install.packages("BiocManager")
BiocManager::install("BiocStyle")

How can we pass pandoc_args to yaml header in rmarkdown?

I'm using rmarkdown to produce a word (.docx) report. I would like to change the header of the toc. This seems possible as pandoc_args can be passed as options in the yaml header in the case of a doc file (1). But I'm not doing it right. Could anyone provide a working example ?
(1) pandoc.args is included in the rmarkdown possible options and in the pandoc manual, there is a toc-title option
---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
pandoc_args: toc-title="Table des matières"
---
# One section
# Another
This produces :
The title of the table of contents is document metadata, so you can set it with YAML metadata block.
---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
toc-title: "Table des matières"
---
Or passed it in with the -M command-line flag.
---
title: "yaml header"
author: "cedric"
output:
word_document:
toc: true
pandoc_args: [
"-M", "toc-title=Table des matières"
]
---

How to force chapters start by uneven index page

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

Resources