I am preparing a Quarto presentation using beamer and would like to add the frame number at the bottom of each slide (analogous to the slide-number option in revealjs).
Could anybody tell me how I can do this?
I already figured out that the slide-number option does not exist for beamer.
Alternatively, you can control it yourself like this (see here)
---
title: "Presentation"
format:
beamer:
aspectratio: 32
navigation: horizontal
header-includes: |
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[page number]
---
# Intro
## second slide
The default theme does not include slide numbering, but you could use one with, e.g. Boadilla:
---
title: "Slide numbering in Beamer"
format:
beamer:
theme: Boadilla
editor: visual
---
Related
Anyone a suggestion how to set the header and footer of a #quarto .qmd #rstats pdf?
I tried this, but no footer shows:
---
title: "Untitled"
format:
pdf:
include-in-header:
text:
\usepackage{fancyhdr}
---
\fancyfoot[L]{Footer text}
# Chapter ONE
text
\newpage
# Chapter TWO
Can I use fancyhdr? If yes, how? If not, what then? Thanks!
Yes, It is possible to use fancyhdr (see the answer by #Julian).
But also keep in mind that, Quarto uses KOMA-Script classes (scrartcl by default) and KOMA-Script suggests using scrlayer-scrpage latex package for handling header and footers instead of fancyhdr. See the manual chapter 05, p. 253.
---
title: "Untitled"
format:
pdf:
include-in-header:
text: |
\usepackage{scrlayer-scrpage}
\rohead{Header text}
\lofoot{Footer text}
---
# Chapter ONE
text
\newpage
# Chapter TWO
You may also want to go through this question and the corresponding answer on Tex StackExchange.
You are not that far away from the solution. If you want to use fancyhdr, this could work (note that you need to add text: | in order to have multiple lines of latex code):
---
format:
pdf:
include-in-header:
text: |
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[C]{Header text}
\fancyfoot[L]{Footer text}
---
# Chapter ONE
text
\newpage
# Chapter TWO
I'm using R markdown to create a presentation, and I would really like to add a custom background on my opening slide and second slide. Currently, I have my potential themes on a separate PowerPoint document. Is there any way to add backgrounds like that?
Thanks!
To add a custom background, one can create a powerpoint template, e.g. my-styles.pptx where the background image is placed at the slide master.
Then create an Rmarkdown file like follows and place it in the same folder:
---
title: "Fancy Slides"
author: "Creative Author"
date: "2021-06-09"
output:
powerpoint_presentation:
reference_doc: my-styles.pptx
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Output
```{r cars, echo = TRUE}
summary(cars)
```
More about this can be found in Yihui Xie et al. (2021) R Markdown: The Definitive Guide, Section 4.4.
Tested with RStudio Version 1.4.1714 and Powerpoint 2016.
I have an issue rendering bibliographies covering more than one page as only the first one is printed using RMarkdown and beamer output.
The same question has been posted at http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html#comment-2398115545 but without any help.
---
title: "Sample Document"
output: beamer_presentation
bibliography: bibliography.bib
---
You can force a slide to be continued on the next one by setting its class to allowframebreaks. Just do this for your last slide. From the pandoc mailing-list:
## References {.allowframebreaks}
Edit: knitr has a setting that prevents this solution from working out of the box with rmarkdown. See this question for a solution.
I'm hoping this is a question with a simple answer. I am using Rmarkdown/knitr to author a PDF document (in RStudio). Many LaTeX classes (like article) automatically indent the first line of a paragraph of text, but Rmarkdown does not, nor can I figure out a way to do so.
Here's a simple example:
---
title: "minimal"
author: "prison rodeo"
output: pdf_document
---
This is an R Markdown document.
I would like this paragraph to be first-line indented, but it is not.
Using > indents the entire paragraph, which is not what I'm looking for. I've tried spaces/tabs at the beginning of each paragraph, and using \indent; neither seems to work. Any ideas?
The default Pandoc template includes an indent argument. If set to true, paragraphs start with an indentation.
----
title: "Title"
author: "Me"
output: pdf_document
indent: true
----
I believe the following in your YAML header will work the same and has the advantage of still compiling should you decide to knit your document to an HTML file (though, I haven't tested this).
----
title: "Title"
author: "Me"
header-includes:
- \setlength\parindent{24pt}
output:
pdf_document
----
If what you're after happens to be the default settings in other regards as well, you might also be interested in setting the \parskip option to its default setting, since it is otherwise set to {6pt plus 2pt minus 1pt}
header-includes:
- \setlength\parindent{24pt}\setlength{\parskip}{0.0pt plus 1.0pt}
I am using RStudio for writing markdown documents and want to add Table of Contents (TOC) at top of the documents so that the user could click the relevant section for reading. There were some relevant examples on rpubs but now I can't seem to find them. Please note that I don't use pandoc and am quite new to Rmd & knitr. Is there any way to add TOCs without using pandoc? If using pandoc is must then which functions are relevant?
EDIT
Here's a small sample page:
---
title: "Sample Document"
output:
html_document:
toc: true
theme: united
---
Header 1
---------------
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
## Header 2
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
### Header 3
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
I tried running this in RStudio v 0.98.864 and it worked! but sadly it didn't work on 0.98.501 and 0.98.507. I am working on my thesis in 0.98.501 and after updating RStudio, some of my analyses didn't work. So, I reverted back to 0.98.501.
What should I do now? I really want TOCs but without harming the outputs of other analyses.
The syntax is
---
title: "Sample Document"
output:
html_document:
toc: true
theme: united
---
in the documentation. Make sure this is at the beginning of your document. Also make sure your document actually has headers otherwise R can't tell what you want in the table of contents.
Syntax with more options:
---
title: "Planets"
author: "Manoj Kumar"
date: "`r format(Sys.time(), '%B %d, %Y')`"
output:
html_document:
toc: true # table of content true
toc_depth: 3 # upto three depths of headings (specified by #, ## and ###)
number_sections: true ## if you want number sections at each table header
theme: united # many options for theme, this one is my favorite.
highlight: tango # specifies the syntax highlighting style
css: my.css # you can add your custom css, should be in same folder
---
If you are using pdf_document, you might want to add table of contents in a new page, which toc: true does not allow. It puts the table of contents right after the document title, author and date--because it is in yaml.
If you want to have it in a new page, you have to use some latex language. Here is what I did.
---
title: \vspace{3.5in}"Title"
author: "Name"
date: "`r Sys.Date()`"
output:
pdf_document:
fig_caption: true
number_sections: true
---
\newpage # adds new page after title
\tableofcontents # adds table of contents
\listoffigures
\listoftables
\newpage
So, after yaml (the chunk between ---), I added a new page using \newpage, then a table of contents using \tableofcontents, a list of figures using \listoffigures, a list of tables \listoftables, and a new page before everything else.
Note, \vspace{3in} in the title adds vertical space of 3 inch from the top before printing yaml (title, etc.).
Read more here: https://www.sharelatex.com/learn/Table_of_contents