Skip to content

Instantly share code, notes, and snippets.

View dfolio's full-sized avatar
😄
I feel good 😄

D. Folio dfolio

😄
I feel good 😄
View GitHub Profile
@Pseudomanifold
Pseudomanifold / git_count_words_latex.sh
Last active April 27, 2023 14:58
Counting words in TeX files under version control in order to depict the temporal evolution of the document. Useful for creating graphs such as the one shown in PhD comics #1915, http://phdcomics.com/comics/archive.php?comicid=1915.
#!/bin/bash
#
# This script traverses all commits of a git repository in the current directory
# and counts the number of words that are changed, i.e. added or deleted for all
# TeX files. The output contains a time-stamp (YYYY-MM-DD). Next, there are some
# counts, viz. the number of added, deleted, and total words.
#
# You can use `gnuplot`, for example, to create nice visualizations from the raw
# data. For this, it may be useful to specify the first column as a date column:
#