hi
I don't know who's responsible for the LaTeX bundle, so I'm writing about it here. There are some issues in which I think it should be improved.
In particular, there's a problem with using " characters. I don't think there are any " delimited strings in LaTeX, but instead " is used to denote umlauts in German texts (e.g. to get ä you type "a). So, whenever I use an umlaut the syntax highlighting doesn't work anymore until the next umlaut because TM marks the text in between as being in the invalid.string.latex scope. This IMHO serves no useful purpose at all but nevertheless breaks the syntax highlighting. Could anyone please fix this?
I'd also like to have a scope representing environments. So you could e.g. mark environments (something between and including \begin{} … \end{}) with a special background setting to distinguish them from the surrounding text.
If I have another idea I'll write about it here.
On Jun 5, 2005, at 3:28 PM, Frank Schönmann wrote:
hi
I don't know who's responsible for the LaTeX bundle, so I'm writing about it here. There are some issues in which I think it should be improved.
In particular, there's a problem with using " characters. I don't think there are any " delimited strings in LaTeX, but instead " is used to denote umlauts in German texts (e.g. to get ä you type "a). So, whenever I use an umlaut the syntax highlighting doesn't work anymore until the next umlaut because TM marks the text in between as being in the invalid.string.latex scope. This IMHO serves no useful purpose at all but nevertheless breaks the syntax highlighting. Could anyone please fix this?
I just committed a fix. It was highlighted as invalid.string.latex, so that people would know and change it, since this is not the LaTeX way of quoting. I removed that pattern, and the corresponding smart-typing pair, but I at least still get two quotes when typing one, so not sure what is going on there, but the highlight is gone.
I'd also like to have a scope representing environments. So you could e.g. mark environments (something between and including \begin{} … \end{}) with a special background setting to distinguish them from the surrounding text.
Do you mean individual scope for different environments, or just capture each begin-end block? The entire document is contained within a \begin{document} \end{document} block, so any choice there would change how the entire document looks like, and any other groups contained in it would not be distinguished this way. The other problem is that at the moment, as far as I can tell, we can't tell TM to look for arbitrary patterns within a pattern, and so if we want the inside of the environment to follow any of the patterns coloring the rest of the document, commands, math, etc, we would need to duplicate those patterns as subpatterns in it, and that would result in a lot of unnecessary patterns and other problems. That's the reason that inline math has one uniform coloring, and for instance commands in it do not get different colors. So we could have begin-end blocks have one uniform color, and maybe exclude document and possibly list environments from this, but I am not sure this is the optimal way to go, so I was waiting until the subpattern thing is completely resolved.
The way it works right now is that it captures the begin line and the end line separately, so it doesn't even check that they agree or that they appear in pairs, which is not ideal I guess.
If I have another idea I'll write about it here.
Please do.
-- bye, Frank!
Haris
hi
On 06.06.2005, at 00:51, Charilaos Skiadas wrote:
In particular, there's a problem with using " characters. I don't think there are any " delimited strings in LaTeX, but instead " is used to denote umlauts in German texts (e.g. to get ä you type "a). So, whenever I use an umlaut the syntax highlighting doesn't work anymore until the next umlaut because TM marks the text in between as being in the invalid.string.latex scope. This IMHO serves no useful purpose at all but nevertheless breaks the syntax highlighting. Could anyone please fix this?
I just committed a fix. It was highlighted as invalid.string.latex, so that people would know and change it, since this is not the LaTeX way of quoting. I removed that pattern, and the corresponding smart-typing pair, but I at least still get two quotes when typing one, so not sure what is going on there, but the highlight is gone.
Thank you, this is much better... :)
I'd also like to have a scope representing environments. So you could e.g. mark environments (something between and including \begin{} … \end{}) with a special background setting to distinguish them from the surrounding text.
Do you mean individual scope for different environments, or just capture each begin-end block? The entire document is contained within a \begin{document} \end{document} block, so any choice there would change how the entire document looks like, and any other groups contained in it would not be distinguished this way.
Oh, right, I didn't consider that. So we'd need different scopes for each environment, like keyword.markup.environment.<name> (replacing <name> by document, table, tabular, ...) or something similar. This way, we could exclude the "document" environment from the scopes for special syntax highlighting.
However, it isn't that important to me. I can wait until TM allows <whatever you were talking about in the rest of your posting>... ;) I guess this has also something to do with syntax highlighting not working in patterns like \footnotetext{<some latex>}?
If I have another idea I'll write about it here.
Please do.
I don't see any more problems right now. Having not half the document marked as invalid.string.latex is already a great improvement... ;)
hi
On 06.06.2005, at 00:51, Charilaos Skiadas wrote:
If I have another idea I'll write about it here.
Please do.
I found another one: In commands like \chapter{}, \section{}, \paragraph{}, ... the keyword and the closing brace are displayed as bold but the opening brace is not (in my theme setting). Obviously, this happens because the opening brace is not in the keyword.function.section.latex scope as are the other two parts. I think both braces should be handled equally.
On Jun 6, 2005, at 4:48 AM, Frank Schönmann wrote:
hi
On 06.06.2005, at 00:51, Charilaos Skiadas wrote:
If I have another idea I'll write about it here.
Please do.
I found another one: In commands like \chapter{}, \section{}, \paragraph{}, ... the keyword and the closing brace are displayed as bold but the opening brace is not (in my theme setting). Obviously, this happens because the opening brace is not in the keyword.function.section.latex scope as are the other two parts. I think both braces should be handled equally.
It should be fine now. Also, the begin-end blocks except {document} one will now be under scope declaration.environment.latex. Let me know if there are any problems, and if you find other stuff.
-- bye, Frank!
Haris
On Jun 6, 2005, at 0:51, Charilaos Skiadas wrote:
I removed that pattern, and the corresponding smart-typing pair, but I at least still get two quotes when typing one, so not sure what is going on there, but the highlight is gone.
The smart-typing pairs are in the theme editor now (there's LaTeX Stuff under Settings: Basic).