KOMA-스크립트 캡션옆 및 사용자 정의 플로트

KOMA-스크립트 캡션옆 및 사용자 정의 플로트

algorithmicKOMA 스크립트 보고서에서 알고리즘에 사용자 정의 부동 소수점을 사용하고 아래 대신 바로 옆에 캡션과 함께 -environment를 표시하고 싶습니다 . 컴파일러 오류를 피하기 위해 algorithmica 를 래핑해야 한다는 사실 외에도 -floats 에 문제가 있습니다 .parboxcaptionbesidefloat

\documentclass{scrreprt}
\usepackage{float}
\floatstyle{plain}
\newfloat{myfigure}{t}{myfigure}
\begin{document}
% Works as expected: Left & Right on same line.
\begin{figure}
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{figure}
% Doesn't work: Left on one line, Right below
\begin{myfigure}
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{myfigure}
\end{document}

산출

내장형 플로트와 float플로트의 차이점은 무엇인가요? 모든 것에 대해 -like 결과를 어떻게 얻을 수 있습니까 figure?

답변1

와 함께KOMA 스크립트자체 메커니즘이 있으므로 새로운 부동 환경을 정의하기 위해 추가 패키지가 필요하지 않습니다.

\documentclass{scrreprt}

\DeclareNewTOC[
  type=myfigure,
  types=myfigures,
  float,
  floatpos=t,
  name=My Figure,
  listname={List of my Figures},
  counterwithin=chapter
]{lomf}

\begin{document}

\chapter{foo}

\begin{figure}[h]% positioning parameter just for the example
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{figure}

\begin{myfigure}[h]% positioning parameter just for the example
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{myfigure}

\end{document}

명령 \DeclareNewTOC과 해당 옵션은 다음에 설명되어 있습니다.scrguien.pdf섹션 13.5.

답변2

float패키지는 다른 많은 패키지 및 클래스와 약간의 비호환성을 초래하는 것 같습니다. 귀하의 예는 의도 한대로 작동합니다newfloat패키지.

\documentclass{scrreprt}

\usepackage{newfloat}
\DeclareFloatingEnvironment[placement=t]{myfigure}

\begin{document}

\chapter{foo}

\begin{figure}[h]% positioning parameter just for the example
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{figure}

\begin{myfigure}[h]% positioning parameter just for the example
    \begin{captionbeside}{Right}Left\end{captionbeside}
\end{myfigure}

\end{document}

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

관련 정보