-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slide Number Issues with RevealJS's print-pdf and h1 sections #3997
Comments
We generally reserve |
This seems contradicted by https://quarto.org/docs/presentations/revealjs/#creating-slides. If I try to shift down, the ---
format:
revealjs:
slide-number: c/t
show-slide-number: all
---
# Title Slide
## Section 1
### Slide
## Section 2
### Slide
|
@cscheid We are using It seems there is indeed an issue with numbering in print pdf mode. From some quick tests with pandoc only and revealJS format, it seems that latest Revealjs version may solve the issue. We don't use latest version yet, and updating seems to solve the issue # inside the qmd file directory
curl -OL https://github.com/hakimel/reveal.js/archive/master.zip
unzip .\master.zip
rm .\master.zip Using latest reveal-js with Quarto. ---
format:
revealjs:
slide-number: c/t
show-slide-number: all
revealjs-url: reveal.js-master
---
# Section 1
## Slide
# Section 2
## Slide It solves the issue for me. So I guess we need to update - @cscheid I did it once, I can do it again if you want |
@jmgirard You're right, and I'm wrong, thank you for setting me straight! @cderv Yeah, that'd be great. But I also wonder if we need to do something more general. It is the case that we generally discourage |
Oh ok. 🤔 I did not know or just misunderstood. Our doc definitely do not show that (as our examples in Gallery I think), unless we are just mixing things up. What we currently say is:
I remember we tweaked Pandoc's default for to do this exactly in our revealjs format. If we move to no So current h2 and h1 usage feels correct to me feel and expected, it just seems to be an issue with the pdf mode. Anyway, let's discuss this further! |
I can confirm that this does fix the slide numbering issue. However, the display format is still wrong and an empty slide is still added at the end in print-pdf mode. Expected: Observed: ---
format:
revealjs:
slide-number: c/t
show-slide-number: all
revealjs-url: reveal.js-master
---
# Section 1
## Slide
# Section 2
## Slide
|
It also looks like footer text is suppressed from print-pdf mode (not sure if that is intentional or not). |
I believe this is an issue with RevealJS itself (or with Pandoc integration of revealJS). I can reproduce this by only using Pandoc
---
title: Test
---
# Section 1
## Slide
# Section 2
## Slide pandoc -t revealjs -f markdown -s -o test.html test.md Then opening in browser in print pdf mode and printing in chrome show the addition empty slide.
I can see the footer when printing. Can't reproduce Qmd content---
format:
revealjs:
footer: "Footer text"
---
# Section 1
## Slide
Content
# Section 2
## Slide
Content |
Thanks for the additional information I can reproduce |
Having used markdown with revealjs for several years with another tool in VS Code called vscode-reveal, I would suggest not breaking from the standard of "horizontal slide" and "vertical slide". The trouble is that in many themes, In the vscode-reveal tool, it's a configurable option (one can use a regex), e.g., a single line with I teach 3-hour lectures and so having sub-lectures separated into vertical parts is great for me. Even a one-hour lecture can have three 20-minute vertical parts. It's a good use-case. On the other hand, I love the Maybe the team can find some existing markdown/reveal presentations and see what's most common? My opinion is only one user, but looking quickly at GitHub, lots of people designed revealjs slides using the ETA: I realize now that pandoc has a convention ("title slides", etc.) documented here: https://pandoc.org/MANUAL.html#structuring-the-slide-show |
@fuhrmanator regarding your comments, some additional context
You can still do that with Quarto by using
I don't think Pandoc supports this. Only
If you want vertical slide layout with Quarto you need to change Quarto presentation default is just using linear navigation mode by design.
Are you talking about the Navigation Menu ? I believe If that is not the case, please do open an issue with a reproducible example. Hope it helps understand the current state. Thanks for your feedback ! |
I was talking about Table of contents, but now I realize it's not documented for Presentations (RevealJS) as far as I can find it. Anyway, it works to my liking: ---
format:
revealjs:
toc: true
toc-depth: 1
toc-title: Overview
theme: beige
---
# First topic that is a really long title
## Subtopic 1
# Second topic Here's a screen shot of the slide overview (after pressing o key): |
In the example above you shared, you set If you do only But anyway, it seems it is working for you as you like with it, and I may have misunderstood the issue. |
My comment wasn't clear enough. Here's some more info from what I gather: There's a fundamental difference between vanilla RevealJS markdown and Pandoc's support, namely that Reveal has always allowed new slides to be defined with a The Table of Contents (which is not documented on Quarto, but probably comes from Pandoc) builds its info from the headings (#, ##, ###), etc. and not from the slide level per revealjs's markdown. That is to say, if I created in markdown a new horizontal slide in reveal-style markdown with I guess it would be useful in the Quarto documentation, for people who might be coming from the pure RevealJS ecosystem with markdown (like me), to understand that the markdown is processed via Pandoc and there are some important differences (not all bad - I love the TOC feature!). |
I think this is because the pdf-page class includes "break-after: page", forcing a break after every such container, including the one wrapping the final slide. Adding this CSS seems to have fixed it for me: @media print {
html.print-pdf .reveal .slides .pdf-page:last-child {
break-after: avoid;
}
} |
Thanks @timbrock ! I believe the initial rule is from Revealjs itself So probably your CSS tweak is worth suggesting upstream too ! We will add this in our CSS tweak in Quarto though. thanks. |
|
(we use |
Update to Revealjs 5.1.0 has been done in Quarto 1.6.9. It solves the slide numbering offset problem. For the formatting it is Revealjs issue directly I think. Should be reported upstream probably. For the footnote, we'll handle in #5998 |
Bug description
The slide numbering gets messed up by h1 (i.e.,
#
) sections when usingprint-pdf
with RevealJS. If you create a MWE presentation using the code below, it will correctly number the slides 1 to 4 in the IDE and web browser. But when you go tohttp://localhost:6600/?print-pdf
(or whatever your port is) or open the presentation in Chrome and hite
on the keyboard, each h1 section will increment the slide number by 2 instead of 1. It will also change back to thec
format, even if you change it in YAML, and it will add an empty page at the end.Correct display in RStudio IDE: (i.e.,
1 / 4
,2 / 4
,3 / 4
,4 / 4
)Incorrect numbering and format in PDF Output: (i.e.,
2
,3
,5
,6
, Blank)See the PDF here generated by Chrome
mwe.pdf
Versions
RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36
Microsoft Windows version 22H2 (OS Build 22623.1095) (64-bit)
Google Chrome version 109.0.5414.75 (Official Build) (64-bit)
Quarto CLI 1.2.269
Checklist
The text was updated successfully, but these errors were encountered: