pause when having columns

Viewed 31

I have this slide that works fine.

---
format: 
  revealjs
---

## title

::: columns
::: {.column width="35%"}
```{.python code-line-numbers="2"}
def cal(C):
  return 2 + C
```
:::

::: {.column width="10%"}
:::

::: {.column  width="55%"}
```{python}
def cal(C):
  res = 2 + C
  return res
```

```{python}
#| echo: true
F = 0 
def cal(C):
  res = F + C
  print('res', res)
  return res
```

```{python}
print(F)
```

:::
:::

Now, I want to present the left column , then pause, then present the right column and pause before the result of print(F) appears.

I tried putting the . . . in order to pause but it seems it doesn't work when you have colunms defined.

1 Answers

So, after reading this

I managed to do it using fragments.

---
format: 
  revealjs
---

## title

::: columns
::: {.column width="35%"}
```{.python code-line-numbers="2"}
def cal(C):
  return 2 + C
```
:::

::: {.column width="10%"}
:::

::: {.column  width="55%"}
::: {.fragment}
```{python}
def cal(C):
  res = 2 + C
  return res
```

```{python}
#| echo: true
F = 0 
def cal(C):
  res = F + C
  print('res', res)
  return res
```
:::

::: {.fragment}
```{python}
print(F)
```
:::

:::
:::
Related