[{"data":1,"prerenderedAt":137},["ShallowReactive",2],{"blog-post-pandoc-number-sections":3,"recent-posts":76},{"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},"avrK3xEAACkAR0Qo","pandoc-number-sections",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awDNohIAAC0AFWrz&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avrK3xEAACkAR0Qo%22%29+%5D%5D",[],"2026-11-20T22:45:54+0000",[12],"pandoc-how-to-number-sections",[],"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 Number Sections",[],"ltr","2026-11-20",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to number the sections of a document using Pandoc",[],{"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\u002FOcIfaHgVvcINl4gZ_pandoc-number-sections.png?auto=format,compress","OcIfaHgVvcINl4gZ",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,51,54,57,60,63,66,69,73],{"type":41,"text":42,"spans":43,"direction":22},"paragraph","Before we start, make sure you have Pandoc and Typst installed on your computer and your Markdown file ready in a folder. If you don't have them yet, run this command:",[],{"type":45,"text":46,"spans":47,"direction":22},"preformatted","brew install pandoc typst",[],{"type":41,"text":49,"spans":50,"direction":22},"First, open your terminal and navigate to the folder that has your file. To number the headings, run this command:",[],{"type":45,"text":52,"spans":53,"direction":22},"pandoc input.md -N --pdf-engine=typst -o output.pdf",[],{"type":41,"text":55,"spans":56,"direction":22},"Just remember to replace \u003Ccode>input.md\u003C\u002Fcode> with your actual filename. The \u003Ccode>-N\u003C\u002Fcode> flag turns on section numbering, and \u003Ccode>--pdf-engine=typst\u003C\u002Fcode> tells Pandoc to use Typst to make the PDF. By default, the headings are numbered like \u003Ccode>1\u003C\u002Fcode>, \u003Ccode>1.1\u003C\u002Fcode> and \u003Ccode>1.1.1\u003C\u002Fcode>.",[],{"type":41,"text":58,"spans":59,"direction":22},"If you want a different style, add the \u003Ccode>section-numbering\u003C\u002Fcode> variable with \u003Ccode>-V\u003C\u002Fcode>. For example, \u003Ccode>1.A.1\u003C\u002Fcode> gives you numbers for the top level and letters for the next level:",[],{"type":45,"text":61,"spans":62,"direction":22},"pandoc input.md -N -V section-numbering=\"1.A.1\" --pdf-engine=typst -o output.pdf",[],{"type":41,"text":64,"spans":65,"direction":22},"You can use \u003Ccode>1\u003C\u002Fcode>, \u003Ccode>a\u003C\u002Fcode>, \u003Ccode>A\u003C\u002Fcode>, \u003Ccode>i\u003C\u002Fcode> and \u003Ccode>I\u003C\u002Fcode> in the pattern. Don't worry if you don't see a success message, Pandoc stays quiet when it works.",[],{"type":41,"text":67,"spans":68,"direction":22},"To make sure everything worked, run \u003Ccode>open output.pdf\u003C\u002Fcode> and check the headings.",[],{"type":70,"oembed":71},"embed",{"embed_url":72,"type":70},"",{"type":41,"text":74,"spans":75,"direction":22},"One more tip: if you want a heading to stay without a number, like an Introduction, add \u003Ccode>{.unnumbered}\u003C\u002Fcode> after it in your Markdown file, like \u003Ccode># Introduction {.unnumbered}\u003C\u002Fcode>.",[],{"results":77,"page":37,"results_per_page":135,"results_size":135,"total_results_size":136,"total_pages":37},[78,97,116],{"id":79,"uid":80,"url":6,"type":7,"href":81,"tags":82,"first_publication_date":10,"last_publication_date":10,"slugs":83,"linked_documents":85,"lang":14,"alternate_languages":86,"data":87},"avrK5BIAAC0AdTyQ","imagemagick-convert-svg-to-png","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awDNohIAAC0AFWrz&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avrK5BIAAC0AdTyQ%22%29+%5D%5D",[],[84],"imagemagick-how-to-convert-svg-to-png",[],[],{"image":88,"title":94},{"dimensions":89,"alt":90,"copyright":6,"url":91,"id":92,"edit":93},{"width":31,"height":32},"ImageMagick: How to Convert SVG to PNG","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FpEAudnXxv1yf87LU_imagemagick-convert-svg-to-png.png?auto=format,compress","pEAudnXxv1yf87LU",{"x":36,"y":36,"zoom":37,"background":38},[95],{"type":19,"text":90,"spans":96,"direction":22},[],{"id":98,"uid":99,"url":6,"type":7,"href":100,"tags":101,"first_publication_date":10,"last_publication_date":10,"slugs":102,"linked_documents":104,"lang":14,"alternate_languages":105,"data":106},"avrK4REAACgAR0Qw","imagemagick-convert-heic-to-jpg","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awDNohIAAC0AFWrz&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avrK4REAACgAR0Qw%22%29+%5D%5D",[],[103],"imagemagick-how-to-convert-heic-to-jpg",[],[],{"image":107,"title":113},{"dimensions":108,"alt":109,"copyright":6,"url":110,"id":111,"edit":112},{"width":31,"height":32},"ImageMagick: How to Convert HEIC to JPG","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F3WuWzGUB4ZOIYvKy_imagemagick-convert-heic-to-jpg.png?auto=format,compress","3WuWzGUB4ZOIYvKy",{"x":36,"y":36,"zoom":37,"background":38},[114],{"type":19,"text":109,"spans":115,"direction":22},[],{"id":117,"uid":118,"url":6,"type":7,"href":119,"tags":120,"first_publication_date":10,"last_publication_date":10,"slugs":121,"linked_documents":123,"lang":14,"alternate_languages":124,"data":125},"avrK6BIAAC0AdTye","imagemagick-create-favicon","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=awDNohIAAC0AFWrz&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22avrK6BIAAC0AdTye%22%29+%5D%5D",[],[122],"imagemagick-how-to-create-a-favicon",[],[],{"image":126,"title":132},{"dimensions":127,"alt":128,"copyright":6,"url":129,"id":130,"edit":131},{"width":31,"height":32},"ImageMagick: How to Create a Favicon","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F5k126N5qH3VDTNmJ_imagemagick-create-favicon.png?auto=format,compress","5k126N5qH3VDTNmJ",{"x":36,"y":36,"zoom":37,"background":38},[133],{"type":19,"text":128,"spans":134,"direction":22},[],3,79,1795214777283]