DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

2

`pandoc in.md -t context -o out.pdf` doesn't have syntax highlighting

If I did it without -t, or with -t latex, it will support highlighting.

Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and LaTeX/PDF output.

Is there a way around this?

Otherwise, can I convert all <pre><code> blocks to HTML blocks, highlight them with Prism.js, and convert back to PNG?

I found this, but couldn't make sense of it.

Why ConTeXt? It seems to be the only way I can,

  • Change paper size mid-way
  • Easier to centering vertically

Top comments (2)

Collapse
 
levirs565 profile image
Levi Rizki Saputra

try converting into HTML. Then convert the HTML to PDF using Chrome or Firefox.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I tried to avoid that, because I can't have multiple paper sizes / margins / header-footer control.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay