|
|
|
Hide temporary files created by TeXShop
I also have a slightly more polished version of the script:
import os
import sys
import shutil
tmp_dir = '.tmp'
# find out the name of the file to compile
tex_file = sys.argv[-1]
file_name, file_ext = os.path.splitext(tex_file)
assert file_ext[1:] == 'tex'
# create the temporary directory if it doesn't exist
if not os.path.isdir(tmp_dir):
try:
os.mkdir(tmp_dir)
except OSError:
raise IOError('A file named "%s" already exists in this catalog' % tmp_dir)
# run pdflatex
os.system('pdflatex --shell-escape --output-directory=%s %s' % (tmp_dir, file_name))
# move the pdf file back to the tex directory
try:
shutil.move('%s%s%s.pdf' % (tmp_dir, os.path.sep, file_name), os.curdir)
except IOError:
print '\n\nPdf file not found.'
Hide temporary files created by TeXShop
Nice improvement. Is there a way to make it show up in the Typset in TeXShop and not only in drop-down menu within the .tex file's window? |
SearchFrom our Sponsor...Latest Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2013 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.09 seconds |
|