[TxMt] Latex grammar problem

Charilaos Skiadas cskiadas at uchicago.edu
Wed May 31 14:27:29 UTC 2006


On May 31, 2006, at 12:23 AM, Alain Matthes wrote:

> Do you have an idea for the second problem when i use a ' between  
> {....} ?
>  it's not very important because cmd shift B works very well !!

I am not sure I understand what the problem is. Can you give me a  
more specific example of what the text is, what the behavior you are  
seeing is, and what you expect to be seeing?

> I don't know why  I use only the option of the caret's position
>  to highlight parentheses pairs.
>
> I develop a latex package and a latex class and I often use the  
> apostrophe
>  in parameters to define new commands.

I think the simpler solution for you would be to disable the use of  
(`) and (') as special characters in LaTeX documents. To do that,  
open the Bundle editor, go to the LaTeX bundle and find the  
"Miscellaneous" preference item. In there you will see:
	highlightPairs = (
		( '"', '"' ),
		( '(', ')' ),
		( '{', '}' ),
		( '[', ']' ),
		( '“', '”' ),
		( '$', '$' ),
		( '`', "'" ),
	);
	increaseIndentPattern = '^\s*\\begin\{.*\}';
	smartTypingPairs = (
		( '"', '"' ),
		( '(', ')' ),
		( '{', '}' ),
		( '[', ']' ),
		( '“', '”' ),
		( '$', '$' ),
		( '`', "'" ),


and remove the two lines that say: 		( '`', "'" ),
Then go inside the LaTeX syntax file and find the lines:
		{	name = 'string.quoted.single.latex';
			begin = '`';
			end = "'";
		},

and remove those as well. This should make backticks and apostrophes  
behave like regular symbols. as long as they don't appear two at a time.

To Allan and the other maintainers: The scope for the Miscellaneous  
item is text.latex. I am thinking it should perhaps also work in  
source.tex ?
Also, perhaps we should consider not considering single quoted  
strings as such. Perhaps the same for the double quotes. The problem  
is that any arbitrary LaTeX construct is allowed between the quotes,  
in fact the quotes are not even required to close. They are treated  
by LaTeX just as regular characters, not as pairs,  so perhaps we  
should treat them the same way. As it stands, the following is  
highlighted pretty badly, without noticing the math among other things:
``$\frac{x}{\sin(x)}$''
And if anyone ever decides they want just an opening quote without  
the corresponding closing quote, they would be in trouble.

> It's a real pleasure to work with textmate and guys like Allan and you
>
> Greetings
>
> Alain Matthes

Haris





More information about the textmate mailing list