public
Last active

LaTeX indentation rules for Sublime Text. See usage in comments below.

  • Download Gist
Indentation Rules.tmPreferences
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>text.tex, sources.bib</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>(?x)
^\s*\\end\{[^\{\}]+\}.*$
| ^\s*\\\].*$
| ^\s*\}.*
| ^\s*\%.*\(end\).*$
</string>
<key>increaseIndentPattern</key>
<string>(?x)
^\s*\\begin\{[^\{\}]+\}(\{.*\}|\[.*\])*$
| ^.*\\\[\s*$
| ^.*\\(.+)\{$
| ^\s*\\((sub)[0,2])?section(\*)?\{.*\}.*$
</string>
</dict>
<key>uuid</key>
<string>02EB44C6-9203-4F4C-BFCB-7E3360B12842</string>
</dict>
</plist>

LaTeX Indentation Rules for Sublime Text

Usage

Download/paste & save as LaTeX/Indentation Rules.tmPreferences in your user profile folder
(i.e. C:/Users/<username>/AppData/Roaming/Sublime Text 2/Packages/LaTeX.

You can find your Packages folder through Sublime's Preferences > Browse Packages... menu item.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.