Sublime Forum

[Solved] LaTeXTools - Syntax does not stick

#1

Latest build, latest Mac OSX.
I have a personal Latex_Piero.tmLanguage §i’d like to use for Latex.
If I switch syntax to it and save the file, it switches back to standard.
If I switch syntax via the menu View>Syntax>Open all with…
it switches back to standard.
If I create a Latex_Piero.sublime-settings file in my User directory containing
{“extensions”: [“tex”]}
it switches back to standard.

Any pointers to what might be wrong?

Thanks
Piero

0 Likes

#2

Are you using a custom theme? Some theme authors override extension settings.

Do you have any custom LaTex packages installed?

Can you provide a link to your .tmLanguage file?

0 Likes

#3

What does view.settings().get("syntax") in the console yield (with the view active that you are having trouble with)?

0 Likes

#4

The command view.settings().get(“syntax”) gives Latex_Piero immediately
after I switch to my syntax, but after a save it gives Latex

The theme is Soda Dark, I made some minor customization in a sublime-theme
file inside my User dir.

As to my personal .tmLanguage, it is a bit of a mess, I have experimented a bit too much with it. If necessary I can send you a link

Latex packages installed: LatexTools. There is a Latexing cache but the package has been removed.

Inside my User dir there is a ton of plugins but until recently they gave me no problem. Should I look into them?

0 Likes

#5

Ok so I took out all my customizations from the Latex_Piero.tmLanguage file
and the problem persists.
Here is a link to the reduced example

https://dl.dropboxusercontent.com/u/3001609/Latex_Piero.tmLanguage

0 Likes

#6

If I create a file starting with \documentclass{beamer} and
save it, the syntax is automatically set to Latex. If I manually
switch to Latex Beamer, then save again, the syntax
reverts to Latex. Is this the intended behaviour of the
default packages?

0 Likes

#7

I don’t believe Latex_Piero.sublime-settings is going to be the correct name for the settings file since your syntax is named Latext.Piero. I may be incorrect about this, but I would try and see if Latex.Piero.sublime-settings works instead. Alternatively, perhaps giving your syntax a name without a . in it.

0 Likes

#8

Yes, I noticed that and changed the name, without any improvement. But as I said, even if I remove completely my tmLanguage file, I have the same problem with the default packages Latex/Latex Beamer. If I select Latex Beamer as syntax (on a file starting with \documentclass{beamer} ), after a save the syntax switches back to Latex. Is this the expected behaviour?

This is strange, right? I will open a topic just to know if this behaviour is standard or not, hope this is not bad mailing list behaviour. In case let me know and I’ll remove the new topic

0 Likes

#9

If you do create a related topic, it’s good behaviour to link to it, to make it easier for others to find in future if they have the same problem :slight_smile:

0 Likes

#10

PROBLEM SOLVED (main cause stupidity as it is well known)

The Latextool package has a new setting to always save as Latex :slight_smile:

0 Likes