updated script to extract tikz and create standalone graphics