Is there a way to have completion for cref references for labels defined in a command macro?
\newcommand{\midpict}[4]{
\begin{center}
\begin{figure}[H]
\begin{center}
\includegraphics[width=#2\textwidth]{#1}
\caption{\label{fig:#4}#3}
\end{center}
\end{figure}
\end{center}
}
I use it like
\midpict{./template/placeholder.png}{0.5}{This is a placeholder}{placeholder-img-1}
And I'd like to use Cref{fig:placeholder-img-1} but have the completion feature for this label.
centerenvironment will add additional spacing to your figure, better use\centeringinside your figure. – samcarter_is_at_topanswers.xyz Jul 03 '18 at 10:28H(https://tex.stackexchange.com/questions/370627/why-should-the-h-option-not-be-used-in-floats). – TeXnician Jul 03 '18 at 11:40fig:part in your argument (i.e., not hide it in the definition for the\midpictcommand, it's possible to have the correct label be recognized for cross-referencing in TeXstudio autocompleter. Alternatively, you can write a user macro in TeXstudio that inserts that chunk of code (in\midpict) with some combination of keystrokes. – Troy Aug 04 '18 at 14:28