I'm currently writing a thesis using LaTeX. I have a couple of figures (diagrams) in my document and wanted to reference them in a more convenient way than always writing "bla in figure \ref{labelname}".
So I wrote an own command:
\newcommand{\reffig}{figure \ref}
This is working. However, if I use it, TexStudio does not recognize the usage of that label. If I hover the cursor over the label of the figure, it will show 0 references.
Same for labels in chapters with my new command:
\newcommand{\refsec}[1]{section \ref{#1} - \nameref{#1}}
Did I do something wrong declaring my commands? Is there a way to get TexStudio to recognize the references?
Thanks a lot!
TeXStudiosuch macros and handle them accordingly or rather switch to the more appropiatecleverefpackage, that automatically detects the type of the reference, i.e.\cref{foofigure}will show youFigure 2.1etc, i.e. you dont need to remember then, whether you need\reffigor\refsecetc. – Dec 28 '18 at 11:13cleveref. If you want to configure texstudio instead, you have to create a custom .cwl file, see https://tex.stackexchange.com/questions/414281/configuring-auto-completion-with-texstudio for more information – samcarter_is_at_topanswers.xyz Dec 28 '18 at 15:24\refsecwithcleverrefas well, by saying\newcommand{\ncref}[1]{\cref{#1} - \nameref{#1}}... – Dec 28 '18 at 15:44