Created
June 9, 2012 03:23
-
-
Save aldente39/2899241 to your computer and use it in GitHub Desktop.
tex2pdf
This file contains 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
function tex2pdf([string]$filename, [switch]$nolog){ | |
$pdfname = $filename -replace ".tex", ".pdf" | |
$psinfo = ps | Where-Object{$_.MainWindowTitle -like "*"+ $pdfname +"*"} | |
if($psinfo -ne $NULL){ | |
foreach($a in $psinfo){ | |
kill $a.Id | |
} | |
} | |
platex $filename | |
$newfilename = $filename -replace ".tex", ".dvi" | |
dvipdfmx $newfilename | |
if($nolog){ | |
$logname = $filename -replace ".tex", ".log" | |
$auxname = $filename -replace ".tex", ".aux" | |
$dviname = $filename -replace ".tex", ".dvi" | |
rm $logname | |
rm $auxname | |
rm $dviname | |
} | |
start $pdfname | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment