Skip to content

LaTeX: one-letter key is not a good idea #364

Open
@firmart

Description

@firmart

Writing LaTeX with (setq yas-triggers-in-field t), which allows expanding snippet inside snippet, is very convenient. However, there are some one-letter key snippets in this repo that expand unexpectedly when I use <TAB> to move to the next field.

Example: \(g\)

I have a snippet <m which expands to \($1\)$0. When I want to write a function g in LaTeX, I type <m, g then <TAB>. However, since yas-triggers-in-field is activated, the <TAB> expands g to \gls{${1:label}}.

Since a function is very often named g (when f is already defined), this happens to be quite annoying.

As issue #69 stated, common words should not be used as a key.
I suggest to use gls as a key name or prepend the key by a common prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions