Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

image and text side by side Rstudio presentation / .rpres

Tags:

I'm trying to achieve the basic layout that 99% of presentations use where a slide has a title some text below that and then an image below that with text to its side. Apparently, this is a very difficult task to accomplish in rstudio presentations (the link here was no help). How do I go about doing it? Below is what I'm looking for (made in powerpoint):

enter image description here

Here's what I've tried thus far:

Title
====================================
incremental: false

<font color = "darkred">
 Additional Text Goes Here</font>

<div align="center">
<img src="fake.png">
</div>

***

<p>&nbsp;</p>
<p>&nbsp;</p>


- Text goes here
- Text goes here
- Text goes here

Which clearly produces a ridiculous outcome:

enter image description here

Problems with the current output:

  • Title and text below it are too close
  • Text below title too far to left (should align with title)
  • Image should also align with title

Here's my attempt at addressing those issues:

Title
====================================
incremental: false

<p>&nbsp;</p>

<div style="margin-left: 1em;">
<font color = "darkred">
 Additional Text Goes Here</font>
</div>

<p>&nbsp;</p>


<div align="center">
<img src="fake.png">
</div>

***

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>


- Text goes here
- Text goes here
- Text goes here

And I tried

<div style="padding: 10px;">
<font color = "darkred">
 Additional Text Goes Here</font>
</div>

Both of those did nothing, I tried messing around with the css and added the following:

<style>
p {
    text-indent: 240px;
}
</style>

Which produced the following:

enter image description here

But some major problems persist:

  • This changed the title for all my sides -I cant have that. I tried changing the p to the appropriate header lable h5 (5th page) but that did nothing.
  • The image isn't perfectly aligned
  • I'd like to reduce the space b/w the title and the text below I know I can remove <p>&nbsp;</p> but then the spacing is too close (like in the first image)

My knowledge of html and css is next to nothing so thanks for bearing with me. I simply in disbelief that the most basic feature of slide shows is some how missing from Rstudio's quintessential format of presentations (images with text above and adjacent) -clearly I must be missing something. Any help is much appreciated.

Oh and two final points -when I turn to the actual slide it appears exactly how I want it (if I've gotten rid of the spacing and css styles) for perhaps less than a second or 2 (while its rendering). Also, I thought I'd check Rpubs just to check my sanity -assuming there would be tones of projects with this layout on there. I went through maybe 30 different presentations and either 1) the presentation did not have a layout slide in the form I desire (2/3rds of them) and the remaining presentations that did have a layout all were suffering from the exact same problem I am. Every single presentation with a format like that look absolutely terrible like the images above. I guess the good folks at Rstudio are busier with more important tools than making Rstudio presentation format a reasonable choice of slideshow to use, which is absolutely fine. Unfortunately, slidify is a nightmare in developmental purgatory, beamer's templates are very arcane looking, and I cant find a single example of an ioslide project on the internet so I didn't even bother going down that rabbit hole. I'm open to suggestions of other presentations formats that can be used with R otherwise I'm stuck taking screenshots of my R output and code to to upload to a powerpoint (****cringe****). Thanks.

like image 892
Cyrus Mohammadian Avatar asked Sep 20 '16 04:09

Cyrus Mohammadian


1 Answers

A little late to the party, but another solution can be found here.

The appropriate formatting would then be:

Two-Column Slide
====================================
First column (Will appear on left)
![alt text](myimage.png)
***
Second column (Will appear on right)
like image 89
Sam Helmich Avatar answered Sep 24 '22 16:09

Sam Helmich