\DeclareCaptionFormat을 종료하고 기본 캡션 설정으로 되돌립니다.

\DeclareCaptionFormat을 종료하고 기본 캡션 설정으로 되돌립니다.

나는 꽤 잘 작동하는 알고리즘 플로트에 대한 자체 캡션 형식을 정의했습니다.

\DeclareCaptionFormat{algor}{%
  \hrulefill\par\offinterlineskip\vskip1pt%
  \textbf{#1#2}#3\offinterlineskip\hrulefill}
\DeclareCaptionStyle{algori}{singlelinecheck=off,format=algor,labelsep=space}
\captionsetup[algorithm]{style=algori}

그러나 내 문서의 그림에 기본 캡션 설정이 적용되기를 원합니다. 어떻게 하면 그렇게 할 수 있는지 제안해주세요.

답변1

다음을 통해 자신만의 캡션 스타일을 정의한다는 것을 알았습니다.

\DeclareCaptionFormat{<formatname>}{<code for format>}

그런 다음 특정 부동 환경에 대해 이 형식을 다음과 같이 사용합니다.

\captionsetup[<float_environment>]{singlelinecheck=off, labelsep=colon,format=<formatname>}

여기서 labelep은 '콜론'으로 설정되어 있으며 '공백' 등으로 변경할 수도 있습니다.

이 캡션 형식은 주어진 문제에 대해 다음과 같은 방식으로 사용될 수 있습니다

\DeclareCaptionFormat{algor}{%
  \hrulefill\par\offinterlineskip\vskip1pt%
  \textbf{#1#2}#3\offinterlineskip\hrulefill}
\DeclareCaptionStyle{algori}{singlelinecheck=off,format=algor,labelsep=space}
\captionsetup[algorithm]{style=algori}

\DeclareCaptionFormat{figur}{%
  \begin{center}
  \textbf{#1#2}#3
  \end{center}}
\captionsetup[figure]{singlelinecheck=off,format=figur,labelsep=colon}

관련 정보