[Mac OS X TeX] BBEDit scripts (was Re: MacOSX-TeX Digest #153 - 11/14/01)
Michael Murray
mmurray at maths.adelaide.edu.au
Fri Nov 16 06:26:49 CET 2001
<x-flowed>>
>We still have the issue of pdf graphics files (sigh) when TeX mainly
>deals well with .ps files.
>
>Just as cmactex and texshop allow choices between tex and pdftex,
>the plugins could allow the same choice?
Here is one solution to this problem. It assume you have at the top
of your file one of the lines:
%&latex, %&pdflatex or %&personallatex as TeXShop uses.
The perl line is courtesy of posting a question on macnn so thanks
to that person and thanks
to Tom and Gerben who have helped me with other questions.
This replaces your existing pdflatex that Tom wrote. You could
obviously write a
pdftex version of this as well. Or I guess you could expand this one to
cover all 6 cases!
------------------------------------
#!/bin/tcsh
set texfile = $argv[1]
#echo $texfile
set formatline = `perl -0\015 -e 'print $1 if (<>=~/(.*?tex)/)' ${texfile}`
#echo $formatline
switch (${formatline})
case %&latex:
altpdflatex ${texfile}
breaksw
case %&pdflatex:
pdflatex ${texfile}
breaksw
case %&personallatex:
updflatex ${texfile}
breaksw
default:
echo "First line of ${texfile} does not specify format"
endsw
--------------------------------------------------------
Use it at your own risk! My lifetime
experience of shell scripting must add up to something like 4 hours.
For those out there who have > 4 hours experience at shell scripts
who are wondering
why I didn't just use
head - 1 ${texfile}
instead of the perl stuff (which I don't understand). I did try that at first
but it doesn't like files saved with macintosh line endings.
>Is there a way to make separator lines in the BBEdit so that the tex
>plugins are grouped together nicely?
>
I also wondered about this.
Michael
--
_________________________________________________________
Assoc/Prof Michael Murray
Department of Pure Mathematics Fax: 61+ 8 8303
3696
University of Adelaide Phone: 61+ 8 8303 4174
Australia 5005 Email: mmurray at maths.adelaide.edu.au
Home Page: http://www.maths.adelaide.edu.au/pure/mmurray
PGP public key:
http://www.maths.adelaide.edu.au/pure/mmurray/pgp.txt
_________________________________________________________
-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------
</x-flowed>
More information about the macostex-archives
mailing list