Add word counting script + call it in .latexmkrc

This commit is contained in:
2026-09-11 11:26:53 +02:00
parent e4f8de5fa5
commit 0d4c0fb3c9
2 changed files with 16 additions and 0 deletions
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
# Relative paths
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
wordcount=$(pdftotext .out/thesis.pdf - | wc -w)
timestamp=$(date +%FT%T%:z)
if [[ ! -s wordcounts.csv ]]; then
printf 'date,wordcount\n' >> wordcounts.csv
fi
printf '%s,%s\n' "$timestamp" "${wordcount//[[:space:]]/}" >> wordcounts.csv