TeXstudio does a pretty good job with autocompletion. For example, when I type \eqref{
, it already comes with suggestions, see the example below.
However, suppose that I don't want to use \eqref
but a customized command using newcommand
(I do this so that I can quickly switch to different styles, e.g., some for journals/conferences "Eq. (1)" is needed, whereas sometimes "(1)" suffices). In this case, TeXstudio does not do the auto-completion, see the example below.
Is it possible to configure TeXstudio such that it does the auto-completion for custom commands that require a reference?
Note that one option is to redefine \eqref
using \renewcommand
, but I'm looking for another way so that I can use if for many more commands, not just for \eqref
.
Here is my MWE:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\alternative}[1]{Eq.~(\ref{#1})}
\begin{document}
\begin{equation}
\label{eq:emc2}
E = mc^2
\end{equation}
I can refer to the equation using \eqref{eq:emc2} and using \alternative{eq:emc2}.
\end{document}