Sublime Forum

[Solved] Editing the syntax coloring in HTML

#1

Hi, I would like to edit the syntax coloring of HTML files to highlight MathJax equations placed within $ $, e.g.

I’m not sure where to find the HTML.tmLanguage file, or where to create it and what to put in it if it does not already exist (using Sublime 3 on Ubuntu). Any help would be much appreciated. Thanks.

0 Likes

#2

Which version of Sublime Text are you using? Version 3 no longer uses .tmLanguage files. The recommended way to modify files that are part of the default packages is to install PackageResourceViewer through Package Control.

Then you can get to the HTML syntax definition by:

  • opening the Command Palette
  • type PRV and select PackageResourceViewer - Open Resource
  • select HTML
  • select HTML.sublime-syntax or HTML.tmLanguage depending how old your ST version is
  • edit it to include your \$.*\$ pattern and scope
  • save it
1 Like

#3

I would suggest using a with_prototype push instead. See more here: http://www.sublimetext.com/docs/3/syntax.html

2 Likes