[TxMt] LaTeX Bundle question
Geoff Vallis
gkv at Princeton.EDU
Thu Feb 7 21:04:05 UTC 2008
Brad
This is working now for files for files that do not have a master or
root file. But if there is a master file, the name of the dvi file is
not the same as the name of the file being edited, but is the name of
the master file, or the tex root. I don't see the name of this in the
Show TM_* variables list. What is it, including the full path?
Geoff
On Feb 7, 2008, at 2:45 PM, Brad Miller wrote:
>
> On Feb 7, 2008, at 7:38 AM, Geoff Vallis wrote:
>
>> 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.
>
> That is very easy. I've just never found X to be very pleasant on
> the mac so I've mostly forgotten everything I used to know.
>
>>
>>
>> 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).
>>
>
> Geoff,
>
> You can see all of the environment variables exported by TM by
> running the command Bundles --> Bundle Development --> Show TM_*
> variables.
>
> linenumber is TM_LINE_NUMBER
> columnnumber is TM_COLUMN_NUMBER
> filename of the file being edited:
> TM_FILENAME -- is the filename without any path information
> TM_FILEPATH -- is the filename with full path
> ${TM_FILENAME%.tex}.dvi will give you the name of the dvi file
> without path
> ${TM_FILEPATH%.tex}.dvi will give you the name of the dvi file with
> the path
>
> Brad
>
>>
>> Regards
>> Geoff
>>
>>
>>
>>
>> ______________________________________________________________________
>> For new threads USE THIS: textmate at lists.macromates.com
>> (threading gets destroyed and the universe will collapse if you
>> don't)
>> http://lists.macromates.com/mailman/listinfo/textmate
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
More information about the textmate
mailing list