| 1 |
|
| 2 |
% `sc-test6.tex', part of the LaTeX package `sidecap' |
| 3 |
% 2003-02-21 |
| 4 |
% Rolf Niepraschk and Hubert G\"a\ss{}lein -- [email protected] |
| 5 |
|
| 6 |
\listfiles |
| 7 |
\documentclass[a4paper]{article} |
| 8 |
|
| 9 |
%\usepackage[colorgrid,gridunit=pt]{eso-pic} |
| 10 |
|
| 11 |
\usepackage{sidecap} |
| 12 |
%\usepackage[ragged]{sidecap} |
| 13 |
|
| 14 |
\input{sc-test-common} |
| 15 |
|
| 16 |
\begin{document} |
| 17 |
|
| 18 |
\section*{The \texttt{sidecap} package |
| 19 |
(text in body of floats)} |
| 20 |
|
| 21 |
If you need to put text inside the body of a floating |
| 22 |
environment, you'll have to put it inside a \verb|\parbox| |
| 23 |
or a \verb|minipage| environment. |
| 24 |
(This is necessary due to the way the \textsf{sidecap} package |
| 25 |
grabs the body of the float.) |
| 26 |
|
| 27 |
For example, the first pair of floats in this document |
| 28 |
(fig.~\ref{fig:wrong} and tab.~\ref{tab:wrong}) |
| 29 |
contain essentially the following: |
| 30 |
% |
| 31 |
\begin{verbatim} |
| 32 |
\begin{minipage}{0.5\textwidth}% |
| 33 |
text text ... text text. |
| 34 |
\end{minipage}% |
| 35 |
\end{verbatim} |
| 36 |
% |
| 37 |
Note that the alignment of the caption with respect to text in the body |
| 38 |
is wrong. |
| 39 |
|
| 40 |
\begin{SCfigure}[][hb] |
| 41 |
\FIG[0.078\textwidth]{3} |
| 42 |
\caption{`SCfigure' \CAPi} |
| 43 |
\label{fig:wrong} |
| 44 |
\end{SCfigure} |
| 45 |
|
| 46 |
\begin{SCtable}[][hb] |
| 47 |
\FIG[0.078\textwidth]{3} |
| 48 |
\caption{`SCtable' \CAPi} |
| 49 |
\label{tab:wrong} |
| 50 |
\end{SCtable} |
| 51 |
|
| 52 |
To fix this problem, you'll have to use some extra effort. |
| 53 |
|
| 54 |
\clearpage |
| 55 |
|
| 56 |
For example, the second pair of floats |
| 57 |
(fig.~\ref{fig:right} and tab.~\ref{tab:right}) |
| 58 |
contain essentially the following: |
| 59 |
% |
| 60 |
\begin{verbatim} |
| 61 |
\begin{minipage}{0.5\textwidth}% |
| 62 |
\strut |
| 63 |
text text ... text text. |
| 64 |
\unskip\strut |
| 65 |
\end{minipage}% |
| 66 |
\end{verbatim} |
| 67 |
% |
| 68 |
Now the caption is properly aligned with the first or last line of |
| 69 |
the text in the float's body. |
| 70 |
|
| 71 |
\begin{SCfigure}[][hb] |
| 72 |
\FIG[0.078\textwidth]{4} |
| 73 |
\caption{`SCfigure' \CAPi} |
| 74 |
\label{fig:right} |
| 75 |
\end{SCfigure} |
| 76 |
|
| 77 |
\begin{SCtable}[][hb] |
| 78 |
\FIG[0.078\textwidth]{4} |
| 79 |
\caption{`SCtable' \CAPi} |
| 80 |
\label{tab:right} |
| 81 |
\end{SCtable} |
| 82 |
|
| 83 |
Still, there is a flaw in the captions: |
| 84 |
Due to the small \verb|\linewidth| the linebreaking and\slash or |
| 85 |
word spacing may be awful. |
| 86 |
Use one of the \texttt{raggedright}, \texttt{raggedleft}, or |
| 87 |
\texttt{ragged} package options. |
| 88 |
|
| 89 |
\end{document} |