하위 수치를 사용 subfig
하고 관리하고 있습니다. floatrow
이 없으면 floatrow
모든 것이 제대로 작동하지만 설명서에 설명된 floatrow
대로 캡션을 쉽게 정렬 해야 합니다 subfig
.
매뉴얼 37페이지의 예를 적용하고Gonzalo Medina의 도움, 다음 코드를 받았습니다.
\documentclass{article}
\usepackage{graphicx,subfig}
\usepackage[heightadjust=all,valign=c]{floatrow}
\usepackage{fr-subfig}
\begin{document}
\thisfloatsetup{subfloatrowsep=none}
\begin{figure}[!htbp]
\captionsetup[subfigure]{justification=centering}
\floatbox{figure}{%
\caption{%
Components of the system: Penguins (\ref{fig:a}), Jumpers (\ref{fig:b}), Thingies (\ref{fig:c}), Cabbages (\ref{fig:d}) and Nuclear Warheads (\ref{fig:e})%
}\label{fig:x}%
}{%
\begin{subfloatrow}%
\subfloat[Penguins were here and here and here]{%
\label{fig:a}\includegraphics[height=.1\textheight]{example-image-a}}
\qquad
\subfloat[Penguin]{%
\label{fig:b}\includegraphics[height=.15\textheight]{example-image-b}}
\qquad
\subfloat[Penguin]{%
\label{fig:c}\includegraphics[height=.125\textheight]{example-image-a}}
\end{subfloatrow}
\begin{subfloatrow}
\subfloat[Penguin]{%
\label{fig:d}\includegraphics[height=.15\textheight]{example-image-b}}
\qquad
\subfloat[Penguins were here, there and everywhere!]{%
\label{fig:e}\includegraphics[height=.2\textheight]{example-image-a}}
\end{subfloatrow}}
\end{figure}
\ref{fig:x} \ref{fig:a} \ref{fig:c} \ref{fig:e}
\end{document}
그러나 분명히 캡션 번호 매기기에 문제가 있습니다. 이것은 모두 그림 1이어야 하지만 4로 시작하고 2씩 더 증가합니다. 레이블을 다른 위치로 이동해 보았지만 LaTeX에서 참조가 변경되었다고 알려 주지만 여전히 동일한 결과를 얻습니다. 나는 또한 .aux
파일 등을 제거하려고 시도했습니다. 그러나 다시 그림에 대해 4개, 하위 그림에 대해 6개를 얻습니다.
이를 수행하는 올바른 방법은 무엇입니까?
답변1
그러면 올바른 출력이 제공됩니다.
\documentclass{article}
\usepackage{graphicx,subfig}
\usepackage[heightadjust=all,valign=c]{floatrow}
\usepackage{fr-subfig}
\begin{document}
\thisfloatsetup{subfloatrowsep=qquad}
\begin{figure}[!htbp]
\captionsetup[subfigure]{justification=centering}
\ffigbox{%
\begin{subfloatrow}[3]%
\ffigbox[\FBwidth]{\caption{Penguins were here and here and here}\label{fig:a}}{%
\includegraphics[height=.1\textheight]{example-image-a}}
\ffigbox[\FBwidth]{\caption{Penguin}\label{fig:b}}{%
\includegraphics[height=.15\textheight]{example-image-b}}
\ffigbox[\FBwidth]{\caption{Penguin}\label{fig:c}}{%
\includegraphics[height=.125\textheight]{example-image-a}}
\end{subfloatrow}
\begin{subfloatrow}
\ffigbox[\FBwidth]{\caption{Penguin}\label{fig:d}}{%
\includegraphics[height=.15\textheight]{example-image-b}}
\ffigbox[\FBwidth]{\caption{Penguins were here, there and everywhere!}\label{fig:e}}{%
\includegraphics[height=.2\textheight]{example-image-a}}
\end{subfloatrow}%
}{%
\caption{Components of the system: Penguins (\ref{fig:a}), Jumpers (\ref{fig:b}), Thingies (\ref{fig:c}), Cabbages (\ref{fig:d}) and Nuclear Warheads (\ref{fig:e})\label{fig:x}}%
}
\end{figure}
\ref{fig:x} \ref{fig:a} \ref{fig:c} \ref{fig:e}
\end{document}
문제는 floatrow
명령을 subfig의 명령과 결합하는 것 같습니다 \subfloat
(두 패키지의 명령을 사용하면 카운터 단계가 잘못된 방식으로 진행되는 것 같습니다(각 패키지가 제어권을 가지면 카운터 단계를 진행합니다).) 명령만 사용하여 모든 작업을 완료하면 floatrow
문제가 사라집니다. 이 또한
\thisfloatsetup{subfloatrowsep=qquad}
예상대로 작동하므로 지금은 수동 조정이 필요하지 않습니다.이 다른 질문).