I need to implement an AppleScript code to crop plenty of images created through R and then transformed into TikZ images (LaTeX environment).
Here the (Windows) code suggested me:
rem CropRFig <R-Figure-name-without-tex-extension>
@echo \documentclass[tikz]{standalone} > temptex.tex
@echo \begin{document} >> temptex.tex
@echo \input{%1.tex} >> temptex.tex
@echo \end{document} >> temptex.tex
pdflatex temptex.tex
pdfcrop temptex.pdf
copy temptex-crop.pdf %1.pdf /Y
I am not able to transform this in an AppleScript to run on my MacBook.
Moreover, I would like to add another string of code in order to transform the newly created PDF (also) in an EPF image.
The starting question behind this was posted and answered on tex.stakexchange:
https://tex.stackexchange.com/questions/338083/tikz-cropping-inside-another-document