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

Charilaos Skiadas skiadas at hanover.edu
Thu Dec 21 23:51:51 UTC 2006


On Dec 21, 2006, at 7:52 PM, Holger Frauenrath wrote:

> Hi Haris and everybody else,
>
> first of all thanks for your great work, and for your long answer.  
> I was able to figure out some things, and I stumbled over new  
> problems (for me). Before I start with some of my issues, let me  
> ask you whether this list is supposed to be the place for such "how- 
> to" questions; whether there is a better place for these questions;  
> or whether they should rather be discussed off-list.

Yes, this is a good place for them. Then they get archived and google  
can find them.

> And one more thing: I feel that I have to excuse myself again for  
> some questions that may be found in the documentation (online or in  
> Textmate). I spent most of my day today reading the documentation.  
> The problem (for me) seems to be that it is currently sometimes  
> hard to find the relevant piece of information one needs. So,  
> please, just point me to the documentation if my question is  
> answered there.
>
>>> 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).
>
> So, for example, let's say I have a custom command for including  
> scheme and figures, and I would like to have that command colored  
> in a specific way; what would be the best and most forward- 
> compatible way of doing it? If I understand things correctly, then,  
> if I change the LaTeX language file directly, future updates to the  
> bundle are going to be ignored (overwritten by my changed file). I  
> guess, it would be better to put those personal additions into an  
> extra file. But what is the correct/optimal way to call/include it  
> in the LaTeX language file?

I don't know what you mean about including scheme. Do you mean scheme  
code via the lstlistings environment or something like that? Then we  
should add those to the official bundle. As for figure environments,  
they should be already targeted by the scope mechanism, so you should  
be able to assign them colors as is, I think. Unless I misunderstand  
what you want to do. Both of these two you should also be able to do  
by creating your own bundle and including the latex grammar. However  
there is one tricky bit: The rules that match environments match the  
spaces before the \begin, so that they match from the beginning of  
the line (for coloring the background more nicely). So if your rule  
matches only from the \begin part, it does not matter whether it  
appears first or not, since the built-in rule matches EARLIER. So you  
would need to be matching those spaces as well. (I've been bitten by  
this myself ;) ).

>> 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.
>
> [snip]
>
>> If the current TM_LATEX_ERRLVL settings are not sufficient, let us  
>> know.
>
> Thanks for the hint. I played around with the values. In my eyes it  
> would be useful to have one additional option where the console  
> window would not open at all *except* for when there is an error,  
> in which case it should open and remain open. The reason is that I  
> would like it to be closed after typesetting and, as a matter of  
> fact, the typesetting of a short file on the MacBook only takes a  
> fraction of a second anyways, so that the brief opening and closing  
> of the console window is not useful (in this particular case).

Well it sort of opens because this is the default output of the  
command, an HTML window. So the window opens before the command even  
starts running. Theoretically it would be possible to not open it  
until later, but it would make the code of that command even more  
complicated. It's already a pretty long shell script, that I try not  
to mess with lest my inferior shell skills brake it. If someone else  
wants to take a stab at it, then we can talk about it. But given that  
it works, and it really a minor nuisance, I'm loath to mess with it.

>> 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.
>
> Well, this just makes me hope for a nice, PDFKit based PDF viewer  
> which nicely integrates with Textmate (or would be integrated into  
> it) ... Textmates power and TexShop's syncing would be my dream  
> LaTeX app. Oh, well ... back in the real world, I have two  
> questions concerning the PDF Preview:
>
> PDFView seems to crash on me fairly often when it updates an  
> already open PDF file; some PDF files it will not open at all  
> anymore. Is there anything I can do to help improve PDFView? I  
> mean, not programming (I can't, sorry!). But, e.g., send console  
> output or something like that.

PDFView is an application completely independent from TM. It is  
developed by Andrea Bergia, and its website is here: http:// 
pdfview.sourceforge.net/
You can find the developer's email over there and contact them about it.

> Is there a way to make Textmate interact with TeXShop nicely? I  
> have set TeXShop as my previewer, and checked "Configure for  
> external viewer" but I seem to miss some settings to at least make  
> it sync using pdfsync. Sorry if that is off-topic.

No, TeXShop does not support pdfsyncing when it is the external  
viewer, as far as I know.

> Then, I have a question concerning international keyboards. I  
> currently have a Swiss keyboard (which drives me crazy anyways ...)  
> which is I think the reason for many keyboard shortcuts not  
> working. Is there a solution to this?

Yes, change keyboards ;)
Seriously, change any keyboard shortcuts that are not there to  
whatever you want. And yes, change keyboards. Allan has, and he is a  
Dane.

> And, finally, I have a probably stupid question: I would like to  
> change the menu structure (the commands) in the LaTeX bundle menu.  
> How can I do that? To be more specific, I am sure (well ...) that I  
> had done it before, and it used to work by simply dragging commands  
> from the list in the bundle editor into the menu structure window  
> of the LaTeX bundle. But it does not work (anymore). I can shuffle  
> around commands, and I can move them to "excluded items", but I  
> cannot add a new one.

In the bundle editor, select the LaTeX bundle, and you should see the  
menu structure on the right. Then you should be able to rearrange  
those. If you want to add another command, it must first be moved  
into the LaTeX bundle.

> Thanks again
> Holger
>
> __
> Eidgenössische Technische Hochschule Zürich (ETH Zürich)
> Department of Materials
> Wolfgang-Pauli-Str. 10, HCI H515
> CH-8093 Zürich
> Switzerland
>
> Phone: (+41) 1 633 6474
> Fax:   (+41) 1 633 1390
> Email: frauenrath at mat.ethz.ch
> Web:   http://www.polychem.mat.ethz.ch/frauenrath/

Haris





More information about the textmate mailing list