Skip to content
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

Missing vertical slides in revealjs #4317

Closed
Wenzel opened this issue Jan 28, 2018 · 14 comments
Closed

Missing vertical slides in revealjs #4317

Wenzel opened this issue Jan 28, 2018 · 14 comments

Comments

@Wenzel
Copy link

Wenzel commented Jan 28, 2018

Hi !

I am trying to generate slides from Markdown to RevealJS with pandoc.

The problem is that i don't have vertical slides , like revealjs can provide. instead everything is packed into the first level slide.

Here is a short example to reproduce:

Makefile:

all:
	pandoc \
		-t revealjs \
		--standalone \
		--self-contained \
		-o prez.html \
		prez.md

download_revealjs:
	wget https://github.com/hakimel/reveal.js/archive/master.tar.gz
	tar -xzvf master.tar.gz
	mv reveal.js-master reveal.js
	rm master.tar.gz

prez.md

---
title:  'Test RevealJS'
author:
- Tarral Mathieu
---

# Introspection ?

- hello
- world

## sub

- hello world
  • make download_revealjs
  • make all

The output:
capture d ecran de 2018-01-28 16-37-13

My pandoc version is:

pandoc 1.19.1
Compiled with pandoc-types 1.17.0.5, texmath 0.9.1, highlighting-kate 0.6.4
Default user data directory: /home/wenzel/.pandoc
Copyright (C) 2006-2016 John MacFarlane
Web:  http://pandoc.org
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.

Do you know what's wrong with my Markdown ?

Thanks !

@tarleb
Copy link
Collaborator

tarleb commented Jan 28, 2018

Please try running pandoc with --slide-level=2. This will tell pandoc to turn second-level headers into slides. Note that only the header of first-level slides will be shown, the first list in your example will not be visible.

If you have further questions, please direct them to the pandoc-discuss mailing list; we try to keep this issue tracker reserved for bugs and enhancement proposals.

@tarleb tarleb closed this as completed Jan 28, 2018
@HDembinski
Copy link

Please reopen this issue, because it does not solve OPs problem. I am having the same issue.

@tarleb
Copy link
Collaborator

tarleb commented Feb 22, 2019

The original issue seems to be resolved. @HDembinski, it is difficult to assess your issue without more information about your specific problem. Please also see http://pandoc.org/help.html.

@HDembinski
Copy link

Please try running pandoc with --slide-level=2. This will tell pandoc to turn second-level headers into slides. Note that only the header of first-level slides will be shown, the first list in your example will not be visible.

This is not a solution, only an accurate description of the problem.

I did some more searching here, and multiple users stumble over the same issue again and again:
#2265
#2248
#2157

To make 2D slides in reveal.js works as expected, we need level 1 slides with content to become normal horizontal slides and level 2 slides to be nested vertical slides.

@jgm
Copy link
Owner

jgm commented Feb 22, 2019

I believe that what you want is for

# A

A content

## A1

A1 content

to show up as a horizontal slide with title "A" and content "A content" and a vertical subslide with title "A1" and content "A1 content."

What pandoc will do, with --slide-level=2, is produce a horizontal title slide with title "A" and NO content, and a vertical subslide with title "A1" and content "A1 content."

It might make sense to make the following change (this would be around line 478 of the HTML writer). Instead of omitting the non-section content of a "title slide," we could include it as the content of the slide.

This would not be a hard change to make, and it would give the behavior you want for reveal.js. However, it would mean that reveal.js and beamer give different output for the same input, which is something I've wanted to avoid. We might, however, think of making a parallel change in beamer.

This would also help with #5237.

@jgm jgm reopened this Feb 22, 2019
@jgm
Copy link
Owner

jgm commented Feb 22, 2019

A first step, if we made this change, would be to carefully document the new behavior in teh manual under Slide shows.

@HDembinski
Copy link

@jgm Thank you for opening this again and yes, you described the problem and the desired behaviour perfectly. I am sure that many users will appreciate this change.

Can I help out in some way? I can't program in Haskell, but I can help with the docs, for example.

@HDembinski
Copy link

HDembinski commented Feb 24, 2019

I played a bit with beamer output. Maybe beamer should be changed as well, and then the behaviour could remain consistent as you wish.

Using OP's example Markdown with beamer output, by executing

pandoc -t beamer slides.md -s -o beamer.pdf

I get the following output

screenshot from 2019-02-25 00-01-39

