SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 364 forks source link

Inline Math environment Autocomplete #1442

Open mhafzal opened 4 years ago

mhafzal commented 4 years ago

For inline math environment, $$ or ( ), It automatically converts underscore _ to curly brackets {}. For example If I want to write \betat, After pressing when I press any key, it automatically puts curly brackets so it will be written as \beta{t}. Can anyone please suggest a solution. Thanks

r-stein commented 4 years ago

Sorry for the late reply, we don't define a keybinding for _. If this is still an issue: Can you please open the ST console View > Show Console. Then write sublime.log_commands(True) and press the keybinding and check which command is executed.

If nothing helps you can also just overwrite the behavior with a corresponding keybinding in Preferences > Keybinding:

    {
        "keys": ["_"],
        "command": "insert",
        "args": {
            "characters": "_"
        },
        "context": [
            { "key": "selector", "operator": "equal", "operand": "text.tex.latex meta.environment.math" },
        ]
    },
jiajunluo121 commented 4 years ago

Hi, I have the same issue as @mhafzal. I tried overwriting the behavior and it works! Thanks!