[OS X TeX] BBedit and LaTeX integration under Leopard

Jan Anderssen jan at linguist.umass.edu
Mon Jan 14 11:33:08 EST 2008

Hi Dave,

a little belated, but just to mention another option.

> Is anybody using BBedit to write their .tex files? How do you manage  
> to turn your .tex files into PDFs?

I'm using TextWrangler with latexmk [1].

LatexMk came straight from its website, but I use the configuration  
options in [2] (thanks to Herb Schulz).

 From TextWrangler, I start latexmk through the Applescript in [3]  
(adapted (mutilated?) from one of Maarten's scripts). The options for  
latexmk are set in the script (--pvc for continuous preview and --pdf  
for running pdflatex).

There are probably some cases where this could be improved (latexmk  
already running, but in some other Terminal window, etc etc), but,  
especially given that I don't really know applescript, I decided that  
this works good enough for me for now.


[1]   http://www.phys.psu.edu/~collins/software/latexmk-jcc/versions.html

[2]   /usr/local/share/latexmk/LatexMk:

$pscmd = 'ps -ww -u $ENV{USER}';
$pid_position = 1;
$pdf_previewer = 'open -a Skim';
$pdf_update_method = 0;

[3]   /Users/jan/Library/Application Support/TextWrangler/Scripts/ 
Start LaTeXMk (continuous, pdf).scpt

tell application "TextWrangler"
	set numdocs to the number of text documents
	repeat with i from 1 to numdocs
		if (modified of text document i) then
			save text document i
		end if
	end repeat
end tell
if numdocs > 0 then
	tell application "TextWrangler"
		set mypath to get file of active document of window 1
	end tell
	tell application "Finder"
		set posix_parent_dir to quoted form of POSIX path of (container of  
mypath as text)
		set posix_filename to quoted form of POSIX path of (mypath as text)
	end tell
	set cmd to "cd " & posix_parent_dir & "; latexmk --pvc --pdf " &  
	tell application "Terminal"
		set numterms to count windows
		if numterms > 0 then
			do script cmd in window 1
			do script cmd
		end if
	end tell
end if

More information about the MacOSX-TeX mailing list