quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.98k stars 328 forks source link

Quarto presentation: header level 3 (### titles) sticks to next slides, it also overrides text position and other modifications via css rules #11508

Open E-Mendez opened 5 days ago

E-Mendez commented 5 days ago

Bug description

Hello Quarto!

Im here to report that in quarto presentation, header level 3 (### Title) has a weird behavior:

Below I provide a simple example using a raw initalized slide, quarto check, and rstudio session info for reproductibility.

Cheers!

PS:

Here I provide an example of a rule changing slide behavior (You don't need to apply it to see thw weir behavior, just to check the rule will transform every other text but header level 3.)

´´´´´(css)

.theme-title1 { color: white; / Ensures all text is white / background-color: black; / Automatically adjusts text for contrast / mix-blend-mode: difference; / Adjusts color contrast dynamically / } ´´´´´

Steps to reproduce


---
title: "Quarto presentation to test weird level 3 header (### Title) behavior"
format: revealjs
---

# One level 1 slide

asdfasdas

## a level 2 slide

sdfkjsdfsd

# A level 1 slide

sdfsd

### With level 3 content (written on slide 3)

## Will it stick on this fourth level 2 slide ?

sdfdsafsd

### another header 3

## Are level 3 headers stuck on this blank level 2 header slide?

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

## Bullets

When you click the **Render** button a document will be generated that includes:

-   Content authored with markdown
-   Output from executable code

## Code

When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code. You can embed code like this:

(end of quarto)

Expected behavior

Expected behavior for level 3 header (### Title): Same as all other markdown text; also modifed when a css rule changes text behavior.

Actual behavior

When you write a header 3 (### subtitle) on a level 1 slide (# Slide title & initiation), it sticks on the same position for next slides. I also couldn't override this default behavior through css, which changed all other text behavior BUT header level 3.

Your environment

Session info (rstudio)


R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Santiago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5       svglite_2.1.3     cli_3.6.3         knitr_1.48       
 [5] rlang_1.1.4       xfun_0.49         stringi_1.8.4     generics_0.1.3   
 [9] glue_1.7.0        colorspace_2.1-1  htmltools_0.5.8.1 gridExtra_2.3    
[13] viridis_0.6.5     rmarkdown_2.28    scales_1.3.0      fansi_1.0.6      
[17] grid_4.4.1        evaluate_1.0.1    munsell_0.5.1     shadowtext_0.1.4 
[21] kableExtra_1.4.0  tibble_3.2.1      fastmap_1.2.0     yaml_2.3.10      
[25] lifecycle_1.0.4   stringr_1.5.1     compiler_4.4.1    dplyr_1.1.4      
[29] pkgconfig_2.0.3   rstudioapi_0.17.0 systemfonts_1.1.0 digest_0.6.37    
[33] viridisLite_0.4.2 R6_2.5.1          tidyselect_1.2.1  utf8_1.2.4       
[37] pillar_1.9.0      magrittr_2.0.3    tools_4.4.1       gtable_0.3.5     
[41] xml2_1.3.6        ggplot2_3.5.1    

Quarto check output

My quarto check


quarto check
Quarto 1.5.57
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.57
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....(None)

      Unable to locate an installed version of Pytho
n 3.
      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
      Version: 4.4.1
      Path: C:/PROGRA~1/R/R-44~1.1
      LibPaths:
        - C:/Users/Eamendezh/AppData/Local/R/win-library/4.4
        - C:/Program Files/R/R-4.4.1/library
      knitr: 1.48
      rmarkdown: 2.28

[>] Checking Knitr engine render......OK
cderv commented 5 days ago

This happens because this is not valid structure. Using ### after # without ## is not possible in the revealjs structure.

This is Pandoc doing the structure for revealjs based on slide-level and headers . Try this to reproduce with Pandoc only

quarto pandoc --to revealjs -s -o test.html --slide-level=2 index.qmd

Expected behavior for level 3 header (### Title): Same as all other markdown text;

What do you expect exactly ?

Read about creating slide through Markdown header in https://quarto.org/docs/presentations/revealjs/#creating-slides

You could also opt out and use --- for creating slides. This way headers may behave like you expect.