简体   繁体   English

将图像添加到 ioslides 演示文稿的标题页

[英]Adding an image to the title page of ioslides presentation

Is it possible to add an image to the title page of ioslides presentation?是否可以将图像添加到 ioslides 演示文稿的标题页? I would like to add a big logo after the instead of xyz.我想在而不是 xyz 之后添加一个大徽标。

---
title: "Empowering Data-Driven Decisions at <br> xyz"
author: Omayma Said
date: Jan 11, 2017
output: ioslides_presentation
---

在此处输入图片说明

Yes.是的。 There is a standard option to include a small logo included in the ioslides bookdown documentation as well as some code to make a custom size image using css.有一个标准选项可以包含ioslides bookdown 文档中包含的小徽标,以及一些使用 css 制作自定义大小图像的代码。 This css can go in a separate document or it can at the start of your document after the YAML header which is typically easier when you only have a few lines to add.这个 css 可以放在单独的文档中,也可以放在文档的开头,在 YAML 标头之后,当您只需要添加几行时,这通常更容易。

Here is an example of putting the css in the document using code snippets from thebookdown documentation .这是使用bookdown 文档中的代码片段将 css 放入文档的示例

---
output:
  ioslides_presentation:
    logo: logo.png
---

<script>

    .gdbar img {
        width: 300px !important;
        height: 150px !important;
        margin: 8px 8px;
    }

    .gdbar {
        width: 400px !important;
        height: 170px !important;
    }

    slides > slide:not(.nobackground):before {
        width: 150px;
        height: 75px;
        background-size: 150px 75px;
    }

</script>

# Transition slide

## First slide

Yes, it is possible with the help of css.是的,在 css 的帮助下是可能的。

First step is to add the css in the output of the markdown:第一步是在markdown的输出中添加css:

---
title: "Your <br> Title"
author: "Author Name"
date: "<div class = 'slide-date'>`r format(Sys.Date(),format='%B %Y')` <div>"
output:
  ioslides_presentation:
    css: styles.css
---

The next step is to add the image in your styles.css file下一步是在你的styles.css 文件中添加图像

slides>slide.title-slide {
    background-image: url('title_image.png');
    background-size: 100% 100%;
}

Happy Coding!快乐编码!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM