3

I have a document with a local (not from package) defined commands

\newcommand{\mylabel}[1]{\label{#1}}
\newcommand{\myref}[1]{\ref{#1}}

I know that I can use the TeXstudio autocomplete with a suggestion list by writing

\mylabel{label}#l
\myref{label}#r

in to a packagename.cwl file. But is there an option to write it local into the document?

1
  • @ebo The point is that this is an minimal working example. There is some stuff that the command also does. I dont't just want the \myref{arg1} suggestion but the suggestions for all already existing labels like \myref{label1}, \myref{label2}.
    – meneken17
    Dec 2, 2016 at 12:19

1 Answer 1

4

There's currently no way to write the definitions within the tex file.

Suggested workaround:

  1. Create [settings-directory]\completion\user\user.cwl and define the command there.
  2. Go to Options -> Completion -> Permanently active completion files and select user.cwl there.
2
  • Has this changed now?
    – Orion
    Nov 22, 2017 at 21:43
  • No. This is the suggested way for the time being. Nov 22, 2017 at 22:48

You must log in to answer this question.

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