marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.85k stars 105 forks source link

Generation of PDF failed with too much latex formulas #545

Closed bfueldner closed 11 months ago

bfueldner commented 11 months ago

Version of Marp Tool

Marp CLI 3.2.1

Operating System

Linux

Environment

How to reproduce

  1. Generate markdown file test.md with following content:
# Low-pass filter

$$R = 220\ohm$$
$$C = 10nF$$
$$f_{cutoff} = \frac{1}{2\pi RC} = \frac{1}{2\pi \cdot 220\ohm \cdot 10nF} = 72.34Hz$$

---
  1. Convert to PDF
    $ marp --pdf test.md

test.pdf will be generated without problems.

  1. Copy to content of test.md 150-times into the same file to generate 150 pages with multiple formulas and save it

  2. Convert to PDF again

    $ marp --pdf test.md

Conversion will fail and the console is floated with the base64 encoded HTML version of the input file.

Expected behavior

Conversion of markdown files with unlimited numbers of latex formulas.

Actual behavior

Conversion aborts with the error:

Failed converting Markdown. (net::ERR_ABORTED at data:text/html;base64,<lots of base64 encoded data>

Additional information

No response

yhatt commented 11 months ago

Perhaps it has reached the limit of URL length for Chromium I think it would be required a proper solution or fallback alternative to data URI.

Workaround: Add --allow-local-files option. It always uses the local file URI instead of data URI.

bfueldner commented 11 months ago

Thank you for the fast response and the workaround! It worked for me and the PDF is generated without problems.