August 3, 2022

Make pandoc file conversion faster

You can check why pandoc conversion is slow by appending --trace to the command, for instance:

$ pandoc file.md -o file.pdf --trace

Pandoc will print the diagnostic of parsing process paragraph by paragraph, roughly.

For example if the output of the parsing process is stuck on paragraph line 24, as shown below, it means that pandoc is having a hard time parsing what comes right after e.g. paragraph 25.

[trace] Parsed [Para [Str "It",Space,Str "is",Space,Str "easier",Space,Str at line 24

To improve the speed at which pandoc is parsing the file, open the file and check what is slowing down parsing right after the paragraph line 24, a missing square bracket for example.

You can open the file directly on line 24, for example, by running:

$ vi file.md +24


Reminder: you can always find commands or tips by checking the manual of a programme e.g. man pandoc and searching through the file by entering :/\<keyword\> e.g.:/\<parser\>

The entry for --trace is: Print diagnostic output tracing parser progress to stderr. This option is intended for use by developers in diagnosing performance issues.”


pandoc command line personal computing


No affiliates, No Google Analytics, No Facebook Pixel. © 2016-2022. Content is licensed under a CC BY-NC-SA 4.0.