使用R标记将徽标插入beamer演示文稿

使用R标记将徽标插入beamer演示文稿,r,markdown,beamer,R,Markdown,Beamer,我正在尝试使用Rmarkdown将徽标插入beamer Presentation,它看起来像\logo{\includegraphics[height=1cm,width=3cm]{logo.png}中的大小控件不起作用,无论我在那里输入什么值,图像的大小始终相同。除了手动修改图像,还有什么建议吗 --- title: "Presentation" author: "Author" output: beamer_presentation: includes: in_hea

我正在尝试使用Rmarkdown将徽标插入beamer Presentation,它看起来像
\logo{\includegraphics[height=1cm,width=3cm]{logo.png}
中的大小控件不起作用,无论我在那里输入什么值,图像的大小始终相同。除了手动修改图像,还有什么建议吗

---
title: "Presentation"
author: "Author"
output:
  beamer_presentation:
    includes:
      in_header: mystyle.tex

---

## R Markdown

This is an R Markdown presentation. Markdown is a simple formatting
syntax for authoring HTML, PDF, and MS Word documents. For more
details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that
includes both content as well as the output of any embedded R code
chunks within the document.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Code and Output

```{r}
summary(cars)
```

## Slide with Plot

```{r, echo=FALSE}
plot(cars)
```
更新:快速解决-简单地修改图像将不起作用-图像是丑陋和像素化的。简单地转换为pdf也不能很好地工作,所以我使用下面的R代码来创建pdf,并在\logo{\includegraphics{logo.pdf}中使用它

library(png)
library(grid)
img <- readPNG('logo.png')
img <- rasterGrob(img, interpolate=TRUE)
pdf(file = 'logo.pdf', width = 1, height = 0.25)
grid.newpage()
grid.raster(img)
dev.off()
库(png)
图书馆(网格)

imgI找到了解决方案;在beamer手册中,还有另一种使用徽标功能的方法,而且效果很好

\pgfdeclareimage[height=0.2787cm, width=2.5cm]{logo}{logo.png}
\logo{\pgfuseimage{logo}}

只是一个旁白:如果你想用降价做演示,为什么不直接用工具来使用它呢?它是用R自动生成的,它将提取数据,处理数据,创建图表和表格。哦,好的,谢谢澄清:-)
\pgfdeclareimage[height=0.2787cm, width=2.5cm]{logo}{logo.png}
\logo{\pgfuseimage{logo}}