[TxMt] LaTeX Bundle question

Geoff Vallis gkv at Princeton.EDU
Thu Feb 7 13:38:28 UTC 2008


Brad,

On Feb 6, 2008, at 9:47 PM, Brad Miller wrote:
> How do you tell a running version of xdvi to change its position/ 
> page from the shell?  If it can be done from the shell I'll look at  
> adding it.

The command to update xdvi is the same whether or not xdvi is already  
running. It is just:
  xdvi -sourceposition Lineno[:Column]Filename Masterfile[.dvi]
with, I hope, obvious notation, and of course this command can be  
embedded in a shell script. The Column parameter is optional. If xdvi  
is already running, showing masterfile, this call will just bring the  
xdvi window to the front and switch positions accordingly. If not, the  
command will open an xdvi window with Masterfile showing.

There are a million other options that you can see with a 'man xdvi'  
or 'xdvi --help'.  Generally, you first open an xdvi window with the  
size and options you want, and then the syncing just uses that open  
window.


> If it is a short shell script then it really would be very easy for  
> you to add your own bundle command.
>
> type ctrl-opt-cmd-b to bring up the bundle editor
> You should see a bundle with your own name, or you can add the  
> command to the latex bundle.
> click add new command in the lower left corner.
> Give your new command a name:  dvisync
> Save: Nothing
> Command(s)  Whatever shell script tells xdvi to update itself.  The  
> two variables you may want are:
> TM_LINE_NUMBER  and TM_FILEPATH  or TM_FILENAME
> Input:  None
> Output: discard
> key equivalent:  your choice
> Scope Selector:  text.tex.latex
>
> Brad
>
>
> Close the bundle editor, and you've made your first TextMate command.


Thanks, I'll give this a shot, whether or not you decide to support  
xdvi. To be absolutely clear, can you say what the Textmate variables  
are that correspond to:

linenumber of the file being edited where the cursor is at;
column of the cursor of the file being edited (if available;
filename of the file being edited;
masterfilename (which will be the name of the dvi file).


Regards
Geoff






More information about the textmate mailing list