cref 및 tcolorbox를 사용할 때 TeXstudio에서 참조 제안을 표시하는 방법은 무엇입니까?

cref 및 tcolorbox를 사용할 때 TeXstudio에서 참조 제안을 표시하는 방법은 무엇입니까?

편집 : 이 질문은 지금입니다이 기능 요청TXS Github에서.

매우 까다로운 질문입니다. 저는 tcolorbox 패키지와 Cleveref인 TeXstudio를 즐겁게 사용하고 있습니다. TXS에서 입력하면 cref사용 가능한 모든 라벨이 나열되는 팝업 메뉴가 트리거되고 사용자는 관련 라벨을 직접 선택할 수 있습니다. 정리 상자에 대한 참조를 사용할 때 이 편리한 시스템이 손상된 것 같습니다.

자세한 사례 이 예제에서는 (clearef에 필요함) 및 tcolorbox 라이브러리 (모든 것이 최소 작업 예제에 입력되어 있음)를 tcolorbox사용 합니다.amsmathclevereftheorems

이 명령은 \newtcbtheorem다음과 같이 새로운 유형의 tcolorbox 정리 상자를 만듭니다.

\newtcbtheorem[crefname={mybox}{myboxes}]{mybox}{My super theorem}{}{mybox}

여기서 첫 번째 선택적 인수는 []Cleveref 이름을 설정하고, 인수는 {mybox}상자 환경의 이름이고, {My super theorem}제목에 표시되는 이름이고, 빈 인수는 {}상자 옵션을 위한 것이고, 마지막 인수 {mybox}는 참조의 접두사입니다. 예를 들어 상자를 만들 때

\begin{mybox}{The title}{thelabel} 
    Hello
\end{mybox}

첫 번째 인수는 상자의 제목이고 두 번째 인수는 로 호출할 수 있는 참조를 생성합니다 \cref{mybox:thelabel}. 라텍스 부분의 모든 것이 잘 작동하지만 편집자는 이러한 레이블이 존재하는지 모르는 것 같으며 사용자는 해당 레이블을 모두 외우거나 문서에서 요요를 알아야 합니다.

그림의 예: 여기에 이미지 설명을 입력하세요

원하는 동작mybox:thelabel팝업 제안 목록에서 볼 수 있습니다 . 도움을 주시면 감사하겠습니다!

버전해당되는 경우 Ubuntu 22.04, TeXstudio 4.3.1, tcolorbox 5.0.2, amsmath v2.17l 및 Cleveref v0.21.4를 사용하고 있습니다.

실제 사례

\documentclass{article}

\usepackage{tcolorbox}
\usepackage{amsmath} % required for cleverref
\usepackage{cleveref}

\tcbuselibrary{theorems}
\newtcbtheorem[crefname={mybox}{myboxes}]{mybox}{My super theorem}{}{mybox}

\begin{document}

    Example of the question:
    \begin{mybox}{The title}{thelabel} 
        Hello
    \end{mybox}

    This is a nice document, what a superb result we have here:
    \begin{mybox}{Micchelli 1986}{micchelli}
        Let $D$ be a distance matrix, i.e. $D_{ij} = d(x_i,x_j)$ for $n$ distinct points $(x_i)_{i=1}^n$ of an euclidian space. Then $D$ is invertible. 
    \end{mybox}
    
    This theorem applies for equations of the type
    \begin{align}\label{normalref}
        \sum_{i=1}^n c_i d(x_i, x_j) = 0 \quad\quad \forall 1 \leq j \leq n,
    \end{align}
    and the popup correctly displays the \texttt{normalref}: indeed, \cref{normalref} was displayed. However, although \cref{mybox:micchelli} works nicely, it was not displayed. 
    
\end{document}

관련 정보