<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
% `sc-test1.tex', part of the LaTeX package `sidecap'
% 2003-02-21
% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de

\listfiles
\documentclass[12pt,a4paper]{article}
%\usepackage[bf,footnotesize]{caption2}
%\usepackage[innercaption,origragged,ragged]{sidecap}
%\usepackage[innercaption,raggedright]{sidecap}
\usepackage{sidecap}

\input{sc-test-common}

%\newlength\mylength

\begin{document}

\section*{The \texttt{sidecap} package}

First, a standard \LaTeX\ \texttt{figure} environment
(fig.~\ref{fig:standard}).
Since width of the body of the figure is considerably less than
the document's \verb|\textwidth|, there is much space wasted.

\begin{figure}[h]
  \centering
  \FIG[1cm]{1}%
  \caption[\SHORTCAPi]{\CAPi}
  \label{fig:standard}
\end{figure}

For such cases, the \textsf{sidecap} package provides the
\verb|SCfigure| and \verb|SCtable| environments to put the
caption beside the body of the floating environment.

In this document, we used the defaults of the \textsf{sidecap} package:
%
\begin{verbatim}
  \usepackage{sidecap}
\end{verbatim}
%
In the text, we used the optional arguments for the following figures
(fig.~\ref{fig:sc1}, \ref{fig:sc2}, and \ref{fig:sc3}).
%
\begin{verbatim}
  \begin{SCfigure} ...
  \begin{SCfigure}[1.2][bhp] ...
  \begin{SCfigure}[][bhp] ...
\end{verbatim}
%
In the first case, no optional arguments were given, so the defaults
(\verb|[1.0][tbp]|) are used. I.e., the caption will be as wide as
the body of the float; and the `float placement specifier' is the same
as for \LaTeX's standard floats (fig.~\ref{fig:sc1}).
In the second case, both optional arguments are given to change the
caption width as well as the placement options (fig.~\ref{fig:sc2}).
To change only the placement, just leave the first optional argument
empty (fig.~\ref{fig:sc3}).

\begin{SCfigure}
  \FIG[1cm]{1}%
  \caption[\SHORTCAPi]{\CAPi}
  \label{fig:sc1}
\end{SCfigure}

\begin{SCfigure}[1.2][bhp]
  \FIG[1cm]{1}%
  \caption[\SHORTCAPi]{\CAPi}
  \label{fig:sc2}
\end{SCfigure}

\begin{SCfigure}[][bhp]
  \FIG[1cm]{1}%
  \caption[\SHORTCAPi]{\CAPi}
  \label{fig:sc3}
\end{SCfigure}

\clearpage

Now, a standard \LaTeX\ \texttt{table} environment
(tab.~\ref{tab:standard}).

\begin{table}[h]
  \centering
  \caption[\SHORTCAPi]{\CAPi}
  \TABi%
  \label{tab:standard}
\end{table}

The only difference between the \verb|SCfigure| and the
\verb|SCtable| environments is the vertical position of the
caption with respect to the body of the float:
The former places the caption bottom-aligned, the latter top-aligned
(compare fig.~\ref{fig:sc1} to tab.~\ref{tab:sc1}).

Also, like standard \LaTeX, the \textsf{sidecap} package doesn't care
about the contents of the float (cf.\ tabs.~\ref{tab:standard} and
\ref{tab:sc1}).

\begin{SCtable}
  \caption[\SHORTCAPi]{\CAPi}  
  \FIG[1cm]{1}%
  \label{tab:sc1}
\end{SCtable}

If you want to use all the remaining space for the caption, just
specify a sufficiently large factor in the first optional argument.
E.g., for tab.~\ref{tab:sc2} we used the following:
%
\begin{verbatim}
  \begin{SCtable}[50] ...
\end{verbatim}
%
Note, however, that \TeX\ may complain
%
\begin{verbatim}
  ! Dimension too large.
\end{verbatim}
%
if the factor times the width of the body is huge enough to exceed
the range \TeX\ is able to represent in a length register.
%
(Max.\ \verb|\maxdimen|%
${}={}$\the\maxdimen
${}\approx 5.76$\,{meters}).

% VOODOO:
%\setlength
%\mylength=\maxdimen
%\mylength=-\mylength
%\the\mylength

\begin{SCtable}[50]
  \caption[\SHORTCAPi]{\CAPi}
  \label{tab:sc2}
%  \TABi%
  \FIG[1cm]{1}%
\end{SCtable}

\end{document}
</pre></body></html>