Texstudio \begin{subFigure} 인식할 수 없는 명령

Texstudio \begin{subFigure} 인식할 수 없는 명령

나는 다음과 같이 내 문서에 하위 그림을 만들기 위해 하위 캡션 패키지를 사용하고 있습니다.

\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}[ht]
\begin{subfigure}[b]{0.45\textwidth}
    \includegraphics[width=\textwidth]{images/1.png}
    \caption{Subcap1}
    \label{fig:1}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}
    \includegraphics[width=\textwidth]{images/2.png} 
    \caption{Subcap2}
    \label{fig:2}
\end{subfigure}
\caption{Cap}
\label{fig:3}
\end{figure}

\end{document}

이것은 잘 컴파일되지만 texstudio 편집기에서는 및가 \begin{subfigure}" \end{subfigure}인식할 수 없는 명령"으로 강조 표시됩니다. 옵션 > 완료에서 캡션, 하위 캡션, 하위 그림 및 하위 그림 cwl 파일을 활성화하려고 시도했지만 강조 표시가 제거되지는 않습니다.

이는 컴파일에 영향을 주지 않지만 다소 짜증스럽습니다. 제가 뭔가를 놓치고 있거나 패키지를 잘못 사용하고 있나요?

답변1

이것을 또는 subcaptionTemp.cwl로 저장하세요 !~/.config/texstudio/%APPDATA%\texstudio\

# manipulated the auto-generated subcaption.cwl for Holt
# subcaption package
# Axel Sommerfeldt 04/16/2013
# URL: http://mirror.switch.ch/ftp/mirror/tex/help/Catalogue/entries/subcaption.html

#include:caption
#
#
# Chapter 1 Loading the package
#
#
\captionsetup[sub]{%<options%>}
#keyvals:\captionsetup
margin=%<num%>pt
margin={%<left amount%>,%<right amount%>}
margin*=%<num%>pt
margin*={%<left amount%>,%<right amount%>}
font=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
font+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
font={%<option 1%>,%<option 2%>}
labelfont=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
labelfont+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
labelfont={%<option 1%>,%<option 2%>}
textfont=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
textfont+=#scriptsize,footnotesize,small,normalsize,large,Large,normalfont,up,it,sl,sc,md,bf,rm,sf,tt,singlespacing,onehalfspacing,doublespacing,{strech=%<amount%>},normalcolor,{color=%<colour%>},normal
textfont={%<option 1%>,%<option 2%>}
labelformat=#default,empty,parens,simple,brace
labelsep=#none,period,space,quad,colon,newline,endash
skip=%<num%>pt
list=#false,true,no
hypcap=#false,true
indention=%<amount%>pt
position=#auto,top,above,bottom,below
#endkeyvals
#
#
# Chapter 2 The \subcaption command
#
#
\subcaption{heading}#/minipage
\subcaption[list entry]{heading}#/minipage
\subcaption*{heading}#/minipage
\setcaptionsubtype#S
\setcaptionsubtype*#S
#
#
# Chapter 3 The subfigure & subtable environments    
#
#
\begin{subfigure}{width}
# pos can be b (default: )
\begin{subfigure}[pos]{width}
\begin{subtable}{width}
\begin{subtable}[pos]{width}
\end{subfigure}
\end{subtable}
\captin@For{subtyelist}#S
#
#
# Chapter 4 The \subcaptionbox command
#
#
# inner-pos can be c, l, r, s (default: c)
\subcaptionbox[list entry]{heading}[width][inner-pos]{contents}
\subcaptionbox[list entry]{heading}[width]{contents}
\subcaptionbox[list entry]{heading}{contents}
\subcaptionbox{heading}[width][inner-pos]{contents}
\subcaptionbox{heading}[width]{contents}
\subcaptionbox{heading}{contents}
\subcaptionbox*{heading}[width][inner-pos]{contents}
\subcaptionbox*{heading}[width]{contents}
\subcaptionbox*{heading}{contents}
#
#
# Chapter 5 The \DeclareCaptionSubType command
#
#
# numbering-pos can be arabic, roman, Roman, alph, Alph, fnsymbol... (defaul: alph)
\DeclareCaptionSubType[numbering scheme]{float type}#*d
\DeclareCaptionSubType{float type}#*d
\DeclareCaptionSubType*[numbering scheme]{float type}#*d
\DeclareCaptionSubType{float type}#*d
#
#
# Chapter 6 References
#
#
\thesubfigure#S
\thesubtable#S
\p@subfigure#S
\p@subtable#S
\subref{key}#*r
\subref*{key}#*r
#keyvals:\captionsetup
subrefformat=#parens
#endkeyvals
\phantomsubcaption
# other commands
\subfigureautorefname#S
\subfigurename#S
\subtableautorefname#S
\subtablename#S
\theHsubfigure#S
\theHsubtable#S

그런 다음 기본 설정으로 이동하여 이 파일을 로드합니다.

여기에 이미지 설명을 입력하세요


어떤 피드백이라도 기꺼이 받아들일 것입니다. 이것이 당신에게 잘 작동한다면, TXS의 관리자에게 제출하겠습니다.

관련 정보