This is exactly the behaviour that the current docs describe, but it is not what a naive user would expected. I would argue that a heading should always start a new slide.

Proposed behaviour:

  • a new slide is generated for each heading, regardless of heading level
  • revealjs: level 1 slides go horizontal, level 2 slides go vertical
  • beamer: level 1 and level 2 slides behave the same, but empty level 1 create chapter slides (using title slide layout, centered title in the middle, etc.)

@HDembinski
Copy link

To clarify, I think no user actually wants the output shown in my screenshot, which would allow us to safely change this without breaking peoples projects.

@jgm
Copy link
Owner

jgm commented Mar 2, 2019

Try this with --slide-level=2, though. It works exactly as it does in reveal.js.

Being able to create titled blocks using headers > slide level is a useful feature.

@jgm jgm closed this as completed in 5990f14 Mar 2, 2019
jgm added a commit that referenced this issue Mar 2, 2019
Currently we keep the fancy title slide and add a new
slide with the same title and whatever content was under the
header.

This changes behavior of slides, but is consistent with the
new behavior of the revealjs and other HTML slide show writers.

See #4317.
cagix added a commit to cagix/pandoc-lecture that referenced this issue Apr 4, 2019
strip HTML comments even when generating Beamer presentations due to changes
in pandoc 2.7 regarding content below header < slidelevel

see also jgm/pandoc#4317
@tchevri
Copy link

tchevri commented Aug 22, 2019

I am so sorry to trouble - but this (unexpected!) change has caused me quite a bit of trouble...
I am certain it's because of my incompetence and despite trying hard, i could not find any work around, except to roll back to an earlier pandoc.. (have not rolled back yet, but that's the obvious fix for me). I posted the detailed explanation here, as per Xie YiHui's advice... https://stackoverflow.com/questions/57614387/pandoc-4317-forces-content-under-title-slides-to-be-included-in-a-frame-in-pand
Thank you so much for any help you may provide. I hope it's an obvious fix for you. Of course, I am happy to provide any code needed - but fyi - i am under windows 10 (I prefer linux, but unfortunately the Rblpapi only works with windows 10 :-() and everything is fully up to date. I like to use the RStudio IDE.

@jgm
Copy link
Owner

jgm commented Aug 23, 2019

@tchevri I'm sorry about this -- it appears one can't please everyone. Unfortunately your particular use wasn't represented in the discussion. I had assumed that people who didn't want the content to appear on slides could simply hide the content (using a filter or whatever), but your case is different; you don't want to hide the content; you want it to appear in the document outside the slide environment.

I'm reluctant to revert the change to beamer, since this would make revealjs and beamer behave differently, and because it would break things for other users.

But I can't think of a good workaround right now.

I suggest you post on the pandoc-discuss mailing list, where someone might have ideas...closed issues aren't a good place for discussions.

@pmorch
Copy link

pmorch commented May 22, 2020

This fix is apparently included in versions 2.7 and later:

pandoc$ git tag --contain 5990f14ad497999141a5b975651f83d751ec421f
0.16.1.2
2.7
2.7.1
2.7.2
2.7.3
2.8
2.8.0.1
2.8.1
2.9
2.9.1
2.9.1.1
2.9.2
2.9.2.1

@tchevri
Copy link

tchevri commented Aug 24, 2020

Can i suggest something please?
I am choosing slide level 3 for my bookdown project.
My understanding is that reveal.js users need "one level above" their slide level to get the feature they want - in this case, that would be level 2.
If I did not misread, i do not think they need level 1, do they?
If so, how about leaving me the ability to use level 1 then to have my latex commands not slapped onto a slide and ignored, as used to be the case pre-.2.7?
Would that be a solution acceptable for everyone?
Many thanks
thomas

tchevri added a commit to tchevri/pandoc that referenced this issue Aug 4, 2023
Before Pandoc 2.7, choosing slide_level: 3 meant that ### was needed to create a slide. This commit jgm@5990f14 caused this desired behavior to no longer be true and content above slide level is automatically included onto a slide, to accommodate compatibility with reveal.js format. At JGM's request, who could not think of a quick fix at the time, I posted a request on https://groups.google.com/g/pandoc-discuss/c/joqekZQRpq8, but no resolution was suggested.

This suggested simple 1 extra line change fixes these issues jgm#8118 and jgm#4317. Thank you in advance for entertaining this suggestion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants