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

Problem in beamer with certain formatting in section titles #2935

Closed
todd-a-jacobs opened this issue May 20, 2016 · 9 comments
Closed

Problem in beamer with certain formatting in section titles #2935

todd-a-jacobs opened this issue May 20, 2016 · 9 comments

Comments

@todd-a-jacobs
Copy link

Problem

The following results in an error:

pandoc -t beamer -o slides.pdf -V theme:Szeged --slide-level=2 *md

The error is:

 Argument of \@gobble has an extra }.
 <inserted text> 
                \par 
l.73 (10 min)}{Meeting Overview (10 min)}}

pandoc: Error producing PDF

However, removing the theme declaration allows the PDF to build, but (obviously) with the theme. This appears to be true regardless of what theme is selected. I also tried it with Frankfurt to be sure it wasn't just the one theme.

Environment

  • OS X 10.11.5
  • Homebrew 0.9.9
$ pandoc --version
pandoc 1.17.0.3
Compiled with texmath 0.8.5, highlighting-kate 0.6.2.
Syntax highlighting is supported for the following languages:
    abc, actionscript, ada, agda, apache, asn1, asp, awk, bash, bibtex, boo, c,
    changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css,
    curry, d, diff, djangotemplate, dockerfile, dot, doxygen, doxygenlua, dtd,
    eiffel, elixir, email, erlang, fasm, fortran, fsharp, gcc, glsl,
    gnuassembler, go, hamlet, haskell, haxe, html, idris, ini, isocpp, java,
    javadoc, javascript, json, jsp, julia, kotlin, latex, lex, lilypond,
    literatecurry, literatehaskell, llvm, lua, m4, makefile, mandoc, markdown,
    mathematica, matlab, maxima, mediawiki, metafont, mips, modelines, modula2,
    modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml, octave,
    opencl, pascal, perl, php, pike, postscript, prolog, pure, python, r,
    relaxng, relaxngcompact, rest, rhtml, roff, ruby, rust, scala, scheme, sci,
    sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, tcsh, texinfo, verilog, vhdl,
    xml, xorg, xslt, xul, yacc, yaml, zsh
@jgm
Copy link
Owner

jgm commented May 20, 2016

Can you provide a markdown file for us to use in input in testing, that allows the problem to be reproduced with the command line you provided?

@todd-a-jacobs
Copy link
Author

@jgm Not one that's for public consumption. I will try to email you instead.

@todd-a-jacobs
Copy link
Author

@jgm This tends to break when headers have embedded newlines for visual effect. For example:

# Break\
(10 min)

will cause the error. However, simply removing the backslash seems to resolve the issue, but prevents one from putting in sensible line breaks in long slide titles.

@jgm
Copy link
Owner

jgm commented May 21, 2016

This has nothing to do with themes. You can reproduce it with pandoc -t beamer -o my.pdf on this simple input:

# foo\
bar

Although section headers containing line breaks seem to work in LaTeX, they don't work in Beamer. I don't know why, but I don't see anything pandoc can do about this.

Note: although this method of getting a line break in a header works in pandoc, it's not at all portable, and may not work in the future. I would avoid this.

@jgm jgm closed this as completed May 21, 2016
@jgm jgm reopened this May 21, 2016
@jgm
Copy link
Owner

jgm commented May 21, 2016

OK, it's slightly more complex than I thought!
Using test.md:

# foo\
bar

we get the error. But with test2.md:

# foo\
bar

ok

we do not.

The difference in the latex source produced can be illustrated thus:

% pandoc -t beamer 
# foo\ 
bar
^D
\section{\texorpdfstring{foo\\
bar}{foo bar}}\label{foo-bar}
% pandoc -t beamer 
# foo\
bar

ok
^D
\begin{frame}{foo\\
bar}

ok

\end{frame}

@jgm
Copy link
Owner

jgm commented May 22, 2016

Relevant thread here: http://tex.findincity.net/view/63539927362983362659384/using-textit-in-section-with-beamer-class

Note that we get similar problems if instead of a line break we use, say, an emphasized word:

# Foo *bar* baz

I've tried inserting \protect in the generated tex, but it doesn't seem to help.

@jgm
Copy link
Owner

jgm commented Dec 7, 2016

Really this has to do with \texorpdfstring.

@jgm jgm changed the title Using Beamer themes prevent PDF creation Problem in beamer with certain formatting in section titles Dec 7, 2016
@heathermiller
Copy link

Same problem here.

@tarleb
Copy link
Collaborator

tarleb commented May 15, 2021

This seems to have been fixed, I can no longer reproduce the issue. Both of the following compile fine with pandoc 2.13:

pandoc -t beamer -f html -o out.pdf <<< '<h1>foo<br/>bar</h1>foo'
pandoc -t beamer -f html -o out.pdf <<< '<h1>foo<br/>bar</h1>'

@tarleb tarleb closed this as completed May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants