How to have multiple note page in Rmarkdown beamer presentation - latex

In Markdown beamer presentation output, my multiple notes pages are being combined into one note page. When I looked into the .tex file (from my keep_text=TRUE option), it is because the notes commands are put between \begin{frame} ... \end{frame} instead of outside \end{frame}. Below is my reproducible code in Rmarkdown beamer presentation document. Any help will be appreciated.
---
output:
beamer_presentation
keep_tex: yes
---
## slide title
- item 1
- item 2
\note{
long paragraph 1
}
\note{
long paragraph 2
}
I get this output
But what I wanted was:

You can temporarily switch from markdown to real latex and end the frame before adding the notes:
---
output:
beamer_presentation:
keep_tex: true
header-includes:
- \setbeameroption{show notes}
---
## slide title
- item 1
- item 2
``` {=latex}
\end{frame}
\note{
long paragraph 1
}
\note{
long paragraph 2
}
\begin{frame}
```
normal slide
https://rstudio.cloud/project/1051204

Related

R Markdown Colored Background

I have reproduced a simple example of an R Markdown presentation. Basically, I want to achieve a colored page that overlays both the headline and the footline. At the moment, only the headline is overlayed. The approach with a preamble in a tex file is needed in my full example. "Red.jpg" is simply a red image. There may be a better approach to achieve this. The reproducible code is as follows:
---
title: "Untitled"
author: "Author"
date: "21 6 2021"
output:
beamer_presentation:
includes:
in_header: preamble.tex
---
---
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[width=\paperwidth]{red.jpg}};
\end{tikzpicture}
The code for the preamble is as follows:
\usepackage{tikz}
\setbeamertemplate{headline}{My Title}
\setbeamertemplate{footline}{Author \hfill \insertframenumber}
This really represents a simple MWE, without borthering about spacing of footline etc.
The current result is as follows:
You can use a plain frame without head- or footline:
---
title: "Untitled"
author: "Author"
date: "21 6 2021"
output:
beamer_presentation
header-includes:
- \usepackage{tikz}
- \setbeamertemplate{headline}{My Title}
- \setbeamertemplate{footline}{Author \hfill \insertframenumber}
---
---
# {.plain}
\begin{tikzpicture}[remember picture,overlay]
\fill[red] (current page.south west) rectangle (current page.north east);
\end{tikzpicture}

R Markdown (beamer) - how to create 2 columns

