Skip to content

Instantly share code, notes, and snippets.

@aldente39
Created June 9, 2012 03:23
Show Gist options
  • Save aldente39/2899241 to your computer and use it in GitHub Desktop.
Save aldente39/2899241 to your computer and use it in GitHub Desktop.
tex2pdf
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