Add word counting script + call it in .latexmkrc
This commit is contained in:
@@ -6,6 +6,9 @@ $aux_dir = ".aux";
|
|||||||
$bibtex = "biber %O %S";
|
$bibtex = "biber %O %S";
|
||||||
$pdf_previewer = "zathura %O %S";
|
$pdf_previewer = "zathura %O %S";
|
||||||
|
|
||||||
|
# Count words after compiling the full thing
|
||||||
|
$success_cmd = 'if [ %R = thesis ]; then ./wordcount.sh; fi';
|
||||||
|
|
||||||
# Create minted output path
|
# Create minted output path
|
||||||
use File::Path qw(make_path);
|
use File::Path qw(make_path);
|
||||||
make_path("$aux_dir/_minted");
|
make_path("$aux_dir/_minted");
|
||||||
|
|||||||
Executable
+13
@@ -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
|
||||||
Reference in New Issue
Block a user