Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mambocab/7405045 to your computer and use it in GitHub Desktop.
Save mambocab/7405045 to your computer and use it in GitHub Desktop.
<?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\{(?!document)[^\{\}]+\}(\{.*\}|\[.*\])*$
| ^.*\\\[\s*$
| ^.*\\(.+)\{$
</string>
</dict>
<key>uuid</key>
<string>02EB44C6-9203-4F4C-BFCB-7E3360B12842</string>
</dict>
</plist>
@mambocab
Copy link
Author

LaTeX Indentation Rules for Sublime Text

Gratefully stolen from albertxing.

Usage

Save as LaTeX/Indentation Rules.tmPreferences in your user profile folder.

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

@mambocab
Copy link
Author

Changes from albertxing's original:

  • removed rule to indent sections and subsections
  • changed \begin{} indentation rule to indent everything except \begin{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment