From 8af93058df460a61508101f9b6eef567f9193ade Mon Sep 17 00:00:00 2001 From: Payton Bates Date: Sun, 4 Oct 2026 01:54:03 -0400 Subject: [PATCH] fix: Run makeglossaries whenever relevant input files change --- .gitattributes | 8 ++++++++ .gitignore | 4 +++- latexmkrc | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 latexmkrc diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e828222 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# Normalize text files to LF in the repo and working tree (matches Overleaf). +* text=auto eol=lf + +# Binary assets: never convert. +*.png binary +*.jpg binary +*.jpeg binary +*.pdf binary diff --git a/.gitignore b/.gitignore index 27d8845..b2450da 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,6 @@ *.lof *.lot *.lol -*.pdf \ No newline at end of file +*.pdf +*.data.minted +_minted*/ \ No newline at end of file diff --git a/latexmkrc b/latexmkrc new file mode 100644 index 0000000..b418105 --- /dev/null +++ b/latexmkrc @@ -0,0 +1,17 @@ +# Allow minted to call its external highlighter (Overleaf enables this by default). +$pdflatex = 'pdflatex -shell-escape %O %S'; + +# Run makeglossaries whenever the glossary/acronym input files change. +# Overleaf does this automatically; local latexmk (e.g. VS Code LaTeX Workshop) does not. +add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); +add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); + +sub run_makeglossaries { + my ($base_name, $path) = fileparse($_[0]); + my @args = ('-d', $path, $base_name); + unshift @args, '-q' if $silent; + return system('makeglossaries', @args); +} + +push @generated_exts, 'glo', 'gls', 'glg', 'acn', 'acr', 'alg'; +$clean_ext .= ' %R.ist %R.xdy';