[{"data":1,"prerenderedAt":147},["ShallowReactive",2],{"blog-post-pandoc-add-images-to-pdf":3,"recent-posts":86},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"avh2CBEAACgAj-6N","pandoc-add-images-to-pdf",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2CBEAACgAj-6N%22%29+%5D%5D",[],"2026-11-18T22:45:43+0000",[12],"pandoc-how-to-add-images-to-a-pdf",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","Pandoc: How to Add Images to a PDF",[],"ltr","2026-11-18",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to add images to a PDF from Markdown using Pandoc & Typst",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FaIbtTAp7L4N0xpOt_pandoc-add-images-to-pdf.png?auto=format,compress","aIbtTAp7L4N0xpOt",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,52,55,58,61,64,67,70,73,76,79,83],{"type":41,"text":42,"spans":43,"direction":22},"heading3","Install Pandoc and Typst",[],{"type":45,"text":46,"spans":47,"direction":22},"paragraph","Before we start, make sure you have Homebrew installed on your computer, a Markdown file and an image ready in a folder. Install Pandoc along with Typst, which acts as our PDF engine, with this command:",[],{"type":49,"text":50,"spans":51,"direction":22},"preformatted","brew install typst pandoc",[],{"type":41,"text":53,"spans":54,"direction":22},"Add the Image",[],{"type":45,"text":56,"spans":57,"direction":22},"First, open your Markdown file and add the image on its own line:",[],{"type":49,"text":59,"spans":60,"direction":22},"![Caption](image.jpg){width=50%}",[],{"type":45,"text":62,"spans":63,"direction":22},"The text in square brackets is the caption, and the path in round brackets points to your picture. Just remember to replace \u003Ccode>image.jpg\u003C\u002Fcode> with your actual image. The curly brackets set the size, so \u003Ccode>{width=50%}\u003C\u002Fcode> makes the image half the page wide. You can also use a fixed size, like \u003Ccode>{width=3in}\u003C\u002Fcode>.",[],{"type":41,"text":65,"spans":66,"direction":22},"Create the PDF",[],{"type":45,"text":68,"spans":69,"direction":22},"Next, navigate to the folder containing your Markdown file and run this command:",[],{"type":49,"text":71,"spans":72,"direction":22},"pandoc input.md --pdf-engine=typst -o output.pdf",[],{"type":45,"text":74,"spans":75,"direction":22},"Just swap \u003Ccode>input.md\u003C\u002Fcode> with your actual filename, and \u003Ccode>output.pdf\u003C\u002Fcode> with the name you want for the PDF. The \u003Ccode>--pdf-engine=typst\u003C\u002Fcode> flag tells Pandoc to use Typst, so you don't need a full LaTeX install. This finishes in about a second, and Pandoc doesn't print anything when it works.",[],{"type":45,"text":77,"spans":78,"direction":22},"To make sure everything worked, run \u003Ccode>open output.pdf\u003C\u002Fcode>. You should see your image with its caption right underneath. Keep in mind that the image path is relative to the folder you run Pandoc from.",[],{"type":80,"oembed":81},"embed",{"embed_url":82,"type":80},"",{"type":45,"text":84,"spans":85,"direction":22},"If you don't want a caption, just leave the square brackets empty, like \u003Ccode>![](image.jpg)\u003C\u002Fcode>, and the image sits inline with your text.",[],{"results":87,"page":37,"results_per_page":145,"results_size":145,"total_results_size":146,"total_pages":37},[88,107,126],{"id":89,"uid":90,"url":6,"type":7,"href":91,"tags":92,"first_publication_date":10,"last_publication_date":10,"slugs":93,"linked_documents":95,"lang":14,"alternate_languages":96,"data":97},"avh2CREAACsAj-6V","pandoc-convert-pdf-to-markdown","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2CREAACsAj-6V%22%29+%5D%5D",[],[94],"pandoc-how-to-convert-pdf-to-markdown",[],[],{"image":98,"title":104},{"dimensions":99,"alt":100,"copyright":6,"url":101,"id":102,"edit":103},{"width":31,"height":32},"Pandoc: How to Convert PDF to Markdown","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F-p25dHHmH8oerC6a_pandoc-convert-pdf-to-markdown.png?auto=format,compress","-p25dHHmH8oerC6a",{"x":36,"y":36,"zoom":37,"background":38},[105],{"type":19,"text":100,"spans":106,"direction":22},[],{"id":108,"uid":109,"url":6,"type":7,"href":110,"tags":111,"first_publication_date":10,"last_publication_date":10,"slugs":112,"linked_documents":114,"lang":14,"alternate_languages":115,"data":116},"avh2BREAACsAj-57","sox-trim-audio","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BREAACsAj-57%22%29+%5D%5D",[],[113],"sox-how-to-trim-audio",[],[],{"image":117,"title":123},{"dimensions":118,"alt":119,"copyright":6,"url":120,"id":121,"edit":122},{"width":31,"height":32},"SoX: How to Trim Audio","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FuxvNV-Rsgm5-5KyY_sox-trim-audio.png?auto=format,compress","uxvNV-Rsgm5-5KyY",{"x":36,"y":36,"zoom":37,"background":38},[124],{"type":19,"text":119,"spans":125,"direction":22},[],{"id":127,"uid":128,"url":6,"type":7,"href":129,"tags":130,"first_publication_date":10,"last_publication_date":10,"slugs":131,"linked_documents":133,"lang":14,"alternate_languages":134,"data":135},"avh2BxEAACcAj-6H","sox-fix-unsupported-audio-format","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=av4qlxYAACwAwP4a&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avh2BxEAACcAj-6H%22%29+%5D%5D",[],[132],"sox-how-to-fix-unsupported-audio-format",[],[],{"image":136,"title":142},{"dimensions":137,"alt":138,"copyright":6,"url":139,"id":140,"edit":141},{"width":31,"height":32},"SoX: How to Fix Unsupported Audio Format","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FWi9VtwU58Nuu2b8Q_sox-fix-unsupported-audio-format.png?auto=format,compress","Wi9VtwU58Nuu2b8Q",{"x":36,"y":36,"zoom":37,"background":38},[143],{"type":19,"text":138,"spans":144,"direction":22},[],3,69,1795041965066]