I am trying to create a presentation using RMarkdown beamer. I want a slide to have 2 columns and this is what I have so far:
---
title: title
author: name
date: date
output:
beamer_presentation:
theme: Szeged
slide_level: 2
includes:
in_header: header.tex
keep_tex: true
linkcolor: false
---
## TEST
\footnotesize
\justify
:::::::::::::: {.columns}
::: {.column}
- I will write something here tex text text tex text text tex text text
:::
::: {.column}
- And then something here tex text text tex text text tex text text tex text text
:::
::::::::::::::
The header.tex's content is:
\definecolor{mycolorlightblue}{RGB}{103,153,200}
\definecolor{mycolordarkblue}{RGB}{0,70,127}
% add packages
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{tcolorbox}
\usepackage{ragged2e}
% remove 2nd section from header
\makeatletter
\beamer#theme#subsectionfalse
\makeatother
% change colour of lines
\setbeamercolor{separation line}{bg=mycolorlightblue}
% text title
\setbeamercolor{title}{fg=mycolordarkblue}
\setbeamercolor{frametitle}{fg=mycolordarkblue}
% text colour
\setbeamercolor{frametitle}{fg=mycolordarkblue}
% item colour
\setbeamercolor{structure}{fg=mycolordarkblue}
% define colour text
% \usebeamerfont{section title}\color{blue!70!green}\insertsection\par
% no header or footer on first page
\thispagestyle{empty}
% remove title slides at beginning of sections
\AtBeginSection{}
% add page counter to the footer
\setbeamertemplate{footline}[frame number]
% logo of my university
\titlegraphic{%
\begin{picture}(0,0)
\put(155,0){\makebox(0,0)[rt]{\includegraphics[]{ALL-ICONS.png}}}
\end{picture}}
This is the result I am seeing, almost perfect, but the 2nd column starts slight below the first one, as shown below, do you understand why?
correspondent .tex file to the .rmd:
\begin{frame}{TEST}
\protect\hypertarget{test}{}
\footnotesize
\justify
\begin{columns}[T]
\begin{column}{0.48\textwidth}
\begin{itemize}
\tightlist
\item
I will write something here text text text text text text text text
text text text text text text text
\end{itemize}
\end{column}
\begin{column}{0.48\textwidth}
\begin{itemize}
\tightlist
\item
And then something here text text text text text text text text text
text text text text text text
\end{itemize}
\end{column}
\end{columns}
\end{frame}
The problem is the \justify, it should be \justifying instead (but at the position you use it, it won't have any effect on the text in the columns anyway, so you could also just remove it ...)
---
title: title
author: name
date: date
output:
beamer_presentation:
theme: Szeged
slide_level: 2
includes:
in_header: header.tex
keep_tex: true
---
## TEST
\footnotesize
:::::::::::::: {.columns}
::: {.column}
- I will write something here tex text text tex text text tex text text
:::
::: {.column}
- And then something here tex text text tex text text tex text text tex text text
:::
::::::::::::::

Numbering latex presentation - counting problem

I'm working on a presentation with Latex {beamer}. I have the following problem:
When I use the itemize command on a slide in conjunction with \visible<2->{text} Latex counts a new page for each item. That's why I have something like 17/11 on my presentation.
Does one know how to solve this problem?
With \thispagestyle{empty} I solve the problem only temporarily and not satisfactorily
If I understood correctly, you may not want a new page (slide) for each item in each itemize environment in your presentation, for example if you have to print your slides. In this case, you may switch from
\documentclass{beamer}
to
\documentclass[handout]{beamer}
before compiling again and print your output pdf file (whose page count will now be the same or smaller). The handout option is discussed in section 4.6 of this Beamer User Guide.
Don't show the page number, but use the frame number instead:
\documentclass{beamer}
%\setbeamertemplate{footline}[page number]
\setbeamertemplate{footline}[frame number]
\begin{document}
\begin{frame}
\begin{itemize}
\item text text
\item text \visible<2->{text}
\end{itemize}
\end{frame}
\end{document}

Pandoc LaTex PDF headed and footer

I am using pandoc v 1.18 I want to add header as well as footer text.
I want complete control meaning I want to place heater text at left, center and middle and the same with footer.
But I am unable to get even a single place to show up.
I have the following in my YAML header in my markdown file
---
header: This is fancy
footer: So is this
headertext: This is fancy
footertext: So is this
#abstract: This is a pandoc test . . .
documentclass: report
output:
pdf_document:
fontsize: 12pt
mainfont: Roboto
geometry: [top=2cm, bottom=1.5cm, left=1cm, right=1cm]
css : pandoc.css
linkcolor : cyan
toc : true
---
I have tried to use header and headertext separately as well and that did not work as well.
Easiest solution is to add a custom latex header. Create header.tex in your working directory and add something like:
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{Fancy on the right}
\lhead{Fancy on the left}
\cfoot{Fancy in the footer}
See the fancyhdr manual for help.
And then compile with pandoc myfile.md -o myfile.pdf -H header.tex. With Rmarkdown, this can be set in the YAML front matter:
---
output:
pdf_document:
includes:
in-header: header.tex
---
To be able to set the header with a variable in the YAML like you wanted, you will need to play with the rmarkdown latex template (see the pandoc manual section about templates) but you'll probably lose the possibility to fine-tune the header and footer with fancyhdr.

Creating a footer for every page (including first!) using R markdown

I'd like to add to the question Creating a footer for every page using R markdown: how do I do this for the first page of the document in addition to all the following pages?
In RStudio, this code:
---
title: "Test"
author: "Author Name"
header-includes:
- \usepackage{fancyhdr}
- \usepackage{lipsum}
- \pagestyle{fancy}
- \fancyhead[CO,CE]{This is fancy header}
- \fancyfoot[CO,CE]{And this is a fancy footer}
- \fancyfoot[LE,RO]{\thepage}
output: pdf_document
---
\lipsum[1-30]
Produces this at the bottom of pg1:
and this (oddly, shouldn't this go on the left because of the \fancyfoot[LE,RO]{\thepage}?) at the bottom of pg2:
and this at the bottom of pg3:
Use
---
title: "Test"
author: "Author Name"
header-includes:
- \usepackage{fancyhdr}
- \usepackage{lipsum}
- \pagestyle{fancy}
- \fancyhead[CO,CE]{This is fancy header}
- \fancyfoot[CO,CE]{And this is a fancy footer}
- \fancyfoot[LE,RO]{\thepage}
- \fancypagestyle{plain}{\pagestyle{fancy}}
output: pdf_document
---
\lipsum[1-30]
which should override the plain page style - used on the first page with an issue of \maketitle - to be equivalent to fancy.
Remark that \fancypagestyle{plain}{} has the same effect as \fancypagestyle{plain}{\pagestyle{fancy}}.

Resources