Skip to content

aarepuu/latex-word-count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX Word Count

Script to count words over time in Tex files hosted on Git. Originally inspired by http://phdcomics.com/comics/archive_print.php?comicid=1915 and from Git Count Words LateX script by Bastian Rieck, originally available at https://gist.github.com/Submanifold/d7b996492dc3020f2acea87b49cc54c3.

NOTE! This solution uses Git's --word-diff to get the word count, which over estimates. Meaning that comments, tables etc. are all included in the word count!

Requirements

to install requirements

$ pip install -r requirements.txt

to use it

$ ./word_count.sh

If you only want to incude certain files (e.g., chapter.tex files), replace *.tex in git command:

...
added=$(git show -p --word-diff=porcelain $commit -- "*abstract.tex" "*chap*.tex" "*introduction.tex" | grep -e '^+[^+]' | wc -w)
deleted=$(git show -p --word-diff=porcelain $commit -- "*abstract.tex" "*chap*.tex" "*introduction.tex" | grep -e '^-[^-]' | wc -w)
...

to set writing goals

To set daily writing goals modify $daily_goal parameter in word_count.sh script and use today to run the script.

 ./word_count.sh today

to make graph

 ./word_count.sh | ./makegraph.py

Annotations coming soon...

TODOs/Ideas

  • annotations
  • add ignore meta files
  • automatic GIT hooks for making graph

About

Little script for PhD progress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published