Execute scripts with LaTeX
Have you ever made a script generating content for your LaTeX tables?
And are you tired of running them every time you have new data?
Then make LaTeX run them when comipling. Just use the command
\write18{COMMAND}
and compile your document with
latex -shell-escape
NOTE: Do never run latex with -shell-escape if you did not make the document yourself, it might just eat your children.
Leave a Comment
Print pdf files from bash
Tired of manually doing pdf2ps and then lpr so you can print from the commandline. This bash function is the solution.
function printpdf ()
{
for i in $@; do
if [ "$1" != "$i" ]; then
dt=`date +%y%m%d%H%M%S`
pdftops $i temp-print${dt}.ps
lpr -P $1 temp-print${dt}.ps
rm temp-print${dt}.ps
fi
done
}
Usage:
printpdf printername file1.pdf file2.pdf file3.pdf ….