Rows and nested columns in a revealjs presentation #10061
-
DescriptionI have a quarto revealjs presentation in which I would like to include a rather complex set of images and text. In As an example of what I want to do, I have the following slide: Everything, but the red "Some text goes here" was made with quarto by creating a column for the text on the left and one column for each of the fish images. This issue I have is that I don't know how to create in quarto the red text centered under the three images. I asked ChatGPT how to create a row in which I would place a nested set of 3 columns, one for each fish image and it suggested defining a row class in CSS as follows: .row {
display: flex;
#flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
} I did this, but ether I didn't use it correctly or it didn't seem to like the nested columns and the result was a mess. What is the best way to achieve what I want for this slide? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
Unfortunately, it's nearly impossible for someone to help about HTML/CSS layout with only a screenshot. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
-
---
title: "A silly example"
format:
revealjs:
smaller: true
include-in-header:
- text: |
<style>
.row { # Definition for .row from chatgpt...
display: flex;
#flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
</style>
---
## A slide that has most of what I want
::::::{.columns}
:::::{.column width="30%"}
Some text
:::::
:::::{.column width="22%"}
:::{style="text-align: center"}
Skipjack tuna

:::
:::::
:::::{.column width=22%}
:::{style="text-align: center"}
Yellowfin tuna

:::
:::::
:::::{.column width=22%}
:::{style="text-align: center"}
Bigeye tuna

:::
:::::
::::::
## A slide that doesn't work, but has what I want
::::::{.columns}
:::::{.column .col-border-right width="30%"}
Some text
:::::
:::::{.column width="69%"}
::::{.row}
::::{.columns}
:::{.column}
:::{style="text-align: center"}
Skipjack tuna

:::
:::
:::{.column}
:::{style="text-align: center"}
Yellowfin tuna

:::
:::
:::{.column}
:::{style="text-align: center"}
Bigeye tuna

:::
:::
::::
::::
Some text
:::::
::::::
|
Beta Was this translation helpful? Give feedback.
-
Thanks. I asked ChatGPT how to enable bootstrap and use grid in quarto revealjs and it suggested the following: ---
title: "My Presentation"
format: revealjs
resources:
- href: https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css
rel: stylesheet
--- Is this correct? If I understand correctly, bootstrap is already enabled in quarto html documents, but you have to manually enable it in quarto revealjs. Is that correct? Once enabled, will I have to use grid for all page layouts or will the standard |
Beta Was this translation helpful? Give feedback.
-
I don't really know how to respond to this other than to say that I am trying my best to learn how to do things and so sometimes I ask questions that maybe have answers elsewhere or maybe are a bit dumb, and I just hope that other quarto users to whom I directed the question will be understanding of that. |
Beta Was this translation helpful? Give feedback.
-
For completeness, the following example using ---
title: "A working example"
format:
revealjs:
smaller: true
---
---
### A title
::::::{.columns}
:::::{.column width="30%"}
Some text
Some more text
:::::
:::::{.column width="69%"}
:::: {layout="[[1,1,1], [1]]"}
:::{#skipjack}
:::{style="text-align: center"}
Skipjack tuna

:::
:::
:::{#yellowfin}
:::{style="text-align: center"}
Yellowfin tuna

:::
:::
:::{#bigeye}
:::{style="text-align: center"}
Bigeye tuna

:::
:::
:::{#text .fragment}
:::{style="text-align: center; color: red;"}
Some text
:::
:::
::::
:::::
::::::
|
Beta Was this translation helpful? Give feedback.
For completeness, the following example using
layout
does what I want it to do (fragment works, as does the centering and coloring of text and figures):