2

When writing an xaringan slide using .pull-left[] and .pull-right[], the left side changes the position of the objects with incremental slides --. This looks poor if you want to discuss the content on the left as it moves when the text is addeed (see pictures attached). Is there a way in-line or in css to stop this happening so, for example in this case, the shiny.png stays still in the center of the left column when the text is incredmental text is added to the right:

left only1 When right is added2

class: middle 

.pull-left[ 
\```{r Shiny, echo=FALSE, out.width="100%", fig.align='center'}
knitr::include_graphics("img/Shinyexample.png")
\```
]
--
.pull-right[ 
### Shiny
- Shiny is an R package that makes it easy to build interactive web apps straight from R. 
- You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards. 
- You can also extend your Shiny apps with CSS themes, htmlwidgets, and JavaScript actions.
]
  • Have you tried the dev version of **xaringan**? `remotes::install_github('yihui/xaringan')` – Yihui Xie Aug 30 '20 at 02:15
  • Thanks @yihui, it is happening with the dev version. What is happening is that when only the left column or pull is present, it centers the image. Then when the right column or pull is introduced using `--` the left column is vertically re-aligned so that both columns are even. While this is often what looks best, it would be nice to remove this so that the image does not move. This also happens with subheadings in the left column using sidebar slides. – Conal Monaghan Aug 31 '20 at 01:54
  • I am facing a similar issue. For me it is even when I'm not using `--`. e.g.: If I have some graph pulled right and some text describing it pulled left, the text gets aligned to the top of the figure (despite using class: middle for the slide). And when I have multiple slides like this, the text on the left keeps moving about from slide to slide because the different figures are of different heights. Is there a way to align both columns independently to the middle of the slide? – Karthik Thrikkadeeri Nov 11 '21 at 06:18
  • I saw [this suggestion](https://stackoverflow.com/a/53646874/13000254) to create a custom css class which I tried, but as I am not familiar with css I wasn't able to figure out what exactly to modify for my particular purpose. The suggested class wasn't working when inserted within the `.pull-left[]` call. – Karthik Thrikkadeeri Nov 11 '21 at 06:25

0 Answers0