Created
July 10, 2017 13:07
-
-
Save AndreasHassing/a8b023cb0dfa2baf180e4afd3902bafd to your computer and use it in GitHub Desktop.
Requires texcount, generates wordcount, charcount without spaces, charcount with spaces and pagecount based on charcount w/spaces (2400/page). Count characters in latex. Count words in latex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| wordcount=$(texcount Main.tex | sed -n 3p | sed 's/[^0-9]*//g') | |
| charcount=$(texcount -char Main.tex | sed -n 3p | sed 's/[^0-9]*//g') | |
| charcountws=$(($charcount + $wordcount)) | |
| pages=$(echo "$charcountws 2400" | awk '{printf "%.2f", $1/$2}') | |
| echo 'Wordcount:' $wordcount | |
| echo 'Charcount no spaces:' $charcount | |
| echo 'Charcount w/spaces:' $charcountws | |
| echo 'Pagecount based on charcount:' $pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment