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

beamer duplicated fragile frame specifier #5208

Closed
svenevs opened this issue Jan 9, 2019 · 3 comments
Closed

beamer duplicated fragile frame specifier #5208

svenevs opened this issue Jan 9, 2019 · 3 comments

Comments

@svenevs
Copy link
Contributor

svenevs commented Jan 9, 2019

The following test.md input file contents:

# Section 1

## This is Stuff {.fragile}

- Look at this list
- Is it not nice?

Yes it is.

## More Stuff {.allowframebreaks}

1. An ordered listing.
2. Is even more nice.
3. Depending on the context

Converting to beamer, see that the \begin{frame} for This is Stuff title section has [fragile,fragile]. There should be only one?

Note: functionally, this doesn't appear to be a problem. I'm actually trying to write a filter to fragile every frame instead of using sed, so I thought my filter was bad. But after running without filters I realized that it comes from pandoc.

Using pandoc version 2.5 from cabal install. pandoc -f markdown -t beamer test.md results:

\hypertarget{section-1}{%
\section{Section 1}\label{section-1}}

\begin{frame}[fragile,fragile]{This is Stuff}
\protect\hypertarget{this-is-stuff}{}

\begin{itemize}
\tightlist
\item
  Look at this list
\item
  Is it not nice?
\end{itemize}

Yes it is.

\end{frame}

\begin{frame}[allowframebreaks]{More Stuff}
\protect\hypertarget{more-stuff}{}

\begin{enumerate}
\tightlist
\item
  An ordered listing.
\item
  Is even more nice.
\item
  Depending on the context
\end{enumerate}

\end{frame}

Haskell is still quite foreign to me (a shameful imperative programmer xD), but I think it somehow gets duplicated here

let fragile = "fragile" `elem` classes ||
not (null $ query hasCodeBlock elts ++ query hasCode elts)
let frameoptions = ["allowdisplaybreaks", "allowframebreaks", "fragile",
"b", "c", "t", "environment",
"label", "plain", "shrink", "standout",
"noframenumbering"]
let optionslist = ["fragile" | fragile && isNothing (lookup "fragile" kvs)] ++
[k | k <- classes, k `elem` frameoptions] ++
[k ++ "=" ++ v | (k,v) <- kvs, k `elem` frameoptions]

Possibly a side-effect of #4169 ? Note there are not even any code blocks on this slide.

Hope this helps some, thanks for pandoc ❤️

@mb21
Copy link
Collaborator

mb21 commented Jan 9, 2019

Jep, I think your analysis is spot on. Minimal repro:

echo '# foo \n\n## bar {.fragile} \n\nbaz' | pandoc -t beamer

@mb21
Copy link
Collaborator

mb21 commented Jan 9, 2019

It seems that we should just remove this:

["fragile" | fragile && isNothing (lookup "fragile" kvs)] ++

and add tests to cover all combinations.

@jgm jgm closed this as completed in 7e481d7 Jan 9, 2019
@svenevs
Copy link
Contributor Author

svenevs commented Jan 10, 2019

Awesome, thanks for the quick turnaround!

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

2 participants