Hello!
The default theme has the following CSS code that allows to use 2 columns on the slide:
.pull-left {
float: left;
width: 47%;
}
.pull-right {
float: right;
width: 47%;
}
And we can easily use 2 columns using this code (and the remedy package creates a shortcut called xaringan for it):
.pull-left[
]
.pull-right[
]
But this is not available in all the themes that comes with xaringan.
Themes that don't have this CSS code (and don't work when try to use 2 columns using pull-left and pull-right :
A suggestion is to make this available in all themes. So if someone is using a theme, and wants to use another one, it will still work properly.
Reproducible example of how using pull-left and pull-right with the rladies theme won麓t work:
title: "Presentation Ninja"
output:
xaringan::moon_reader:
css: ["rladies", "rladies-fonts"]
lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
.pull-left[
test
]
.pull-right[
example
]
My session info:
> xfun::session_info('xaringan')
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763), RStudio 1.2.1335
Locale:
LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
LC_TIME=Portuguese_Brazil.1252
Package version:
base64enc_0.1.3 BH_1.69.0.1 digest_0.6.20 evaluate_0.14
glue_1.3.1 graphics_3.6.1 grDevices_3.6.1 highr_0.8
htmltools_0.3.6 httpuv_1.5.2 jsonlite_1.6 knitr_1.25
later_0.8.0 magrittr_1.5 markdown_1.1 methods_3.6.1
mime_0.7 promises_1.0.1 R6_2.4.0 Rcpp_1.0.2
rlang_0.4.0 rmarkdown_1.15.1 servr_0.15 stats_3.6.1
stringi_1.4.3 stringr_1.4.0 tinytex_0.16 tools_3.6.1
utils_3.6.1 xaringan_0.12.1 xfun_0.9 yaml_2.2.0
By filing an issue to this repo, I promise that
xfun::session_info('xaringan'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/xaringan').I understand that my issue may be closed if I don't fulfill my promises.
In order to have the styles from the base default theme, you can include default in your CSS list. The CSS files are loaded in the order listed, so themes (CSS files) that appear later in the list override those that are earlier. This is shown in the example on the wiki page but could probably be more prominently discussed.
For example, to use .pull-left[] and .pull-right[] from the default theme with the rladies theme, your xaringan slides would look like this:
output:
xaringan::moon_reader:
css: [default, rladies-fonts, rladies]
output:
xaringan::moon_reader:
css: [default, rladies-fonts, rladies]
.pull-left[
Left-column content
.pull-right[
Right-column content

Hi @gadenbuie ! I didn't thought about this. I'm so sorry that I asked a question of something that is already implemented!
Thank you for such a complete answer! Next time I'll use the default theme with the other themes.
Considering that is a suggestion of something that already works, It is ok to close this issue?
No worries! I'm sure you're not the only one who has run into this and wondered why it wasn't working. I updated the wiki page; hopefully my edits help clarify this situation. If that looks good to you, then feel free to close the issue.
I saw that now in the wiki page there is: "Include the default theme as the first css option to retain all of the CSS styles in the default xaringan presentation theme."
It's very clear to me! I'm closing the issue now.
Thank you so much!
Most helpful comment
In order to have the styles from the base
defaulttheme, you can includedefaultin your CSS list. The CSS files are loaded in the order listed, so themes (CSS files) that appear later in the list override those that are earlier. This is shown in the example on the wiki page but could probably be more prominently discussed.For example, to use
.pull-left[]and.pull-right[]from thedefaulttheme with therladiestheme, your xaringan slides would look like this:````markdown
output:
xaringan::moon_reader:
css: [default, rladies-fonts, rladies]
seal: false
Override default theme with other themes
.pull-left[
Left-column content
]
.pull-right[
Right-column content
]
````