Here's a script I hacked together last night.
If you're writing something with lots of complicated diagrams (like my
thesis, to pick an example at random) then you often have to go through
several compile-view-edit cycles before any particular diagram looks right.
This involves a lot of tedious waiting. The obvious way to speed it up is to
try and reduce the time between making an edit and seeing the results.
Hence this script. The idea is that you can 'watch' a LaTeX document, so
that whenever you save a change the display is updated as quickly as
possible to reflect the change.
The script is currently somewhat inflexible in its assumptions. It compiles
.tex -> .dvi -> ps, and uses gv as the PostScript viewer. If other people
are interested, I can certainly make it more configurable. That's why I'm
posting it here.
The reason for the aparently-perverse choice of gv as the viewer is that
ps2pdf is really, really slow, so if you want a fast cycle – and you're
using PostScript specials – you need to view the DVI or PS directly. I don't
know a DVI previewer that works with the PostScript specials I use, so that
leaves PS. I don't know of anything else for the mac that can display PS as
quickly as gv (I'd love to be enlightened here), and gv is very pleasant to
use once you get used to its idiosyncratic interface.
Anyway, that means you'll need to have X11.app and gv installed for it to
work. As I say, this can potentially be changed, but that's the current
situation. You also need to have gv in your $PATH.
Apart from avoiding PS->PDF conversion, the main trick I use to speed up the
update cycle is to build a custom TeX format file for the document. The
preamble – i.e. anything before \begin{document} – is compiled into a
special format when the file is watched. Thereafter, when the file is
updated, the preamble is merely inspected to see whether it has changed. If
it hasn't, the previously-generated format is used. Assuming you don't
change the preamble very often, this is a big win if you load a lot of large
packages. It halves the compile time of the document I'm currently working
on.
Attached are two files:
Watch document.tmcommand
A TextMate command that invokes the watcher. Copy this into your favourite
bundle. (If you try to watch a file that's already being watched, you're
given the option to stop watching it. Alternatively you can just close gv,
and it will stop watching. Note that quitting TextMate will *not* stop the
watcher.)
latex_watch.pl
A Perl script that does the real work. This should be placed in the
directory Support/bin inside the same bundle that you copied the command
into. (You probably need to create that directory.)
If something doesn't work, you _should_ get a nice error dialog telling you
what went wrong.
I'd really appreciate any feedback. I think that, with some more
flexibility, something like this could be useful to a lot of people.
Robin
I have an NFS share from my linux server and mount this on my Mac.
This NFS share is an svn working copy and its repo is local to the
same server. So the svn url is file:///path_to_repo/trunk.
If I try to use the subversion bundle in TextMate, it tries to use
direct file access to the repo instead of svn+ssh access. Is there a
way I can let TextMate know to use svn+ssh for this working copy?
thanks, ke han
Hi there
Am loving GTDAlt - I've tried 'em all and this is the one for me it seems.
I notice that in the latest build of TM, that when I attempt to set a
date for an action, an error is generated:
/tmp/temp_textmate.Ie4gRD:3:in `require': No such file to load --
/Library/Application Support/TextMate/Support/lib/plist (LoadError)
from /tmp/temp_textmate.Ie4gRD:3
Any clues on this would be appreciated.
Richard Sandilands
Recently, every time I launch Textmate, my system plays an alert
sound. I checked the console log and it's displaying this:
2007-03-29 18:51:50.872 TextMate[284] error reading file
/Library/Application Support/TextMate/Themes/Mac Classic.tmTheme
2007-03-29 18:51:50.980 TextMate[284] loadPlugIn: Dialog plug-in with
same bundle identifier (com.macromates.dialog_plug-in) already loaded
What do I need to do to fix this?
Thanks!
Does anyone use http://www.stclairsoft.com/DefaultFolderX/? It doesn't work
in TextMate's open dialog, but seems to work in every other. That's very...
very... very sad, and very, very painful. Anyone know why that might be? Any
idea how I might get it to work? The only thing I notice is that TextMate
has a 'Show hidden files' option; so wonder if its using a custom dialog
instead of the standard one.
Thanks in advance.
-S
I am unable to use the File/New from Template/Python/* menu item, or to
create a new file in an open project, by any of the available means
(application File menu, control-click in project drawer, use gear icon
menu). I gather, from following several different Google searches, that my
problem(s) has/have something to do with the search path that Textmate is
using to look for the template files, but I can find no information
regarding what I have to change or how I have to change it to make the
correct path(s) available to TM.
I know that the Python.tmbundle file lives in "/Library/Application
Support/TextMate/Bundles/", but when I add that directory to my PATH in
~/.bash_profile, that doesn't change anything.
I would be really, really grateful for a simple "do it this way" solution to
my problem.
Thanks.
Richard
Hi everyone,
I'm using a regular expression to find groups of text that I need to
replace. But instead of replacing the actual text that I have
selected, I want to simply append some text to the end of the line
that has been returned. For example, if I search in the project,
retrieving ten different lines of code, how to do I insert a specific
string of text (e.g. "Put this text at the end of the line") at the
end of each of those lines?
Is there a way to do this?
Thanks in advance!
Everyone/Anyone,
I'm new to Textmate (and just about everything else), and I just
finished reading the Textmate book (some sections got a thorough once-
twice-thrice-over). Very good book, now I'm hooked on Textmate.
I'm just an amateur web developer looking to increase my skill and
knowledge. Textmate has been a great companion as It allows me to get
out of Dreamweaver and into the code, but I find that I have lost
some of the "project management" features of Dreamweaver. ie, being
able to transparently upload completed development files from within
the application. (Sure I can still get it done with Transmit, but it
is clunky.) I searched the textmate discussions and wiki and came
away with the conclusion that SVN is the answer. Problem is I know
nothing about SVN... or where to start.
So, my question is... "What is SVN, can I really use it to manage a
production website, and what is the best place, resource, book to get
information on how to install, configure, and use it?" Sounds dumb
right. Well we all have to start somewhere.
(I googled it and found more information than I can shake-a-stick
at. So I thought that I would ask a smaller community that may
better understand my situation and give a little more intelligent mac-
oriented feedback.)
Thanks,
Ethan
So, my copy of JEG2's TextMate book has arrived down under, and I'm
really enjoying getting a better understanding of TextMate.
Being an avid AppleScripter, this was my first attempt at a bundle
command--to look up a selection in a FileMaker database:
osascript <<-ENDSCRIPT
set title to "${TM_SELECTED_TEXT}"
if title ≠ "" then
tell application "FileMaker Pro Advanced"
if not (exists window "HachetteTitles") then open alias
"Path:To:My:Database.fp7"
set cell "_Search" of layout "Titles" to title
do script "Search For Title"
set href to cell "_Search" of layout "Titles"
set img to cell "_thumb" of layout "Titles"
end tell
if href ≠ "" then set title to img & href
end if
return title
ENDSCRIPT
I know this script method works fine outside of TextMate, but no
matter what I do I get errors running it inside TextMate:
31:32: syntax error: Expected “then”, etc. but found unknown token.
(-2741)
I'd certainly appreciate any help diagnosing this one.
--
Tim Mansour <tim(a)neologica.com.au>
Is there any way to copy source out of TextMate such that the
formatting stays intact?
I.e. I want to be able to paste code into Pages, preserving font,
format and color.
b.bum