Skip to content

Instantly share code, notes, and snippets.

@steinar
Created April 13, 2011 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steinar/917711 to your computer and use it in GitHub Desktop.
Save steinar/917711 to your computer and use it in GitHub Desktop.
Convert modified PGF (pgf/tikz) files to PDF
#!/bin/sh
# Convert modified PGF (pgf/tikz) files to PDF
pgfTemplate="template.pgs";
echo "Updating modified PGF files:"
for path in $(find . -iname "*.pgf")
do
pgfPath=`dirname $path`/`basename $path pgf`pdf;
if [ ! -e $pgfPath ] || [ $path -nt $pgfPath ]; then
echo $pgfPath;
pgfContents=`cat $path`;
replace "<>" "$pgfContents" < $pgfTemplate | rubber-pipe -d > $pgfPath;
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment