R Markdown (beamer) - 如何创建 2 列
R Markdown (beamer) - how to create 2 columns
我正在尝试使用 RMarkdown beamer 创建演示文稿。我想要一张幻灯片有 2 列,这是我目前所拥有的:
---
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
:::
::::::::::::::
header.tex的内容是:
\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}}
这是我看到的结果,几乎是完美的,但是第二列比第一列略低,如下图,你明白为什么吗?
对应 .tex 文件到 .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}
问题出在\justify
,应该是\justifying
(但是在你使用它的位置,它不会对列中的文本产生任何影响,所以你也可以删除它...)
---
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
:::
::::::::::::::
我正在尝试使用 RMarkdown beamer 创建演示文稿。我想要一张幻灯片有 2 列,这是我目前所拥有的:
---
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
:::
::::::::::::::
header.tex的内容是:
\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}}
这是我看到的结果,几乎是完美的,但是第二列比第一列略低,如下图,你明白为什么吗?
对应 .tex 文件到 .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}
问题出在\justify
,应该是\justifying
(但是在你使用它的位置,它不会对列中的文本产生任何影响,所以你也可以删除它...)
---
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
:::
::::::::::::::