From Texsudio manual on autocompletion files:

"The classifiers specifying the meaning of arguments (like c or i) always apply to the first non-optional parameter. This is a current limitation of the cwl format and the LaTeX parser in TXS. For example \ref{label}#r and \ref[option]{label}#r will work as expected, but \ref{arg}{label}#r will interpret arg as reference. We recommend not to specify any class in such a case."

Does it mean that there is no way to use the second argument of command as a label recognized by texstudio or one can "skip class" and use the next argument?

for example:


I can use cwl file to recognize 1st argument by adding:


Could I do some skipping like:


in order to use the second argument as a label?

1 Answer 1


The statement you mentioned from the manual is outdated.

If you use the #l qualifier, you can define an arbitray argument as label, but it's name has to be label.


If you want to use a different name or multiple labels, you can use the inline definition with labeldef.


Note: Your example will still not work, because the names labels and references have to be identical. Otherwise TeXstudio cannot match them. You cannot \dplot{mylabel} and \ref{fig:mylabel}. See also autocomplete with labels defined by user commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .