This is a lazy question but I want to define a command like so
\newcommand{\abs}[1]{\ensuremath{\left|{#1}\right|}}
But this doesn't automatically present the { } so I can include the argument the same way a \mathbb{} does. Any idea how I can include those in the definition? Can't seem to figure that out.
EDIT: I don't think I quite got my point across, so let me reiterate: When I type "\mat" into Overleaf, it immediately suggests "\matbb{}" and auto-completes with the curly brackets, whereas, when I type "\a" it auto-completes to "\abs" without the brackets. So I then have to type the brackets each time to insert the argument. Is there a way to define my command so that it does paste with the brackets?
\lbrace
and\rbrace
?overleaf
as well. BTW: I'd usemathtools
to define\abs
as the construction cited is wrong in may ways.\newcommand{\abs}[1]{\left|#1\right|}
just prompts\abs
during autocomplete. However, using\newcommand\abs[1]{\left|#1\right|}
prompts\abs[]{}
during autocomplete. The former use of\newcommand
is even suggested in the autocomplete, but only the latter suggests an improved autocomplete option. Of course, since there's no optional argument, it should just suggest\abs{}
. This seems like something that is better to report to Overleaf directly as it's an issue with the online editor, or finding someone here that provides support.