I made a few changes to suit my needs bettter.

Moved template to /common/tex
Added siunitx, mhchem, and related commands to template preamble
Use basename of tikz-file as pdf filename instead of the generic "template"
master
Taha Ahmed 13 years ago
parent ad16030373
commit 91f655e744

@ -33,6 +33,8 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# With a few changes by me 2011-03-29 /Taha Ahmed
import sys, os.path, subprocess, glob, time, optparse, tempfile
@ -49,14 +51,14 @@ op.add_option("-s", "--view", action = "store_true",
options, args = op.parse_args()
tikzName, = args # exactly one filename expected
basename = "tikz2pdf_temp"
basename = os.path.splitext(tikzName)[0] # equivalent to basename(tikzName) in R
texName = basename + ".tex"
pdfName = basename + ".pdf"
templateFilename = os.path.expanduser("~/.tikz2pdf.tex")
templateFilename = os.path.expanduser("/home/taha/chepec/chetex/common/tex/tikz2pdf.tex")
searchDir = os.getcwd()
while searchDir != "/":
candidate = os.path.join(searchDir, ".tikz2pdf.tex")
candidate = os.path.join(searchDir, "tikz2pdf.tex")
if os.path.exists(candidate):
templateFilename = candidate
sys.stdout.write("Using template %r.\n" % candidate)
@ -143,4 +145,3 @@ for temp in glob.glob("tikz2pdf_temp.*"):
verboseUnlink(temp)
# for ext in (".aux", ".log"):
# verboseUnlink(basename + ext)

Loading…
Cancel
Save