From 2a607d6f21aacd476b74b8b93005897b988a5f15 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Thu, 27 Mar 2025 09:59:17 +0100 Subject: [PATCH] refactor(docs): enhance PDF build process and font settings Improves the PDF generation process by adding verbosity and updating font configurations, ensuring better compatibility and output quality. - Add "--verbose" to pandoc command for detailed output during PDF generation - Change monofont from "SauceCodePro Nerd Font" to "Noto Sans Mono" for improved font rendering - Switch PDF engine from "pdflatex" to "xelatex" for better Unicode support - Uncomment fontspec package in LaTeX to enable custom font settings - Add inputenc package and Unicode character declaration for extended character support Signed-off-by: Glenn Y. Rolland --- utils/docs/build_pdf.py | 5 +++-- utils/docs/main.tex | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/docs/build_pdf.py b/utils/docs/build_pdf.py index efc732f..e4ba81a 100755 --- a/utils/docs/build_pdf.py +++ b/utils/docs/build_pdf.py @@ -39,6 +39,7 @@ print(f"Output: {output_file}") # Build the pandoc options as a string pandoc_cmd = [ + "--verbose", "--toc", "--number-sections", "--include-in-header", "utils/docs/main.tex", @@ -47,8 +48,8 @@ pandoc_cmd = [ # "-V", "geometry:a4paper", # "-V", "geometry:margin=1.8cm", "-V", "mainfont=DejaVu Serif", - "-V", "monofont=SauceCodePro Nerd Font", - "--pdf-engine=pdflatex", + "-V", "monofont=Noto Sans Mono", + "--pdf-engine=xelatex", "--resource-path=utils/docs", "--filter=./utils/docs/filter-nobg.hs", ] diff --git a/utils/docs/main.tex b/utils/docs/main.tex index d0802c6..1da5681 100644 --- a/utils/docs/main.tex +++ b/utils/docs/main.tex @@ -2,6 +2,8 @@ % Set the document language to English \usepackage[english]{babel} +% \usepackage[utf8]{inputenc} +% \DeclareUnicodeCharacter{21D2}{$\Rightarrow$} % Adjust page geometry \usepackage[ @@ -25,6 +27,6 @@ \input{utils/docs/hyperref_setup.tex} % Font settings using fontspec -% \usepackage{fontspec} +\usepackage{fontspec} % \setmainfont{DejaVu Serif} % Set your main font % \setmonofont{SauceCodePro Nerd Font} % Set your monospace (code) font