I did some search but could not find a similar question. Thank you for sending me a link if there's one. My question is as follows:

For convenience when writing latex, I use a lot of custom commands without any input arguments, such as \newcommand \eg {e.g.,}. In order to avoid elimination of the space afterwards, I need to add empty braces (i.e., \eg{}) when using it. However, this is annoying because I have to remember typing {} all the time or there will be mistakes.

So I want the auto-completion in TexStudio to output \eg{} when I type \eg.

If I modify my command into \newcommand \eg [1] {e.g.,}, the auto-completion in TexStudio gives \eg{arg1} instead of \eg{}. This is not what I want because I have to delete arg1 manually. I found ShareLatex and Overleaf can achieve this, but I do not want to switch to them.

Thank you in advance for helping me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.