On Feb 8, 2008, at 11:43 AM, Geoff Vallis wrote:
With help from Brad in setting the root file correctly, I finally got a working bundle for syncing with xdvi. It is very short, and I listed it below. It doesn't go through texMate.py. I do think that it would be nice eventually to incorporate xdvi syncing into texMate.py, but at least for now this does the trick. Note that syncing requires that latex be called with the option '-src' so that source specials are included.
Relatedly, would be be possible to create a command 'Typeset (DVI)' that is analogous to 'Typeset and View (PDF)', that calls the latex (dvi) engine (but not dvips), that goes through texMate.py, and that one can call with a keyboard shortcut without either changing one's latex preferences and without adding a special TS-program line at the top of the file?
I've put xdvi support on my todo list for a future texMate.py release. I think I would prefer to make texMate smart enough that if xdvi is the viewer the dvips step is skipped. That would keep all the other options and preferences intact without creating another shortcut.
My one concern about this path going forward is that latex itself seems more and more insistent on producing pdf output. I tried a couple of old documents yesterday and even using the -output- format=dvi option latex still created a pdf file for me.
Brad
Thanks to all for their comments.
Geoff
divsync bundle:
TM_LATEX_MASTER=`${TM_RUBY:-ruby} <<"RUBY" require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" require "#{ENV['TM_SUPPORT_PATH']}/lib/LaTeXUtils.rb"
master = LaTeX.master(ENV['TM_LATEX_MASTER'] || ENV['TM_FILEPATH']) puts master RUBY`
DVIFILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
/pathto/dvisync.sh $TM_LINE_NUMBER $TM_FILENAME ${DVIFILE%.tex}.dvi
dvisync.sh: (shell script)
#!/bin/tcsh /usr/texbin/xdvi -sourceposition $1$2 $3
On Feb 7, 2008, at 9:52 PM, Charilaos Skiadas wrote:
Geoff are you by any chance setting the TM_LATEX_MASTER variable under TextMate -> Preferences -> Advanced? Then TM will always use that. But perhaps I've missed some part of this conversation.
I don't use xdvi for the very simple reason that by this point in time I don't feel the need to look at the output, simply looking at the code tells me all I need to know about how the output is going to be like, for the most part. And usually I don't have X11 running.
I'm a bit confused though. Do you still go through texMate.py, calling the existing compile command, or do you use your own command (command \equiv bundle item)? If it's the latter, then I don't see how the %!TEX directive will work, unless you do something special in your command. TextMate by itself does not do anything with the file, it just calls your command directly. In texMate,py, we have a lot of code whose job is exactly to locate the root file, if any, and use that, and that's what the built in compilation command uses.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate