summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/sidecap/sc-test1.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/sidecap/sc-test1.tex
Initial commit
Diffstat (limited to 'macros/latex/contrib/sidecap/sc-test1.tex')
-rw-r--r--macros/latex/contrib/sidecap/sc-test1.tex141
1 files changed, 141 insertions, 0 deletions
diff --git a/macros/latex/contrib/sidecap/sc-test1.tex b/macros/latex/contrib/sidecap/sc-test1.tex
new file mode 100644
index 0000000000..726eaad5b5
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test1.tex
@@ -0,0 +1,141 @@
+
+% `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}