Rstudio 0.98.1028只添加背景图片到标题幻灯片 [英] Rstudio 0.98.1028 add background image only to title slide

查看:314
本文介绍了Rstudio 0.98.1028只添加背景图片到标题幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用RStudio 0.98.1028创建一个R演示文稿(.Rpres),标题幻灯片上有一个不同的背景图片,其余幻灯片上有另一个背景图片。我可以通过在其中创建一个css文件来放置自定义背景(foo.png):

I am attempting to create a R Presentation (.Rpres) using RStudio 0.98.1028 with a different background image on the title slide and another background image on the rest of the slides. I am able to place a custom background (foo.png) by creating a css file with this in it:

    body {
      background-image: url(foo.png);
      background-position: center center;
      background-attachment: fixed;
      background-repeat: no-repeat;
      background-size: 100% 100%;
    }

我可以关闭默认在标题幻灯片上的颜色方案,并使颜色黑色与这:

I was able to turn off the default color scheme on the title slide and make the color black with this:

.section .reveal .state-background {
    background: transparent;}

.section .reveal h1,
.section .reveal p {
    color: black;



}




$ b b

要将foo1.png导入标题幻灯片,请查看其他帖子(

To get foo1.png into the title slide, Other posts (Adding an image to title slide using slidify) I have seen suggest adding this to the css:

.title-slide {
     background-image: url(foo1.png);
   }

其中不插入foo1.png。但是,foo.png保留在所有幻灯片上(包括标题幻灯片)。如何在我的标题幻灯片上获取foo1.png?

Which does not insert foo1.png. However, foo.png stays on all the slides (including the title slide). How do I get foo1.png on my title slide?

推荐答案

只要一两个调整,你就会有。您可以考虑添加以下内容,以确保您的幻灯片正在使用单独的css文件,并在标题幻灯片中添加以下内容。

You're 99% of the way there. Just one or two more tweaks and you'll have it. You may consider adding the following to ensure your slides are using the separate css file with something like the following added to your title slide.

Intro
======
author: Clever Name
css: css-file.css

然后,您可以通过在< style>之间插入以下内容覆盖标题幻灯片的背景。 < / style> 标签。

You then can overwrite the background of the title slide by including the following between <style> </style> tags at the very top of your .Rpres file before your intro slide, or in your separate css file.

<style>
/* Your other css */

.section .reveal .state-background {
    background: url(foo1.png);
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
</style>

你真的很近。只需将 title-slide {/ * do stuff * /} 改为 .section .reveal .state-background {/ * do stuff * /}

You're really close. Just change your title-slide { /* do stuff */ } to .section .reveal .state-background { /* do stuff */ }

这篇关于Rstudio 0.98.1028只添加背景图片到标题幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