@echo OFF
WHERE pdflatex >nul 2>&1 && (
    echo Found pdfLaTeX
) || (
    echo Cannot find pdfLaTeX location.
	echo In this script, please replace all instances of "pdflatex.exe" by the full path to pdflatex.exe and recompile.
	pause
	exit /B
)
echo ON

pdflatex.exe -interaction=nonstopmode figure1.tex
pdflatex.exe --enable-write18 --extra-mem-bot=60000000 --extra-mem-top=60000000 -synctex=1 -interaction=nonstopmode figure2.tex
pdflatex.exe --enable-write18 --extra-mem-bot=60000000 --extra-mem-top=60000000 -synctex=1 -interaction=nonstopmode figure3.tex
pdflatex.exe -interaction=nonstopmode figure4.tex