I just discovered TextMate I am liking it a lot. I will mainly be using it for LaTeX and I have it working nicely with TeXShop as my previewer. With that said, I am writing a large textbook in which I have created new definitions for \subsection and \subsubsection, which are called \Subsection and \Subsubsection, respectively. Unfortunately, the function pop-up menu does not show these as they begin with a capital "s" rather than a lower-case "s". I have looked in the symbol list for the LaTeX bundle and I see:
/* preferences */ { showInSymbolList = 1; symbolTransformation = ' s/(?<=\|sub)sub/ /g; # replace all leading "sub" with an em-space s/^\( *)section(?:[[^]]*])?{(.+)}/$1$2/; # then strip all but em-space + name '; }
I must confess that I don't know enough of what appears to be regular expression syntax to make the bundle recognize my commands. Can someone tell me what I need to change in the above definition to get the behavior I desire?
Thank you,
-- Gary L. Gray
On Jan 22, 2006, at 2:37 PM, Gary L. Gray wrote:
s/(?<=\\|sub)sub/ /g; # replace all leading "sub"
with an em-space
Try to replace the s in the first sub with (s|S) This tells the regexp engine to match either an s or an S at that point. Have a look at this document for more on regular expressions used in textmate: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt
Then you also need to change the latex syntax to recognize your (sub) sections as having scope meta.section.latex In particular, in the LaTeX language file, you will find the line:
begin = '((\(?:(?:sub)*section|chapter|paragraph|part))(*?)(?:([)[^ []*?(]))??({))';
near the top.If you change the first "s" there to (s|S) instead, that might do it (haven't tested it). This will also be matching stuff like \SubSubsection, I hope that's alright.
Haris
On Jan 22, 2006, at 3:54 PM, Charilaos Skiadas wrote:
On Jan 22, 2006, at 2:37 PM, Gary L. Gray wrote:
s/(?<=\\|sub)sub/ /g; # replace all leading "sub"
with an em-space
Try to replace the s in the first sub with (s|S) This tells the regexp engine to match either an s or an S at that point. Have a look at this document for more on regular expressions used in textmate: http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt
Thank you. Though this doesn't seem to matter (see below).
Then you also need to change the latex syntax to recognize your (sub)sections as having scope meta.section.latex
What does that mean? What does that do for me? Again, see below.
In particular, in the LaTeX language file, you will find the line:
begin = '((\(?:(?:sub)*section|chapter|paragraph|part))(*?)(?:([) [^[]*?(]))??({))';
near the top.If you change the first "s" there to (s|S) instead, that might do it (haven't tested it).
Interestingly, I only made the second change and it appeared to recognize my sectioning commands without making the first. That is, I made the change to the LaTeX language file as:
begin = '((\(?:(?:(s|S)ub)*section ...
and the function pop-up now shows (I hope attachments are ok):
which is, I suppose, what I would expect. It doesn't seem to change anything if I include the change in the symbol list.
In fact, I just did a test and made the change only in the symbol list and then the function pop-up does not find my sectioning commands that start with an upper-case "s". See:
This will also be matching stuff like \SubSubsection, I hope that's alright.
That is no problem, though I must admit to being a bit confused at this point. :-)
-- Gary
Let me try to make some points that might clarify things:
1. Changes in the preferences and language files might not take effect immediately. for the language file, you should press the "test" button after the changes you make. In either case, closing the window helps register the change.
2. The language file determines what parts of the text match to what scope. In your case, this needs to change, because otherwise your commands \Subsection and \Subsubsection are not being understood as meta.section.latex. You could optionally catch them as some other scope of your own, and do other stuff to them, but my understanding is that you want them to behave like the uncapitalized commands.
3. The preferences file (called "symbol list" here, but that is not important) tells TM the following: a) take the things from the text that have scope meta.section.latex (This is what the scope selector being "text.latex meta.section.latex" does), and use those for the symbol list (that's what the "showInSymbolList=1" does. b) Before showing them, perform a transformation to them. In this case, the transformation desired has the effect of replacing the subsection/section etc parts by appropriately lengthed spaces, so that it shows nicely nested. For instance, the following text:
\section{1st section} \subsection{1st subsection} \subsection{2nd subsection} \subsubsection{1st subsubsection} \section{2nd section}
will show up in the symbols list as: 1st section 1st subsection 2nd subsection 1st subsubsection 2nd section
Notice the extra spaces. Due to some error in our part, the line with the subsubsection will actually have one of the sub's replaced by spaces, but in general this will work as described above.
This is all accomplished by the "symbolTransformation" lines.
So the change in the language file will in fact have the desired effect of adding these \Subsection lines to the symbol popup, but if you want them to look nice as above, you need to make the analogous change in the "symbol list" preferences file.
I hope this helps. Let me know if you are still having problems with it.
Haris
On Jan 22, 2006, at 5:31 PM, Charilaos Skiadas wrote:
Let me try to make some points that might clarify things:
- Changes in the preferences and language files might not take
effect immediately. for the language file, you should press the "test" button after the changes you make. In either case, closing the window helps register the change.
- The language file determines what parts of the text match to
what scope. In your case, this needs to change, because otherwise your commands \Subsection and \Subsubsection are not being understood as meta.section.latex. You could optionally catch them as some other scope of your own, and do other stuff to them, but my understanding is that you want them to behave like the uncapitalized commands.
- The preferences file (called "symbol list" here, but that is not
important) tells TM the following: a) take the things from the text that have scope meta.section.latex (This is what the scope selector being "text.latex meta.section.latex" does), and use those for the symbol list (that's what the "showInSymbolList=1" does. b) Before showing them, perform a transformation to them. In this case, the transformation desired has the effect of replacing the subsection/section etc parts by appropriately lengthed spaces, so that it shows nicely nested. For instance, the following text:
\section{1st section} \subsection{1st subsection} \subsection{2nd subsection} \subsubsection{1st subsubsection} \section{2nd section}
will show up in the symbols list as: 1st section 1st subsection 2nd subsection 1st subsubsection 2nd section
Notice the extra spaces. Due to some error in our part, the line with the subsubsection will actually have one of the sub's replaced by spaces, but in general this will work as described above.
This is all accomplished by the "symbolTransformation" lines.
So the change in the language file will in fact have the desired effect of adding these \Subsection lines to the symbol popup, but if you want them to look nice as above, you need to make the analogous change in the "symbol list" preferences file.
I hope this helps. Let me know if you are still having problems with it.
This helps *a lot*. Thank you!
With that said, as you can see from the screen shots included in my previous message, the indentation you describe does not seem to be happening. Something else must be missing. Chapters, sections, subsections, subsubsections, and paragraphs are all included, but they are all shown the same way. In fact, I am writing a paper that has unnumbered section headings and the function pop-up is recognizing them but it is not indenting anything:
Is this the intended behavior for starred section headings?
-- Gary
On 23/1/2006, at 1:26, Gary L. Gray wrote:
[...] With that said, as you can see from the screen shots included in my previous message, the indentation you describe does not seem to be happening. Something else must be missing. Chapters, sections, subsections, subsubsections, and paragraphs are all included, but they are all shown the same way. In fact, I am writing a paper that has unnumbered section headings and the function pop-up is recognizing them but it is not indenting anything:
<Picture 1.png>
Is this the intended behavior for starred section headings?
That's an oversight. I've changed the preferences to:
/* preferences */ { showInSymbolList = 1; symbolTransformation = ' s/(?<=\|sub)sub/ /g; # replace all leading "sub" with an em-space s/^\( *)section*?(?:[[^]]*])?{(.+)}/$1$2/; # then strip all but em-space + name '; }
On Jan 22, 2006, at 9:21 PM, Allan Odgaard wrote:
On 23/1/2006, at 1:26, Gary L. Gray wrote:
[...] With that said, as you can see from the screen shots included in my previous message, the indentation you describe does not seem to be happening. Something else must be missing. Chapters, sections, subsections, subsubsections, and paragraphs are all included, but they are all shown the same way. In fact, I am writing a paper that has unnumbered section headings and the function pop-up is recognizing them but it is not indenting anything:
<Picture 1.png>
Is this the intended behavior for starred section headings?
That's an oversight. I've changed the preferences to:
/* preferences */ { showInSymbolList = 1; symbolTransformation = ' s/(?<=\|sub)sub/ /g; # replace all leading "sub" with an em-space s/^\( *)section*?(?:[[^]]*])?{(.+)}/$1$2/; # then strip all but em-space + name '; }
I inserted what you have above, except I changed the first s in the third so that it also recognizes sectioning commands that begin with an uppercase letter. I now have:
/* preferences */ { showInSymbolList = 1; symbolTransformation = ' (s|S)/(?<=\|sub)sub/ /g; # replace all leading "sub" with an em-space s/^\( *)section*?(?:[[^]]*])?{(.+)}/$1$2/; # then strip all but em-space + name '; }
and I am still not seeing the indenting as you can see in the following screen shots:
-- Gary
On 23/1/2006, at 6:18, Gary L. Gray wrote:
I inserted what you have above, except I changed the first s in the third so that it also recognizes sectioning commands that begin with an uppercase letter. I now have: [...]
That's the wrong s. The first one is to indicate a substitution command.
You can change the line in question to:
s/(?<=\|sub)sub/ /gi; # replace all leading "sub" with an em-space
The last i should make the substitution case insensitive.
For the records, the function list customization is documented here: http://macromates.com/textmate/manual/ navigation_overview#customizing_the_list (currently though it doesn't link to the list of options).
On Jan 23, 2006, at 6:42 AM, Allan Odgaard wrote:
On 23/1/2006, at 6:18, Gary L. Gray wrote:
I inserted what you have above, except I changed the first s in the third so that it also recognizes sectioning commands that begin with an uppercase letter. I now have: [...]
That's the wrong s. The first one is to indicate a substitution command.
You can change the line in question to:
s/(?<=\\|sub)sub/ /gi; # replace all leading
"sub" with an em-space
The last i should make the substitution case insensitive.
For the records, the function list customization is documented here: http://macromates.com/textmate/manual/ navigation_overview#customizing_the_list (currently though it doesn't link to the list of options).
That did it -- thank you.
Is there a way I can get it to recognize \paragraphs and indent them one level more than \subsubsections?
-- Gary
On Jan 23, 2006, at 9:19 AM, Gary L. Gray wrote:
That did it -- thank you.
Is there a way I can get it to recognize \paragraphs and indent them one level more than \subsubsections?
Sure there is! Just add the line: s/^\paragraph{(.+)}/ $1/g;
right before the s/(?<=\|sub)sub/ /g; line. Note, I would suggest copying and pasting the above line, because the spaces from / to $1 are not regular spaces, they are em-spaces, special characters.
In general, may I make one suggestion. You will find that you will be able to use TextMate's power a lot more if you get more comfortable with some of the regular expressions/sed stuff. In particular, TextMate's find dialog utilizes this, allowing you to do some very interesting and elaborate search and replace stuff. Browsing around the various commands in the various bundles can give you tons of examples, and you can always email the list or ask at the irc channel for more ideas. Btw, you might want to also take a look at the TmCodeBrowser plugin, if you haven't yet. It's pretty cool, and for many things more useful than the symbol list.
-- Gary
Haris
On Jan 23, 2006, at 4:20 PM, Charilaos Skiadas wrote:
On Jan 23, 2006, at 9:19 AM, Gary L. Gray wrote:
That did it -- thank you.
Is there a way I can get it to recognize \paragraphs and indent them one level more than \subsubsections?
Sure there is! Just add the line: s/^\paragraph{(.+)}/ $1/g;
right before the s/(?<=\|sub)sub/ /g; line. Note, I would suggest copying and pasting the above line, because the spaces from / to $1 are not regular spaces, they are em-spaces, special characters.
In general, may I make one suggestion. You will find that you will be able to use TextMate's power a lot more if you get more comfortable with some of the regular expressions/sed stuff. In particular, TextMate's find dialog utilizes this, allowing you to do some very interesting and elaborate search and replace stuff. Browsing around the various commands in the various bundles can give you tons of examples, and you can always email the list or ask at the irc channel for more ideas. Btw, you might want to also take a look at the TmCodeBrowser plugin, if you haven't yet. It's pretty cool, and for many things more useful than the symbol list.
Thank you. That did the trick.
Yes, I am trying to acquire the ability to customize TextMate, but it has been slow going. In fact, a colleague and I spent a couple of hours trying to get something to work in the LaTeX language file and we were never successful. I may post a follow-up question this evening.
Thank you again,
-- Gary
Hi,
I hope this helps. Let me know if you are still having problems with it.
I have a similar question:
TeXShop has an analog method to display the structure of the document, but there also lines beginning with "%:" are displayed. This is great to add some custom comments to the structure.
Is it possible to get this behavior in TextMate as well?
Thanks in advance, best Matthias
On Jan 25, 2006, at 12:20 PM, Matthias Damm wrote:
Hi,
I hope this helps. Let me know if you are still having problems with it.
I have a similar question:
TeXShop has an analog method to display the structure of the document, but there also lines beginning with "%:" are displayed. This is great to add some custom comments to the structure.
Is it possible to get this behavior in TextMate as well?
Yes, though the best way to accomplish this would be through TmCodeBrowser (http://www.cocoabits.com/TmCodeBrowser/) and ctags, so as not to disturb the bundle syntax. This is extremely easy to customize, effectively it allows you to pick any part of the text matching a regular expression, process it in sed style and then get the output to show up in the Code Browser's window. I don't know how familiar you are with regular expressions and/or ctags. I did not know the first thing about ctags before playing with TmCodeBrowser, but I found it relatively easy. Take a look at it and if you have problems we can talk about them.
Thanks in advance, best Matthias
-- Matthias Damm mad@macpla.net PGP key: http://macpla.net/MatthiasDamm.asc PGP fingerprint: CED3 6074 7F7D 3148 C6F3 DFF2 05FF 3A0B 0D12 4D41
Haris
Matthias, do you have any reference for this? Is this documented behavior? Is it special to TexShop, or general to LaTeX?
I'll try to work it into the syntax, since it doesn't break any other behavior. On Jan 25, 2006, at 12:20 PM, Matthias Damm wrote:
TeXShop has an analog method to display the structure of the document, but there also lines beginning with "%:" are displayed.
Haris
Am 25.01.2006 um 23:36 schrieb Charilaos Skiadas:
Matthias, do you have any reference for this? Is this documented behavior? Is it special to TexShop, or general to LaTeX?
I don't think it is general to LaTeX, and the only reference for TeXShop I found is in the version history (http://www.uoregon.edu/ ~koch/texshop/version.html): Tags: a source code line which begins with %: is interpreted as a tag and listed in the tag pulldown menu. Choosing a tag scrolls to the corresponding line in the source code.
But it is very helpful :-)
I'll try to work it into the syntax, since it doesn't break any other behavior.
Thanks!
I downloaded TMCodeBrowser, but I am neiter sure if I understand what it does, nor do I know exactly what I would have to change. In other words: I don't really have a clue what I have to do ...
I'l like to mention two other things:
- TextMate removes the "\section" etc. commands in the menu and indents the text, but this is not done for \part, \chapter. Is this the desired behavior? - In koma-script alternative forms of the document structure commands exist: \addpart, \addchap and \addsec (which generate unnumbered headings) and \minisec. Is it possible to add those as well?
And I think there is a bug in TextMate when you use the search in the Bundle editor.
Do the following to reproduce it: - Open the search panel in the bundle editor and search something. Works as it should. - Open the search panel again and search for any other term. Now still the first term is found. You have to close and re-open the Bundle editor to search for another term.
Thanks, Matthias
On Jan 25, 2006, at 5:37 PM, Matthias Damm wrote:
Am 25.01.2006 um 23:36 schrieb Charilaos Skiadas:
Matthias, do you have any reference for this? Is this documented behavior? Is it special to TexShop, or general to LaTeX?
I don't think it is general to LaTeX, and the only reference for TeXShop I found is in the version history (http://www.uoregon.edu/ ~koch/texshop/version.html): Tags: a source code line which begins with %: is interpreted as a tag and listed in the tag pulldown menu. Choosing a tag scrolls to the corresponding line in the source code.
But it is very helpful :-)
Well, it's there now! Hope it works as you expect it to. (You do update through subversion, right?)
I downloaded TMCodeBrowser, but I am neiter sure if I understand what it does, nor do I know exactly what I would have to change. In other words: I don't really have a clue what I have to do ...
In your home directory, TMCodeBrowser should have created a file titled ".ctags.tmcodebrowser". It is not visible in finder I think, but you can see it if you type "ls .c*" in the terminal. You would want to edit this file in textmate, so in the terminal you would want to run a command like "mate .ctags.tmcodebrowser". If the file is not there, then you would want to create it.
This file contains a section for latex, which looks like this:
--langdef=latex --langmap=latex:.tex --regex-latex=/\label{*([^} \t]+)[ \t]*}/\1/l,label/ --regex-latex=/^\(sub)*section{([^}]*)}/\2/s,section/
If it doesn't then add it. To get the comments, you would probably have to add a line like this: --regex-latex=/(%:.*)/\1/c,comment/ or if you want it to only match at the beginning of a line: --regex-latex=/^(%:.*)/\1/c,comment/
I'l like to mention two other things:
- TextMate removes the "\section" etc. commands in the menu and
indents the text, but this is not done for \part, \chapter. Is this the desired behavior?
No, just neglect on our part. I'll try to fix it.
- In koma-script alternative forms of the document structure
commands exist: \addpart, \addchap and \addsec (which generate unnumbered headings) and \minisec. Is it possible to add those as well?
I don't know anything about koma-script, but if it is not standard latex behavior I would rather we create a separate bundle for it, which could be done if anyone wants to do it. I can help, but probably wouldn't want to be in charge of creating it. We've done something like that for the beamer class. Is this something similar perhaps? You can have a look at the beamer class and create your a similar syntax for koma-script.
And I think there is a bug in TextMate when you use the search in the Bundle editor.
Do the following to reproduce it:
Allan is aware of the problem. Don't know if he has a solution yet.
Thanks, Matthias
-- Matthias Damm mad@macpla.net PGP key: http://macpla.net/MatthiasDamm.asc PGP fingerprint: CED3 6074 7F7D 3148 C6F3 DFF2 05FF 3A0B 0D12 4D41
Haris
Hi,
I don't think it is general to LaTeX, and the only reference for TeXShop I found is in the version history (http://www.uoregon.edu/ ~koch/texshop/version.html): Tags: a source code line which begins with %: is interpreted as a tag and listed in the tag pulldown menu. Choosing a tag scrolls to the corresponding line in the source code.
But it is very helpful :-)
Well, it's there now! Hope it works as you expect it to. (You do update through subversion, right?)
Not yet. But I have found the howto in the manual and will set it up tomorrow ...
Thanks for reacting so fast!
I downloaded TMCodeBrowser, but I am neiter sure if I understand what it does, nor do I know exactly what I would have to change. In other words: I don't really have a clue what I have to do ...
In your home directory, TMCodeBrowser should have created a file titled ".ctags.tmcodebrowser". It is not visible in finder I think, but you can see it if you type "ls .c*" in the terminal. You would want to edit this file in textmate, so in the terminal you would want to run a command like "mate .ctags.tmcodebrowser". If the file is not there, then you would want to create it.
This file contains a section for latex, which looks like this:
--langdef=latex --langmap=latex:.tex --regex-latex=/\label{*([^} \t]+)[ \t]*}/\1/l,label/ --regex-latex=/^\(sub)*section{([^}]*)}/\2/s,section/
Yes, I had done that already, but nothing seems to happen. I only see an empty "CodeBrowser" window in TextMate but I don't know what should appear there ...
- In koma-script alternative forms of the document structure
commands exist: \addpart, \addchap and \addsec (which generate unnumbered headings) and \minisec. Is it possible to add those as well?
I don't know anything about koma-script, but if it is not standard latex behavior I would rather we create a separate bundle for it, which could be done if anyone wants to do it. I can help, but probably wouldn't want to be in charge of creating it. We've done something like that for the beamer class. Is this something similar perhaps? You can have a look at the beamer class and create your a similar syntax for koma-script.
I am not sure if you can really compare beamer and koma here. Beamer has some syntax which is quite different from standard LaTeX. But koma is just a variant of LaTeX, it replaces the standard article, book etc. classes by scrartcl, scrbook etc. and gives you some more options. I don't think that koma support will hurt any standard LaTeX user.
But I will have a look at the LateX and Beamer bundles and try to understand what they are acually doing. Perhaps it is really a good idea to copy the standard bundle and add the koma-specific terms here and there.
Thanks for your patience with us TextMate newbies, best Matthias
On 26/1/2006, at 1:35, Matthias Damm wrote:
[...]
I am not sure if you can really compare beamer and koma here. Beamer has some syntax which is quite different from standard LaTeX. But koma is just a variant of LaTeX, it replaces the standard article, book etc. classes by scrartcl, scrbook etc. and gives you some more options. I don't think that koma support will hurt any standard LaTeX user.
Then we can probably add support for that in the standard LaTeX grammar, similar to how the C grammar markup miscellaneous Mac specific types (which are not in the C language/library per se).
Curious, what are the advantages of using koma? And do you have a link with more info?
Am 26.01.2006 um 02:03 schrieb Allan Odgaard:
On 26/1/2006, at 1:35, Matthias Damm wrote:
[...]
I am not sure if you can really compare beamer and koma here. Beamer has some syntax which is quite different from standard LaTeX. But koma is just a variant of LaTeX, it replaces the standard article, book etc. classes by scrartcl, scrbook etc. and gives you some more options. I don't think that koma support will hurt any standard LaTeX user.
Then we can probably add support for that in the standard LaTeX grammar, similar to how the C grammar markup miscellaneous Mac specific types (which are not in the C language/library per se).
Curious, what are the advantages of using koma? And do you have a link with more info?
www.komascript.de.
It should be installed on every standard system.
Koma is a very extensive addition to standard LaTeX which makes a lot of things much easier. It is fully backwards-compatible to the standard classes but offers a lot of additions like the additional commands for creating headings without numbering. Basically it does nothing that is not possible with the standard classes but makes a lot of things easier. (A lot of things could be mentioned, like a specialized letter class etc. pp.) It is very popular among European users since it is much better adapted to the A4 (instead of letter) paper formats. And it has a very good documentation. Try texdoc scrguien.pdf, that should open the english manual.
Best, Matthias
Am 26. Jan 2006 um 07:53 schrieb Matthias Damm:
www.komascript.de.
It should be installed on every standard system.
Koma is a very extensive addition to standard LaTeX which makes a lot of things much easier. It is fully backwards-compatible to the standard classes but offers a lot of additions like the additional commands for creating headings without numbering. Basically it does nothing that is not possible with the standard classes but makes a lot of things easier. (A lot of things could be mentioned, like a specialized letter class etc. pp.) It is very popular among European users since it is much better adapted to the A4 (instead of letter) paper formats. And it has a very good documentation. Try texdoc scrguien.pdf, that should open the english manual.
Best, Matthias
I second Matthias here, I use komascript regularly. Just want to point out that the manual is scrguide.pdf !
Christof
Am 26.01.2006 um 09:01 schrieb Christof Janssen:
And it has a very good documentation. Try texdoc scrguien.pdf, that should open the english manual.
Best, Matthias
I second Matthias here, I use komascript regularly. Just want to point out that the manual is scrguide.pdf !
The German manual is scrguide.pdf, the English one is scrguien.pdf ...
Best, Matthias
On Jan 26, 2006, at 2:01 AM, Christof Janssen wrote:
Am 26. Jan 2006 um 07:53 schrieb Matthias Damm:
I second Matthias here, I use komascript regularly. Just want to point out that the manual is scrguide.pdf !
Well, since we've got at least two people, and provided it does not break regular LaTeX syntax, if you and Matthias can create a list of the new commands that should be recognized (I'm assuming it does more things than just the sectioning stuff?), then I'll be happy to incorporate it into the current syntax. If along the way you also create a test file, so that I can add it to the already existing test file, that would be great.
Christof
Haris
Am 26.01.2006 um 23:34 schrieb Charilaos Skiadas:
Well, since we've got at least two people, and provided it does not break regular LaTeX syntax, if you and Matthias can create a list of the new commands that should be recognized (I'm assuming it does more things than just the sectioning stuff?), then I'll be happy to incorporate it into the current syntax. If along the way you also create a test file, so that I can add it to the already existing test file, that would be great.
I can do that, but please don't expect anything before next week or so, I am quite busy at the moment ...
Best, Matthias
Am 26. Jan 2006 um 23:34 schrieb Charilaos Skiadas:
On Jan 26, 2006, at 2:01 AM, Christof Janssen wrote:
Am 26. Jan 2006 um 07:53 schrieb Matthias Damm:
I second Matthias here, I use komascript regularly. Just want to point out that the manual is scrguide.pdf !
Well, since we've got at least two people, and provided it does not break regular LaTeX syntax, if you and Matthias can create a list of the new commands that should be recognized (I'm assuming it does more things than just the sectioning stuff?), then I'll be happy to incorporate it into the current syntax. If along the way you also create a test file, so that I can add it to the already existing test file, that would be great.
Many thanks for the offer - I will try to make a list of komascript related commands -- possibly within the next week.
Christof
Haris
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
On Jan 25, 2006, at 6:35 PM, Matthias Damm wrote:
Yes, I had done that already, but nothing seems to happen. I only see an empty "CodeBrowser" window in TextMate but I don't know what should appear there ...
Here's a screenshot from my machine: http://skiadas.dcostanet.net/uploads/TextMateScreenSnapz003.jpg Make sure both the latex file and the .ctags.tmcodebrowser are saved. Other than that, it should really work. Perhaps restart textmate.
- In koma-script alternative forms of the document structure
commands exist: \addpart, \addchap and \addsec (which generate unnumbered headings) and \minisec. Is it possible to add those as well?
But I will have a look at the LateX and Beamer bundles and try to understand what they are acually doing. Perhaps it is really a good idea to copy the standard bundle and add the koma-specific terms here and there.
No need to copy the entire latex syntax. You can just tell your syntax to import the latex syntax. In fact the latex syntax includes the tex syntax this way. The last pattern says: { include = 'source.tex'; },
You'll just have to do a similar thing with latex: { include = text.latex'; }, Then before that you add your own things. If the other maintainers don't object, and if there are enough users using koma, we could add those as well in the official syntax. I just don't want to add support for any little things that any bundle offers. Also, the idea of TextMate is that you customize things to your liking. For instance in this case, you can just add them to your local copy, and then share it with people. For extra sectioning commands, all you have to do is change the line:
begin = '((\(?:(?:sub)*section|chapter|paragraph|part))(*?)(?:(\ [)[^[]*?(]))??({))';
to begin = '((\(?:(?:sub)*section|chapter|paragraph|part|addpart| addchap|addsec|minisec))(*?)(?:([)[^[]*?(]))??({))';
that should do it. Let me know if you need any help with any of the other modifications needed.
Thanks for your patience with us TextMate newbies, best
My pleasure. Been there, still am in many ways.
Matthias
Haris
Hi,
I'd like to reactivate this old thread, since there seems to be a small problem with the symbol list in the LaTeX mode. The display of section titles does not work properly if the contain markup such als \emph{} or \textit{}.
\section{Heading with \empf{markup} in it}
will be displayed as
markup in it
Would it be possible to fix this problem?
Thanks in advance, best regards
Matthias
On Jun 7, 2006, at 8:14 AM, Matthias Damm wrote:
Hi,
I'd like to reactivate this old thread, since there seems to be a small problem with the symbol list in the LaTeX mode. The display of section titles does not work properly if the contain markup such als \emph{} or \textit{}.
\section{Heading with \empf{markup} in it}
will be displayed as
markup in it
Would it be possible to fix this problem?
Hm, I don't remember this old thread, at all. Anyway I just committed a fix for it, hopefully I didn't break anything else. The problem was that there are a series of transformations performed to create this list, and they are all performed in order. Two of those transformations were:
s/^\section*?(?:[[^]]*])?{(.+)}/ $1/; # \section
s/^.*{(.+)}/$1/; # take care of everything else
The point of the second transformation was to catch all other commands in case people name things in their own way. Problem was that the second command was a bit too strong. So after the section transformation transformed your section to: "Heading with \emph{markup} in it" the second substitution matched: "Heading with \emph{markup}" and replaced it with "markup", hence the resulting "markup in it". I changed the second command to: s/^\.*{(.+)}/$1/; # take care of everything else which will only match if the section text starts with . So in your case it will leave it as is, but if instead you had: "\emph{Heading with markup} in it" it should now show as "Heading with markup in it", which I think is an acceptable casualty. Hm, come to think of it, one could, if so desiring, have (almost) all commands removed by changing the command to: s/\.*{(.+)}/$1/; # take care of everything else
This will turn your original section title to "Heading with markup in it" as well. I guess that's a matter of taste.
Thanks in advance, best regards
Matthias
Haris
Am 07.06.2006 um 15:37 schrieb Charilaos Skiadas:
Hm, I don't remember this old thread, at all. Anyway I just committed a fix for it, hopefully I didn't break anything else. The problem was that there are a series of transformations performed to create this list, and they are all performed in order.
Thanks Haris, that was incredibly quick and upon a first glance successful: My heading now appears correctly. I'll let you know if I recognize any problem with your solution!
Thanks a lot again, best regards
Matthias