Skip to content

Instantly share code, notes, and snippets.

@jbedo
Created November 18, 2012 22:59
Show Gist options
  • Save jbedo/4107982 to your computer and use it in GitHub Desktop.
Save jbedo/4107982 to your computer and use it in GitHub Desktop.
Like fmt(1) but intended for TeX. Terminates sentences with newline.
#!/usr/bin/env rc
. 9.rc
f=/tmp/fmt.$pid
fmt -l9999 | sed -e 's/([;\.])[ ]+/\1\n/g' > $f
cat $f | while(line=`{read}){
if(! ~ $line "" )
echo $line | fmt $*
}
rm $f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment