如何在rmarkdown投影仪演示中的框架标题上添加两个徽标?

时间:2019-09-20 08:31:09

标签: latex r-markdown beamer

我有以下rmardown投影仪演示文稿presentation.rmd

---
title: "Markdown beamer with to logos"
output: 
beamer_presentation:
    slide_level: 1
    theme: "Berkeley"
header-includes: |
\pgfdeclareimage[height=.5cm, width=1.5cm]{logoMyCompany}{data/img/logoMyCompany.png}
\pgfdeclareimage[height=.5cm, width=1.5cm]{logoMyCompany}{data/img/logoOurClient.png}

---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

# First page title

enter image description here

我想在幻灯片的右上角添加两个公司徽标(在每个框架的框架标题中)。

我该怎么做。

我尽可能使用Berkeley beamer主题。

我知道如何在左上角添加徽标:

\pgfdeclareimage[height=.5cm, width=1.5cm]{logo}{data/img/logo.png}
\logo{\pgfuseimage{logo}}

但是在这种情况下,它不合适。

1 个答案:

答案 0 :(得分:1)

您可以在\logo{}宏中使用任意数量的徽标:

\documentclass{beamer}
\usetheme{Berkeley}

\pgfdeclareimage[height=.5cm]{logoHarman}{example-image-duck}
\pgfdeclareimage[height=.5cm]{logoMSC}{example-image-duck}

\logo{\pgfuseimage{logoMSC}\pgfuseimage{logoHarman}}

\begin{document}

\begin{frame}
\frametitle{title}
    abc
\end{frame} 

\end{document}

和在rmarkdown中:

---
title: "Markdown beamer with to logos"
output: 
  beamer_presentation:
    slide_level: 1
    theme: "Berkeley"
header-includes: 
  - \pgfdeclareimage[height=.5cm]{logoHarman}{example-image-duck}
  - \pgfdeclareimage[height=.5cm]{logoMSC}{example-image-duck}
  - \logo{\pgfuseimage{logoMSC}\pgfuseimage{logoHarman}}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

# First page title

enter image description here