I just read Matt Might's blog post on eliminating filler and "weasels" from my writing, and I am wondering how I would implement this on Latex to run and check my document? I know I should use terminal, but I'm not at all familiar with how Terminal accepts commands or which directory I would store the script in?

Thanks for any help.


You could save the script as ~/Scripts/weasels.sh with any text editor, and run it with bash ~/Scripts/weasels.sh ~/Documents/input\ file.txt. Or if you use TextMate, you can run the script with just ⌘R.

If you want to run the script with weasels instead of bash ~/Scripts/weasels.sh, you can make it executable and add its folder to the path:

mv ~/Scripts/weasels.sh ~/Scripts/weasels
chmod +x ~/Scripts/weasels
echo 'export PATH=~/Scripts:$PATH' >> ~/.bash_profile
. ~/.bash_profile
weasels ~/Documents/input\ file.txt
  • Hi Lauri, thanks for your help! I've created a perl file (weasels.pl) in TextMate with the three scripts from Matt's blog. Should I actually save it as "weasels.sh"? And would I run it after typing up my LaTeX document, where the foo.tex would go in place of "file.txt"? Thanks for your help. – Moderat Mar 12 '13 at 15:55
  • You should save them in separate files. And the first two scripts are shell scripts, which are commonly saved with a .sh extension (or no extension if they are executable). And yeah, it should also work with .tex files. It's probably better to start out with learning Python (look at the Google Trends graphs for Python vs Perl vs Ruby). – Lri Mar 13 '13 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .