如何在 rmarkdown beamer 演示文稿中的框架标题上添加两个徽标?

How to add two logos on frame title in rmarkdown beamer presentation?

我有以下 rmardown beamer 演示 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

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

我该怎么做。

我使用 Berkeley beamer 主题,如果可能的话我想保留它。

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

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

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

您可以在 \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