LaTeX

Long Table 사용하기

ForceCore 2009. 3. 17. 15:53
LongTable
longtable.

삽화가 많으면, 여러페이지에 걸쳐 삽화를 넣고 싶을 수도 있다. 그러나 내용상 이어지는 삽화라, 그냥 낱개의 figure로 만들면, 다른 내용과 섞여서 조잡하게 된다. 한 페이지 안에 오는 삽화라면 그냥 array를 쓰면 되건만...

해결책: array로 2~4개의 figure를 넣던 것을 응용한다.

longtable 패키지를 쓴다고 선언해야 한다:

\begin{figure}[tbph]
    \begin{longtable}{c}
        \input{fig/cnt1.tex} \vspace{2mm} \\
        \textbf{(a)} \vspace{2mm} \\
        \input{fig/cnt2.tex} \vspace{2mm} \\
        \textbf{(b)} \vspace{2mm} \\
        \input{fig/cnt3.tex} \vspace{2mm} \\
        \textbf{(c)} \vspace{2mm} \\
        \input{fig/cnt4.tex} \vspace{2mm} \\
        \textbf{(d)} \vspace{2mm} \\
        \input{fig/cnt5.tex} \vspace{2mm} \\
        \textbf{(e)} \vspace{2mm} \\
        \input{fig/cnt6.tex} \vspace{2mm} \\
        \textbf{(f)} \vspace{2mm} \\
    \end{longtable}

\caption{
The operation of Counting-Sort on an input array A[1..11], where each element of A is a non-negative integer no larger than $k = 6$.
{\bf(a)} The array A and the auxiliary array C after line 4.
{\bf(b)} The array C after line 7. The numbers have been accumulated. C[i] indicates the number elements that are less than or equal to i, in array A.
{\bf(c)} Array B, C after first iteration through lines 9-11. Shaded elements are not filled in yet.
{\bf(d)} Array B, C after second iteration through lines 9-11.
{\bf(e)} Array B, C after third iteration through lines 9-11.
{\bf(f)} Array B after algorithm termination
}
\end{figure}sdf

코드는 위와 같다. \input 이라고 된 것을 png/pdf/jpg 그림을 넣는 \includegraphics 로 바꾸든지 그건 알아서 하라. 위의 배치는, 1렬 종대로 그림을 쭉 배치한다.

결과는 아래와 같다: