texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

Is it possible to have TeXstudio list available labels for a custom command which is based on \ref? #1173

Closed henrikgit closed 4 years ago

henrikgit commented 4 years ago

I defined a custom command:

\newcommand{\fullref}[1]{\autoref{#1}, \autopageref{#1}}

Is it possible to have TeXstudio list available labels from my document, so that I can use that custom command like I am using \ref or \autoref and similar commands?

Note: the option to load included files is checked/activated (in the options in the Editor tab).

Environment

Expected behavior

I'd like TeXstudio to show available labels when I enter the brackets for \fullref{#1}.

Actual behavior

How to reproduce

Create a custom command, e. g. \newcommand{\fullref}[1]{\autoref{#1}, \autopageref{#1}} and start typing it.

muzimuzhi commented 4 years ago

You need to record \fullref in cwl file.

For example,

Related documentation:

sunderme commented 4 years ago

this is answered

henrikgit commented 4 years ago

Thank you. It was super easy. I just had to put \fullref{key}#r in my custom completion file. :)