diff --git a/blog-vault/.obsidian/core-plugins.json b/blog-vault/.obsidian/core-plugins.json index 61f5159dbeb535dfdc4499bcd4bf05cae7d6073f..572353754e1101caa3d7abd3b306703e066caff1 100644 --- a/blog-vault/.obsidian/core-plugins.json +++ b/blog-vault/.obsidian/core-plugins.json @@ -26,5 +26,6 @@ "workspaces": false, "file-recovery": true, "publish": false, - "sync": false + "sync": false, + "webviewer": false } \ No newline at end of file diff --git a/blog-vault/.obsidian/workspace.json b/blog-vault/.obsidian/workspace.json index dd696466e07e7d18c1455a11f37fc44ac9023460..97eaf730345d802133960a4e2226a741e6c404ef 100644 --- a/blog-vault/.obsidian/workspace.json +++ b/blog-vault/.obsidian/workspace.json @@ -8,17 +8,17 @@ "type": "tabs", "children": [ { - "id": "ca11f416f87e728f", + "id": "243320f073b2669e", "type": "leaf", "state": { "type": "markdown", "state": { - "file": "posts/2025-01-24 Use multiple audio outputs at once on Ubuntu 24.04.md", + "file": "posts/2025-02-05 Make Beautiful Reports with Pandoc.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "2025-01-24 Use multiple audio outputs at once on Ubuntu 24.04" + "title": "2025-02-05 Make Beautiful Reports with Pandoc" } } ] @@ -40,7 +40,8 @@ "state": { "type": "file-explorer", "state": { - "sortOrder": "alphabetical" + "sortOrder": "alphabetical", + "autoReveal": false }, "icon": "lucide-folder-closed", "title": "Files" @@ -127,7 +128,9 @@ "type": "tag", "state": { "sortOrder": "frequency", - "useHierarchy": true + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" }, "icon": "lucide-tags", "title": "Tags" @@ -166,7 +169,8 @@ } ], "direction": "horizontal", - "width": 300 + "width": 300, + "collapsed": true }, "left-ribbon": { "hiddenItems": { @@ -179,8 +183,13 @@ "bulk-exporter:Bulk Exporter Preview": false } }, - "active": "ca11f416f87e728f", + "active": "243320f073b2669e", "lastOpenFiles": [ + "posts/2024-11-27 First Blog Post.md", + "templates/Blog Post Template.md", + "images/Pasted Image 20250210233211.png", + "posts/2025-02-05 Make Beautiful Reports with Pandoc.md", + "images/Pasted image 20250210233148.png", "posts/2025-01-24 Use multiple audio outputs at once on Ubuntu 24.04.md", "images/Pasted image 20250124112849.png", "images/Pasted image 20250124112639.png", @@ -190,10 +199,7 @@ "images/Pasted image 20250124102547.png", "images/Pasted image 20250124101720.png", "posts/2024-11-28 Escaping Text for URLs in Python.md", - "posts/2024-11-27 First Blog Post.md", "posts/2024-11-28 Reading All The Cards with a Proxmark 3.md", - "Untitled.md", - "templates/Blog Post Template.md", "images/Pasted image 20241127184913.png", "images", "posts", diff --git a/blog-vault/images/Pasted Image 20250210233211.png b/blog-vault/images/Pasted Image 20250210233211.png new file mode 100644 index 0000000000000000000000000000000000000000..319c3f6b5edefe7864ff33608f068dfc65dd1131 Binary files /dev/null and b/blog-vault/images/Pasted Image 20250210233211.png differ diff --git a/blog-vault/images/Pasted image 20250210233148.png b/blog-vault/images/Pasted image 20250210233148.png new file mode 100644 index 0000000000000000000000000000000000000000..944b1bd0bbedecddac0abbb73813e3ed5dece626 Binary files /dev/null and b/blog-vault/images/Pasted image 20250210233148.png differ diff --git a/blog-vault/posts/2025-02-05 Make Beautiful Reports with Pandoc.md b/blog-vault/posts/2025-02-05 Make Beautiful Reports with Pandoc.md new file mode 100644 index 0000000000000000000000000000000000000000..34e489ca73996c6d65e684ef6a4ce5acd7e95fcf --- /dev/null +++ b/blog-vault/posts/2025-02-05 Make Beautiful Reports with Pandoc.md @@ -0,0 +1,73 @@ +--- +title: Make Beautiful Reports with Pandoc +date: 2025-02-05T10:08:09+00:00 +draft: false +tags: + - ubuntu +--- +I've found myself needing to make a PDF report from something written in Markdown. Obsidian's built-in PDF Export and Better PDF Export both work fine, but they lack the flexibility - particularly in making a table of contents with page numbers. + +After some research, I've come across a theme for Pandoc called Eisvogel, which allows you to export pretty documents from Markdown files. + +# Installation +Install Pandoc via [their instructions](https://pandoc.org/installing.html). You'll also need to install TeX Live for generating PDF documents too - on Debian/Ubuntu this is `sudo apt install texlive`. + +Then, copy the `eisvogel.tex` from Eisvogel's [latest release](https://github.com/enhuiz/eisvogel/tags) to `~/.pandoc/templates/eisvogel.latex` in your home folder. + +# Frontmatter +In order to use all of the features, you need to add some stuff to your frontmatter: +``` +--- +title: Document Title +subtitle: Subtitle +author: You +lang: en +titlepage: true +toc-own-page: true +--- +``` +This one specifies to add a title page, and to add a page break after the table of contents. More documentation on frontmatter options [here](https://github.com/enhuiz/eisvogel?tab=readme-ov-file#custom-template-variables). + +# The Command +```bash +pandoc -f gfm -t pdf --template eisvogel --listings --toc=true -o output.pdf input.md +``` +This generates an `output.pdf` file from the `input.md`, which is a GitHub Flavored Markdown file (hence `-f gfm`). Listings and a table of contents are enabled, and we're using the Eisvogel template. + +Here's what it looks like: +![[Pasted Image 20250210233211.png]] +# Change the Font +You can change the font to any installed on your system by using the xelatex engine instead of the standard pdftex one. Install it with `sudo apt install texlive-xetex`, then run the following to generate the file: +```bash +pandoc -f gfm -t pdf --pdf-engine=xelatex --template eisvogel --listings --toc=true -o output.pdf input.md +``` + +> [!TIP] +> You may need to remove the `lang` attribute from your frontmatter because there seems to be a bug with it. + +However, after this you can then set the `mainfont` property to any font on your system: +```yaml +--- +title: Document Title +subtitle: Subtitle +author: You +titlepage: true +toc-own-page: true +mainfont: "Inter" +--- +``` + +# Add a Title Page +Place a file named `background.pdf` in the same directory. If you're stuck for a background, try [this example](https://github.com/enhuiz/eisvogel/blob/master/examples/custom-titlepage/background.pdf). + +Then, just add this to your frontmatter: +```yaml +--- +... +titlepage: true +titlepage-text-color: FFFFFF +titlepage-rule-color: "360049" +titlepage-rule-height: 0 +titlepage-background: "background.pdf" +--- +``` diff --git a/content/posts/2025-02-05 Make Beautiful Reports with Pandoc.md b/content/posts/2025-02-05 Make Beautiful Reports with Pandoc.md new file mode 100644 index 0000000000000000000000000000000000000000..0d072bbc3906da77f99c685f9db939302f04be2c --- /dev/null +++ b/content/posts/2025-02-05 Make Beautiful Reports with Pandoc.md @@ -0,0 +1,73 @@ +--- +title: Make Beautiful Reports with Pandoc +date: 2025-02-05T10:08:09+00:00 +draft: false +tags: + - ubuntu +--- +I've found myself needing to make a PDF report from something written in Markdown. Obsidian's built-in PDF Export and Better PDF Export both work fine, but they lack the flexibility - particularly in making a table of contents with page numbers. + +After some research, I've come across a theme for Pandoc called Eisvogel, which allows you to export pretty documents from Markdown files. + +# Installation +Install Pandoc via [their instructions](https://pandoc.org/installing.html). You'll also need to install TeX Live for generating PDF documents too - on Debian/Ubuntu this is `sudo apt install texlive`. + +Then, copy the `eisvogel.tex` from Eisvogel's [latest release](https://github.com/enhuiz/eisvogel/tags) to `~/.pandoc/templates/eisvogel.latex` in your home folder. + +# Frontmatter +In order to use all of the features, you need to add some stuff to your frontmatter: +``` +--- +title: Document Title +subtitle: Subtitle +author: You +lang: en +titlepage: true +toc-own-page: true +--- +``` +This one specifies to add a title page, and to add a page break after the table of contents. More documentation on frontmatter options [here](https://github.com/enhuiz/eisvogel?tab=readme-ov-file#custom-template-variables). + +# The Command +```bash +pandoc -f gfm -t pdf --template eisvogel --listings --toc=true -o output.pdf input.md +``` +This generates an `output.pdf` file from the `input.md`, which is a GitHub Flavored Markdown file (hence `-f gfm`). Listings and a table of contents are enabled, and we're using the Eisvogel template. + +Here's what it looks like: + +# Change the Font +You can change the font to any installed on your system by using the xelatex engine instead of the standard pdftex one. Install it with `sudo apt install texlive-xetex`, then run the following to generate the file: +```bash +pandoc -f gfm -t pdf --pdf-engine=xelatex --template eisvogel --listings --toc=true -o output.pdf input.md +``` + +> [!TIP] +> You may need to remove the `lang` attribute from your frontmatter because there seems to be a bug with it. + +However, after this you can then set the `mainfont` property to any font on your system: +```yaml +--- +title: Document Title +subtitle: Subtitle +author: You +titlepage: true +toc-own-page: true +mainfont: "Inter" +--- +``` + +# Add a Title Page +Place a file named `background.pdf` in the same directory. If you're stuck for a background, try [this example](https://github.com/enhuiz/eisvogel/blob/master/examples/custom-titlepage/background.pdf). + +Then, just add this to your frontmatter: +```yaml +--- +... +titlepage: true +titlepage-text-color: FFFFFF +titlepage-rule-color: "360049" +titlepage-rule-height: 0 +titlepage-background: "background.pdf" +--- +``` diff --git a/static/images/Pasted Image 20250210233211.png b/static/images/Pasted Image 20250210233211.png new file mode 100644 index 0000000000000000000000000000000000000000..319c3f6b5edefe7864ff33608f068dfc65dd1131 Binary files /dev/null and b/static/images/Pasted Image 20250210233211.png differ diff --git a/themes/hermit-v2 b/themes/hermit-v2 index 917a0329be750d254fb1f7c3e69015042120a617..70f3e489bb8b4f578022378ec5154e45c9e419f2 160000 --- a/themes/hermit-v2 +++ b/themes/hermit-v2 @@ -1 +1 @@ -Subproject commit 917a0329be750d254fb1f7c3e69015042120a617 +Subproject commit 70f3e489bb8b4f578022378ec5154e45c9e419f2