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

html to epub conversion, metadata-file gets treated with tex_math_dollars #10585

Closed
RobertKosten opened this issue Jan 30, 2025 · 1 comment
Closed
Labels

Comments

@RobertKosten
Copy link

RobertKosten commented Jan 30, 2025

Explain the problem.
I'm converting a bunch of HTML files with associated metadata into epubs (The real-world case is https://www.rfc-editor.org/rfc/rfc3098.html). I've encountered a warning that implies that pandoc is trying to apply some of the tex_math_dollars magic to the metadata-file and switching it off explicitly for the source format does not help. I assume this is not intentional, but if it is I'd like a way to turn it off, please (I'm generating the metadata files, having to guess what kind of magic I have to ward against would be a PITA ;-) ).

<h1>Hello, world!</h1>
---
title: "Example $$$$$ Example $$$$$ Example"
creator:
    - role: "author"
      text: "Robert Kosten"
...
$ ./pandoc-3.6.2/bin/pandoc -f html-tex_math_dollars -t epub --metadata-file test.yaml -o test.epub test.html 
[WARNING] Could not convert TeX math $ Example , rendering as TeX:
  $ Example 
  ^
  unexpected '$'
  expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\allowbreak", "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "(", "[", "|", "\\lVert", "\\", "\\hyperref" or end of input
[WARNING] Could not convert TeX math $ Example , rendering as TeX:
  $ Example 
  ^
  unexpected '$'
  expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\allowbreak", "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "(", "[", "|", "\\lVert", "\\", "\\hyperref" or end of input

Pandoc version?

$ ./pandoc-3.6.2/bin/pandoc --version
pandoc 3.6.2
Features: +server +lua
Scripting engine: Lua 5.4
@jgm
Copy link
Owner

jgm commented Jan 30, 2025

See the documentation on --metadata-file:

string scalars in the metadata file will always be parsed as Markdown. (If the input format is Markdown or a Markdown variant, then the same variant will be used to parse the metadata file; if it is a non-Markdown format, pandoc’s default Markdown extensions will be used.)

You can backslash-escape the $s and it should be fine.

@jgm jgm closed this as completed Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants