Created
September 5, 2012 10:20
-
-
Save lux01/3634609 to your computer and use it in GitHub Desktop.
A Windows PowerShell script to ease the process of generating LaTeX enabled gnuplot graphs. See http://luxlooks.wordpress.com/epslatex-script/ for more information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach( $i in $args ) { | |
$figurename = $i | |
} | |
$fontface = "times" | |
$fontsize = "scriptsize" | |
$outputname = "c$figurename" | |
$outputtex = "c$figurename.tex" | |
gnuplot "$figurename" | |
echo "\documentclass{article} | |
\usepackage{graphicx} | |
\usepackage{amssymb} | |
\usepackage{mathcomp} | |
\usepackage{textcomp} | |
\usepackage{color} | |
\usepackage{times} | |
\newcommand{\var}{\mathrm{\Var}} | |
\begin{document} | |
\pagestyle{empty} | |
\begin{figure} | |
\$fontsize | |
\input{$figurename} | |
\end{figure} | |
\end{document}" | out-file -force -encoding ASCII "$outputtex" | |
latex "$outputname" | |
dvips "$outputname.dvi" | |
ps2eps -f "$outputname.ps" | |
epstopdf "$outputname.eps" | |
rm "$outputname.aux" | |
rm "$outputname.log" | |
rm "$outputname.tex" | |
rm "$outputname.dvi" | |
rm "$outputname.eps" | |
rm "$outputname.ps" | |
rm "$figurename.tex" | |
rm "$figurename.eps" | |
if (Test-Path "$figurename.pdf") | |
{ | |
rm "$figurename.pdf" | |
} | |
mv "$outputname.pdf" "$figurename.pdf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment