[TxMt] Newbie Questions Concerning LaTeX bundle, PDFView etc.

Charilaos Skiadas skiadas at hanover.edu
Wed Dec 20 18:13:50 UTC 2006


On Dec 20, 2006, at 6:47 PM, Holger Frauenrath wrote:

> Hello everybody,
>
> So, here we go.

First of all, general references:
TextMate manual: http://macromates.com/textmate/manual/
Lots of TM and LaTeX in TM goodies on my page: http:// 
skiadas.dcostanet.net/afterthought/list-of-my-textmate-pages/
LaTeX bundle help file in TextMate: Bundles -> LaTeX -> Help

> 1. What is (strategically) the best way to include my own  
> additions, e.g., to the syntax coloring? The first thing I tried  
> was to change the original LaTeX language file itself, but I soon  
> understood that was not a good idea. The second thing I tried was  
> create my own LaTeX addition file (which would claimall .tex files  
> and at the end include the original LaTeX language file) but that  
> also seemed to break certain things.

Your second solution is as far as I can tell the best way to do it.  
However, the LaTeX bundle mechanism is pretty complex, with 3  
different syntax files including each other, to keep separate the  
parts of the syntax that are latex only, tex in general, or math.  
There are also separate grammars for the beamer and now memoir  
classes, both including the latex grammar.

So depending on what changes exactly you wanted to make, it might be  
more complicated than simply including the grammar. I can answer more  
specific questions if I know exactly what you want to do. (And if it  
is for the greater good, I can just add them to the regular LaTeX  
syntax).

> In relation to this first question, I think I need to understand  
> the following related questions:
> 2. Do I understand correctly that the "LaTeX bundle" is somehow  
> officially maintained in the sense that certain improvements and  
> additions are included in the official release from time to time?

Yes. To be more specific, there is a subversion repository containing  
all the 100 something bundles and all other supporting material. It  
can be found at: http://macromates.com/svn/Bundles/trunk. Whenever a  
new version of TextMate is about to come out, Allan takes a snapshot  
of a number of bundles from there, and 'bundles" them with the  
executable. This does include the LaTeX bundle. The bundle itself  
admits updates a lot more often (in fact I'm about to make some  
changes to its completion mechanism in the next day or two ;) ).

> 3. Is there a "version system" for the bundles? I mean, is there a  
> way to tell that I have the latest version of the bundle (or which  
> one I have installed)?

Look at: http://macromates.com/textmate/manual/ 
bundles#getting_more_bundles

Either you have the one that came with TM, which is as new as TM is,  
or you have the one through svn, in which case you want to svn up to  
get the newest version.

> 4. Is a new version of a bundle automatically installed with the  
> Textmate updates?

I think this is answered above.

> 5. What happens to my own additions when a bundle is upgraded? As  
> far as I understand, my additions are stored as "differences" to  
> the original file. But what exactly happens, for example, when I  
> added/changed a behavior that is later added/modified/deleted in an  
> updated bundle?

Your changes take precedence. Now, we need to be careful when we say  
"differences". For instance if you change the key equivalent for a  
command, then TM keeps this information later on. If you change the  
text of a command, it keeps the ENTIRE NEW TEXT, as the command text,  
and not the fact that you, say, added a line after line 4. So any  
changes to the original command text in the repository will be hidden  
from you from now on.
But changes to scope selector, command text, key equivalent, input,  
output, are kept separate from each other: You can change one of them  
and still get updates on the others.

All these are kept in .tmDelta files, stored in ~/Library/Application  
Support/TextMate/Bundles. You can remove such a file to restore the  
command to its default status.

> Furthermore, I have some questions concerning the typesetting  
> process. Let me start with two observations. The first time I  
> installed Textmate, the TeX console window would pop up when I hit  
> "Typeset", and the results would appear in relatively large chunks  
> as HTML output which seemed rather "slow" compared to TeXShop. The  
> window stayed on the screen when the typesetting was finished. The  
> second time I installed Textmate a couple of months later, (on my  
> MacBook Pro, only in case this matters), the large console window  
> would pop up in the middle of the screen briefly during  
> typesetting, and immediately disappear again when typesetting was  
> finished (which is relatively fast on a Macbook Pro!), not leaving  
> me any chance to at least adjust its size and position.
>
> 6. Can anybody give me a clue why there is this difference in  
> behaviors? Has the bundle changed in this respect? Does it matter  
> which type of processor it is run on?

The type of processor should not matter at all. The bundle however  
changes very often. What the window does has to do with the value of  
the TM_LATEX_ERRLVL variable. Look at the LaTeX bundle help for details.

> 7. Can one bring up the TeX console window without typesetting  
> (e.g. in order to change its size/position)?

No, but you can make it stay open.

> 8. Is there a way to switch its behavior between one of the  
> following options: Appear upon typesetting (i) always; (ii) upon  
> error; (iii) never; (iv) and close when typesetting is finished?
> 9. In case there is no way to switch the behavior, would it not be  
> a desirable feature? Would it be possible to include in the LaTeX  
> bundle by default?

If the current TM_LATEX_ERRLVL settings are not sufficient, let us know.

> 10. Are there any advantages to display the results formatted as  
> HTML? Would it not be more appropriate (faster) to make it plain text?

Yes, errors become links that you can click to take you to the  
corresponding spot. You can also format how things look a bit more.

> And, finally, I have a few questions concerning the interaction  
> with PDFView. Let me start with a few comments again. First of all,  
> I find PDFView a really nice tool! Thanks to the developers! It  
> just feels right. Simple, with a clean interface. The only  
> "complaint" that I have (which is not really one) is that having  
> two applications interact still feels more clunky than TeXShop's  
> integrated solution ... I wonder whether there is any chance to see  
> a PDF Previewer with some basic LaTeX specific functionality  
> (pdfsync, click-to-magnify etc.) included in Textmate?
> In any case ...
>
> 11. How am I supposed to view the current selection/cursor position  
> in Textmate in PDFView? Sometimes (and really not always),  
> selecting a word and hitting Ctrl-Opt-Cmd-O seems to work. Is there  
> a better way? For example, one without previously selecting  
> something, or a simple Cmd-click?

It should work. you actually shouldn't have to select anything, just  
press ctrl-opt-cmd-o (Of course this assumes you are using the  
PDFView variant of that command. Soon we'll modify the command so  
that it uses TM_LATEX_VIEWER to use the appropriate application  
instead of using TeXniscope by default.

> 12. Why does it sometimes fail to take me to the correct paragraph  
> (showing the page PDFView had previously shown)? Is this a  
> shortcoming of pdfsync?

Yes, pdfsync only marks certain locations. Equations, sectioning  
commands etc. Not sure about paragraphs. It definitely is not as  
exact as TeXShop's, which uses PDFKit to do its magic.

> Holger
>

Haris





More information about the textmate mailing list