chuxinyuan 有很多内容是可以删减的,稍简化一下
---
title: "R Markdown 制作 beamer 幻灯片"
subtitle: "--- 显示比例16:9"
author:
- 楚新元
institute: "家里蹲公司"
date: "`r Sys.Date()`"
documentclass: ctexbeamer
output:
bookdown::pdf_book:
number_sections: yes
toc: no
base_format: rmarkdown::beamer_presentation
latex_engine: xelatex
citation_package: natbib
keep_tex: no
template: null
theme: Verona
themeoptions:
- colorblocks
# - showheader
- red
biblio-style: apalike
classoption:
- fontset = fandol
- aspectratio = 169
link-citations: yes
section-titles: no
colorlinks: yes
---
# 第一部分:介绍 {#intro}
## 关于代码
感谢[黄湘云](https://xiangyun.rbind.io/),yaml 部分基本都是无脑抄他的。强烈推荐他的大作 [R Markdown 制作 beamer 幻灯片](https://cosx.org/2022/08/beamer-not-down/)。
我能明白你的意思,这是 beamer 主题 4:3 时的效果
这是 beamer 主题 16:9 时的效果
这个问题和 R Markdown 都没关系,需要看下 Verona 主题的 LaTeX 源码,发现两个小矩形、横线是用 TikZ 绘制的,代码如下
\begin{tikzpicture}[overlay]
\draw[draw=structure.fg!35] (0mm,3mm) -- (12.8cm,3mm);
\draw[fill=\structureA,draw=\structureA,yshift=-.5mm] (0mm,3mm) rectangle ++ (1mm,1mm);
\draw[fill=\structureA,draw=\structureA,yshift=-.5mm] (12.69cm,3mm) rectangle ++ (1mm,1mm);
\end{tikzpicture}
可知线的长度是写死的,有没有办法根据 aspectratio 再提供一套呢?当然可以,留给楼主稍作改动吧。