summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/sidecap
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
Initial commit
Diffstat (limited to 'macros/latex/contrib/sidecap')
-rw-r--r--macros/latex/contrib/sidecap/Makefile23
-rw-r--r--macros/latex/contrib/sidecap/README15
-rw-r--r--macros/latex/contrib/sidecap/sc-test-common.tex122
-rw-r--r--macros/latex/contrib/sidecap/sc-test1.tex141
-rw-r--r--macros/latex/contrib/sidecap/sc-test2.tex89
-rw-r--r--macros/latex/contrib/sidecap/sc-test3.tex54
-rw-r--r--macros/latex/contrib/sidecap/sc-test4.tex76
-rw-r--r--macros/latex/contrib/sidecap/sc-test5.tex41
-rw-r--r--macros/latex/contrib/sidecap/sc-test6.tex89
-rw-r--r--macros/latex/contrib/sidecap/sidecap.dtx789
-rw-r--r--macros/latex/contrib/sidecap/sidecap.ins31
-rw-r--r--macros/latex/contrib/sidecap/sidecap.pdfbin0 -> 156630 bytes
12 files changed, 1470 insertions, 0 deletions
diff --git a/macros/latex/contrib/sidecap/Makefile b/macros/latex/contrib/sidecap/Makefile
new file mode 100644
index 0000000000..acdb8b2fdf
--- /dev/null
+++ b/macros/latex/contrib/sidecap/Makefile
@@ -0,0 +1,23 @@
+
+# Makefile for sidecap examples, 2003-02-21, RN
+
+LATEX = elatex
+
+ifneq ($(findstring pdf,$(MAKECMDGOALS)),)
+ LATEX = pdfelatex
+ PICS := $(PICS:.eps=.pdf)
+endif
+
+PS = sc-test1.ps sc-test2.ps sc-test3.ps sc-test4.ps sc-test5.ps sc-test6.ps
+
+all : $(PS)
+
+pdf : $(PS:.ps=.pdf)
+
+%.ps : %.dvi
+ dvips -Pwww $< -o $@
+
+%.dvi %.pdf : %.tex sc-test-common.tex
+ $(LATEX) $<
+ $(LATEX) $<
+
diff --git a/macros/latex/contrib/sidecap/README b/macros/latex/contrib/sidecap/README
new file mode 100644
index 0000000000..7838eedf0d
--- /dev/null
+++ b/macros/latex/contrib/sidecap/README
@@ -0,0 +1,15 @@
+
+The sidecap package.
+
+This package defines the new environments SCfigure and SCtable, analogous to
+figure and table, which make it easy to typeset captions sideways. The package
+knows the options outercaption, innercaption, leftcaption and rightcaption.
+
+Please send enhancements and corrections to:
+
+ Rolf Niepraschk, Rolf.Niepraschk@ptb.de
+ Hubert Gaesslein,
+
+ 2003/05/04
+
+
diff --git a/macros/latex/contrib/sidecap/sc-test-common.tex b/macros/latex/contrib/sidecap/sc-test-common.tex
new file mode 100644
index 0000000000..22b5dd9ff8
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test-common.tex
@@ -0,0 +1,122 @@
+
+% `sc-test-comon.tex', part of the LaTeX package `sidecap'
+% 2003-02-21
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\setlength{\emergencystretch}{20pt}
+\renewcommand{\textfraction}{0}
+\renewcommand{\topfraction}{1}
+\renewcommand{\bottomfraction}{1}
+\setcounter{bottomnumber}{4}
+\setcounter{topnumber}{4}
+\setcounter{totalnumber}{8}
+
+\errorcontextlines100
+
+\renewcommand\tablename{Tab.} \renewcommand\figurename{Fig.}
+
+\setlength{\belowcaptionskip}{\abovecaptionskip}
+
+\setlength\columnseprule{.4pt}
+
+\newcommand{\FIG}[2][]{%
+ \begingroup
+ \def\xxx{#1}%
+ \ifx\xxx\empty
+ \setlength{\unitlength}{\linewidth}%
+ \addtolength{\unitlength}{-2\fboxrule}%
+ \setlength{\unitlength}{.1\unitlength}%
+ \else
+ \setlength{\unitlength}{#1}%
+ \fi%
+ \setlength{\fboxsep}{0pt}%
+ \ifcase#2\relax
+ \or%
+ \fbox{%
+ \begin{picture}(4,6)%
+ \put(1,5){\circle{1}}%
+ \put(3,5){\circle{1}}%
+ \put(2,3){\circle{1}}%
+ \put(1,1){\circle{1}}%
+ \put(3,1){\circle{1}}%
+ \end{picture}}%
+ \or%
+ \fbox{%
+ \begin{picture}(10,4)%
+ \put(1,3){\circle{1}}%
+ \put(9,3){\circle{1}}%
+ \put(5,2){\circle{1}}%
+ \put(1,1){\circle{1}}%
+ \put(9,1){\circle{1}}%
+ \end{picture}}%
+ \or% (doesn't make a difference to use [b] or [t] or [c] here !!!)
+ \begin{minipage}{5\unitlength}%
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text.
+ \end{minipage}%
+ \or% (doesn't make a difference to use [b] or [t] or [c] here !!!)
+ \begin{minipage}{5\unitlength}%
+ \strut
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text
+ text text text text text text text text.
+ \unskip\strut
+ \end{minipage}%
+ \fi
+ \endgroup
+}
+
+\newcommand{\TABi}{%
+ \begin{tabular}{@{} | c | c c c c c | @{}} \hline
+ \multicolumn{1}{| c} {1}
+ & 2 & 3 & 4 & 5 & 6 \\ \cline{2-6}
+ 2 & 4 & 6 & 8 & 10 & 12 \\
+ 3 & 6 & 9 & 12 & 15 & 18 \\
+ 4 & 8 & 12 & 16 & 20 & 24 \\
+ 5 & 10 & 15 & 20 & 25 & 30 \\
+ 6 & 12 & 18 & 24 & 30 & 36 \\
+ 7 & 14 & 21 & 28 & 35 & 42 \\
+ 8 & 16 & 24 & 32 & 40 & 48 \\
+ 9 & 18 & 27 & 36 & 45 & 54 \\
+ 10 & 20 & 30 & 40 & 50 & 60 \\
+ 11 & 22 & 33 & 44 & 55 & 66 \\
+ 12 & 24 & 36 & 48 & 60 & 72 \\
+ 13 & 26 & 39 & 52 & 65 & 78 \\
+ 14 & 28 & 42 & 56 & 70 & 84 \\
+ \hline
+ \end{tabular}%
+}
+
+
+\newcommand{\CAPi}{%
+ The dazed brown fox quickly gave 12345--67890 jumps!
+ The dazed brown fox quickly gave 12345--67890 jumps!
+}
+
+\newcommand{\CAPii}{%
+ The dazed brown fox quickly gave 12345--67890 jumps!
+ The dazed brown fox quickly gave 12345--67890 jumps!
+ The dazed brown fox quickly gave 12345--67890 jumps!
+ The dazed brown fox quickly gave 12345--67890 jumps!
+}
+
+\newcommand{\SHORTCAPi}{%
+ The dazed brown fox etc.}
+
+\newcommand*{\MARKER}
+ {\noindent\strut\vrule\hrulefill~text area
+ (\ifthenelse{\isodd{\thepage}}{odd}{even} page)~\hrulefill\vrule%
+ \marginpar{\strut\vrule\hrulefill~margin area~\hrulefill\vrule}}
+
+\endinput
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}
diff --git a/macros/latex/contrib/sidecap/sc-test2.tex b/macros/latex/contrib/sidecap/sc-test2.tex
new file mode 100644
index 0000000000..b16d0eea83
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test2.tex
@@ -0,0 +1,89 @@
+
+% `sc-test2.tex', part of the LaTeX package `sidecap'
+% 2003-02-21
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\documentclass[12pt,a4paper,twocolumn,twoside,draft]{article}
+\usepackage[bf,footnotesize]{caption2}
+%\usepackage[innercaption]{sidecap}
+\usepackage[outercaption,raggedright]{sidecap}
+
+\input{sc-test-common}
+
+\begin{document}
+\section*{\centering The \texttt{sidecap} package (two~column~layout)}
+
+In this document, we used the following options of the \textsf{sidecap} package:
+%
+\begin{verbatim}
+ \usepackage
+ [outercaption,raggedright]
+ {sidecap}
+\end{verbatim}
+%
+Note that fig.~\ref{fig:B} is an \verb|SCfigure*| environment.
+The \textsf{sidecap} package inherits the standard \LaTeX\ ``feature''
+that two-column floats and one-column floats may be out of order.
+
+\begin{figure}[bhp]
+ \centering
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:A}%
+\end{figure}
+
+\begin{SCfigure*}[50] % [bhp]
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:B}%
+\end{SCfigure*}
+
+\begin{SCfigure}[1.2][bhp]
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:C}%
+\end{SCfigure}
+
+\begin{SCfigure}[][bhp]
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:D}%
+\end{SCfigure}
+
+\begin{SCtable}
+ \caption[\SHORTCAPi]{\CAPi}\label{tab:A}%
+ \FIG[1cm]{1}%
+\end{SCtable}
+
+\begin{table}
+ \centering
+ \caption[\SHORTCAPi]{\CAPii}\label{tab:B}%
+ \TABi%
+\end{table}
+
+\begin{SCtable}
+ \caption[\SHORTCAPi]{\CAPi\CAPii}\label{tab:C}%
+ \TABi%
+\end{SCtable}
+
+%----------------------------
+
+\begin{SCfigure}[50][b]
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:E}%
+\end{SCfigure}
+
+\clearpage
+
+
+\begin{SCfigure}[50][b]
+ \FIG[1cm]{1}%
+ \caption[\SHORTCAPi]{\CAPi}\label{fig:F}%
+\end{SCfigure}
+
+
+\end{document}
+
+
+
+
+
+
+
+
diff --git a/macros/latex/contrib/sidecap/sc-test3.tex b/macros/latex/contrib/sidecap/sc-test3.tex
new file mode 100644
index 0000000000..1b0de01b20
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test3.tex
@@ -0,0 +1,54 @@
+
+% `sc-test3.tex', part of the LaTeX package `sidecap'
+% 2003-02-21
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\documentclass{article}
+
+\usepackage{sidecap}
+
+\input{sc-test-common}
+
+\begin{document}
+
+\section*{\centering The \texttt{sidecap} package
+ (changed caption alignment)}
+
+\begin{SCfigure}[][hb]
+ \FIG{1}
+ \caption{normal `SCfigure'}
+\end{SCfigure}
+
+\begin{SCtable}[][b]
+ \TABi
+ \caption{normal `SCtable'}
+\end{SCtable}
+
+\iffalse% the old way
+\makeatletter
+ \renewenvironment{SCfigure}{\SC@float[t]{figure}}
+ {\endSC@float}
+ \renewenvironment{SCfigure*}{\SC@dblfloat[t]{figure}}
+ {\endSC@dblfloat}
+ \renewenvironment{SCtable}{\SC@float[b]{table}}
+ {\endSC@float}
+ \renewenvironment{SCtable*}{\SC@dblfloat[b]{table}}
+ {\endSC@dblfloat}
+\makeatother
+\fi
+
+% the new way
+\sidecaptionvpos{figure}{t}
+\sidecaptionvpos{table}{b}
+
+\begin{SCfigure}[][hb]
+ \FIG{1}
+ \caption{`SCfigure' modified\dots}
+\end{SCfigure}
+
+\begin{SCtable}[][b]
+ \TABi
+ \caption{`SCtable' modified\dots}
+\end{SCtable}
+
+\end{document}
diff --git a/macros/latex/contrib/sidecap/sc-test4.tex b/macros/latex/contrib/sidecap/sc-test4.tex
new file mode 100644
index 0000000000..1061deed9e
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test4.tex
@@ -0,0 +1,76 @@
+
+% `sc-test4.tex', part of the LaTeX package `sidecap'
+% 2003-02-14
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\errorcontextlines\maxdimen
+
+\listfiles
+\documentclass[12pt,draft,a4paper,twoside]{article}
+\usepackage[bf,footnotesize]{caption2}
+\usepackage[outercaption,wide,raggedright]{sidecap}
+%\usepackage[outercaption,wide,raggedright]{sidecap}
+%\usepackage[innercaption,wide]{sidecap}
+
+\usepackage[verbose]{geometry}[2002/07/04]
+\geometry{includemp,marginpar=5cm,hmarginratio={2:3},right=3cm}
+
+\input{sc-test-common}
+
+\begin{document}
+
+\tracingall \tracingonline0
+
+\section*{The \texttt{sidecap} package (package option \texttt{wide} and
+ the wide environment)}
+
+\begin{SCfigure}[50][h]
+ \FIG{1}\caption{\CAPi}%
+\end{SCfigure}
+
+\vfill
+\MARKER
+\vfill
+
+\begin{figure}[b]
+ \begin{wide}
+ \FIG{2}\caption{XYZ \CAPi}%
+ \end{wide}
+\end{figure}
+
+\clearpage
+
+\begin{SCfigure}[50][h]
+ \FIG{1}\caption{\CAPi}%
+\end{SCfigure}
+
+\vfill
+\MARKER
+\vfill
+
+\begin{figure}[b]
+ \begin{wide}
+ \FIG{2}\caption{\CAPi}%
+ \end{wide}
+\end{figure}
+
+\clearpage
+
+\begin{SCfigure}[.9][t]
+ \FIG{1}\caption{\CAPi}%
+\end{SCfigure}
+
+\MARKER
+
+\begin{wide}
+ \FIG{2}
+\end{wide}
+
+\vfill
+
+\end{document}
+
+
+
+
+
diff --git a/macros/latex/contrib/sidecap/sc-test5.tex b/macros/latex/contrib/sidecap/sc-test5.tex
new file mode 100644
index 0000000000..8029eaa66b
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test5.tex
@@ -0,0 +1,41 @@
+
+% `sc-test5.tex', part of the LaTeX package `sidecap'
+% 2003-02-14
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\listfiles
+\documentclass[12pt,draft,a4paper,twoside]{article}
+\usepackage[bf,footnotesize]{caption2}
+%\usepackage[margincaption,raggedright]{sidecap}
+%\usepackage[margincaption,raggedright,innerbody]{sidecap}
+\usepackage[margincaption,ragged,centerbody]{sidecap}
+
+\usepackage{geometry}[2002/07/04]
+\geometry{includemp,marginpar=5cm,hmarginratio={2:3},right=3cm}
+
+\input{sc-test-common}
+
+\begin{document}
+
+\section*{The \texttt{sidecap} package (package option \texttt{margincaption})}
+
+\begin{SCfigure}[][bh]
+ \FIG{1}\caption{\CAPi}%
+\end{SCfigure}
+
+\MARKER
+
+\clearpage
+
+\begin{SCfigure}
+ \FIG{1}\caption{\CAPi}%
+\end{SCfigure}
+
+\MARKER
+
+\end{document}
+
+
+
+
+
diff --git a/macros/latex/contrib/sidecap/sc-test6.tex b/macros/latex/contrib/sidecap/sc-test6.tex
new file mode 100644
index 0000000000..be54408483
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sc-test6.tex
@@ -0,0 +1,89 @@
+
+% `sc-test6.tex', part of the LaTeX package `sidecap'
+% 2003-02-21
+% Rolf Niepraschk and Hubert G\"a\ss{}lein -- niepraschk@ptb.de
+
+\listfiles
+\documentclass[a4paper]{article}
+
+%\usepackage[colorgrid,gridunit=pt]{eso-pic}
+
+\usepackage{sidecap}
+%\usepackage[ragged]{sidecap}
+
+\input{sc-test-common}
+
+\begin{document}
+
+\section*{The \texttt{sidecap} package
+ (text in body of floats)}
+
+If you need to put text inside the body of a floating
+environment, you'll have to put it inside a \verb|\parbox|
+or a \verb|minipage| environment.
+(This is necessary due to the way the \textsf{sidecap} package
+grabs the body of the float.)
+
+For example, the first pair of floats in this document
+(fig.~\ref{fig:wrong} and tab.~\ref{tab:wrong})
+contain essentially the following:
+%
+\begin{verbatim}
+ \begin{minipage}{0.5\textwidth}%
+ text text ... text text.
+ \end{minipage}%
+\end{verbatim}
+%
+Note that the alignment of the caption with respect to text in the body
+is wrong.
+
+\begin{SCfigure}[][hb]
+ \FIG[0.078\textwidth]{3}
+ \caption{`SCfigure' \CAPi}
+ \label{fig:wrong}
+\end{SCfigure}
+
+\begin{SCtable}[][hb]
+ \FIG[0.078\textwidth]{3}
+ \caption{`SCtable' \CAPi}
+ \label{tab:wrong}
+\end{SCtable}
+
+To fix this problem, you'll have to use some extra effort.
+
+\clearpage
+
+For example, the second pair of floats
+(fig.~\ref{fig:right} and tab.~\ref{tab:right})
+contain essentially the following:
+%
+\begin{verbatim}
+ \begin{minipage}{0.5\textwidth}%
+ \strut
+ text text ... text text.
+ \unskip\strut
+ \end{minipage}%
+\end{verbatim}
+%
+Now the caption is properly aligned with the first or last line of
+the text in the float's body.
+
+\begin{SCfigure}[][hb]
+ \FIG[0.078\textwidth]{4}
+ \caption{`SCfigure' \CAPi}
+ \label{fig:right}
+\end{SCfigure}
+
+\begin{SCtable}[][hb]
+ \FIG[0.078\textwidth]{4}
+ \caption{`SCtable' \CAPi}
+ \label{tab:right}
+\end{SCtable}
+
+Still, there is a flaw in the captions:
+Due to the small \verb|\linewidth| the linebreaking and\slash or
+word spacing may be awful.
+Use one of the \texttt{raggedright}, \texttt{raggedleft}, or
+\texttt{ragged} package options.
+
+\end{document}
diff --git a/macros/latex/contrib/sidecap/sidecap.dtx b/macros/latex/contrib/sidecap/sidecap.dtx
new file mode 100644
index 0000000000..f42fa75e45
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sidecap.dtx
@@ -0,0 +1,789 @@
+% \iffalse
+%% File: sidecap.dtx
+%%
+%
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{sidecap}
+%<package> [2003/06/06 v1.6f SideCap Package (RN/HjG)]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{sidecap}
+\GetFileInfo{sidecap.sty}
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+\begin{document}
+ \DocInput{sidecap.dtx}
+\end{document}
+%</driver>
+%
+% Copyright 1997--2003 Rolf Niepraschk and Hubert Gaesslein.
+% This program can be redistributed and/or modified under the terms
+% of the LaTeX Project Public License Distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt; either
+% version 1 of the License, or any later version.
+%
+% \fi
+%
+% \CheckSum{696}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \iffalse meta-comment
+% ===================================================================
+% @LaTeX-package-file{
+% author = {Rolf Niepraschk, Hubert G\"{a}\ss{}lein}
+% version = "1.6e",
+% date = "04 May 2003",
+% filename = "sidecap.sty",
+% email = "niepraschk@ptb.de (INTERNET)",
+% codetable = "ISO/ASCII",
+% keywords = "LaTeX2e, sideways caption, \SCfigure, \SCtable",
+% supported = "yes",
+% docstring = "LaTeX package which defines new environments
+% for easy typesetting sideways captions and
+% wide floats".
+% }
+% ===================================================================
+% \fi
+%
+% \MakeShortVerb{\|}
+% \setlength\parindent{0pt}
+%
+% ^^A \CodelineIndex Fehler !!!
+% ^^A \RecordChanges kein Fehler !!!
+%
+% \changes{v1.0 (RN)}{1997/01/04}{New}
+% \changes{v1.1 (RN/HjG)}{1997/05/01}{First public version}
+% \changes{v1.2 (HjG)}{1998/01/29}{Proposal for amendments}
+% \changes{v1.3 (RN/HjG)}{1998/01/29}{Unsuccessful attempt to make
+% star-forms work}
+% \changes{v1.4c (HjG)}{1998/06/05}{Successful (?) attempt to make
+% star-forms work, plus some amendments}
+% \changes{v1.4d (RN)} {1998/06/05}{New (LPPL) license}
+% \changes{v1.5d (RN/HjG)}{2000/03/16}{Slight amendments to documentation.}
+% \changes{v1.5h (RN/HjG)}{2002/05/24}{Improved compatibility with package
+% hyperref.}
+% \changes{v1.5h (RN/HjG)}{2002/05/24}{Environment wide does the right thing
+% now outside SCfloat environments.}
+%
+% \changes{v1.6d (RN/HjG)}{2002/09/13}{Simplify internal calculations
+% using primitive operators where possible and useful,
+% saving tokens (suggested by Frank Mittelbach.}
+%
+% \IndexPrologue{^^A
+% \section*{Index}^^A
+% \markboth{Index}{Index}^^A
+% Numbers written in \emph{italic} refer to the page where the
+% corresponding entry is described, the ones
+% \underline{underlined} to the definition, the rest to the places
+% where the entry is used.}
+%
+%
+% ^^A -----------------------------
+%
+% \title{\unskip
+% The \textsf{sidecap} package^^A
+% }
+% \author{Rolf Niepraschk {\normalsize (\texttt{niepraschk@ptb.de})}\and
+% Hubert G\"a{\ss}lein}
+
+% \date{\fileversion\ -- \filedate}
+% \maketitle
+%
+%
+% ^^A -----------------------------
+%
+%
+% \begin{abstract}
+% This package defines the new environments |SCfigure| and |SCtable|,
+% analogous to |figure| and |table|, which make it easy to
+% typeset captions sideways.
+%
+% Additionally, a |wide| environment is defined; it allows to use
+% the margin area, e.\,g., for figures wider than |\textwidth|.
+%
+% \iffalse
+% (???)
+% Support for other types of floating environments is provided,
+% e.\,g., as available by the |newfloat| package.
+% \fi
+% \end{abstract}
+%
+% \pagestyle{headings}
+%
+% ^^A -----------------------------
+%
+% ^^A \tableofcontents
+%
+% ^^A -----------------------------
+%
+% \section{Introduction}
+%
+% In some cases it may be useful to typeset the caption aside the figure or
+% the table. For this purpose the package \textsf{sidecap} defines the new
+% environments |SCfigure| and |SCtable|. The figure or the table and the
+% caption are put into two minipages that are positioned side by side and
+% centered as a whole. The space between the minipages is |\sidecaptionsep|. The
+% correct positioning with respect to left and right pages requires at least
+% two compilation runs.
+%
+% ^^A -----------------------------
+%
+% \section{Usage}
+%
+% |\usepackage[|\meta{option}|]{sidecap}|
+%
+% \smallskip
+%
+% |\begin{SCtable} [|\meta{relwidth}|][|\meta{float}|] ... |
+% |\end{SCtable}|
+%
+% |\begin{SCfigure} [|\meta{relwidth}|][|\meta{float}|] ... |
+% |\end{SCfigure}|
+%
+% \smallskip
+% |\begin{SCtable*} [|\meta{relwidth}|][|\meta{float}|] ... |
+% |\end{SCtable*}|
+%
+% |\begin{SCfigure*}[|\meta{relwidth}|][|\meta{float}|] ... |
+% |\end{SCfigure*}|
+%
+% \medskip
+% \begin{center}
+% \begin{tabular}{r@{~}p{.75\linewidth}}
+% \meta{option} -- & |outercaption| (default): Caption appears left on
+% left pages and right on right
+% pages. \\[.25\baselineskip]
+% & |innercaption|: Caption appears right on left pages
+% and left on right pages.\\[.25\baselineskip]
+% & |leftcaption|, |rightcaption|: Caption is always on
+% the left or right, respectively.\\[.25\baselineskip]
+% & |wide|: The floating objects may extend into the
+% margin area.
+% \\[.25\baselineskip]
+% & |raggedright|, |raggedleft|, |ragged|: Better
+% justification for small captions.
+% The \textsf{ragged2e} package is used if available.
+% \\[.5\baselineskip]
+% \meta{relwidth} -- & optional; caption width relative to the width of the
+% figure or table. A large value (e.g., 50) reserves
+% the maximum width that is possible.
+% Default is |\sidecaptionrelwidth|
+% (which is initialized to 1.0).\\[.5\baselineskip]
+% \meta{float} -- & optional; like the floating position parameter of the
+% original table\slash figure environments.
+% Default is |tbp|.
+% \end{tabular}
+% \end{center}
+%
+% \medskip
+% |\begin{wide} ... \end{wide}|
+%
+% The |wide| environment may be used inside |figure| and |table|
+% environments as well as in the normal text.
+%
+% ^^A -----------------------------
+%
+% \section{Required packages}
+%
+% This package requires the standard \LaTeX\ package \textsf{ifthen}.
+%
+% ^^A -----------------------------
+%
+% \section{Supported packages}
+%
+% This package is compatible with \LaTeX\ package \textsf{hyperref}
+% (tested with version 6.71v as of 2001/11/12).
+% If the |raggedright| or |raggedleft| or |ragged| package option has
+% been given, then captions will be set with ragged margin.
+% The \textsf{ragged2e} package will be used if it can be found.
+%
+% \iffalse
+% This package supports the \LaTeX\ package \textsf{newfloat},
+% coming soon \dots\ (?)
+% \fi
+%
+% ^^A -----------------------------
+%
+% \StopEventually{^^A
+% \PrintChanges\PrintIndex
+% ^^A Make sure that the index is not printed twice
+% ^^A (ltxdoc.cfg might have a second \PrintIndex command)
+% \let\PrintChanges\relax
+% \let\PrintIndex\relax
+% }
+%
+% ^^A -----------------------------
+%
+% \section{The implementation}
+%
+% \subsection{Register allocation and auxiliary macros}
+%
+% \begin{macrocode}
+%<*package>
+
+\RequirePackage{ifthen}
+
+\@ifdefinable{\SC@BOXWD}{\newdimen\SC@BOXWD}
+\@ifdefinable{\SC@CAPWD}{\newdimen\SC@CAPWD}
+% 2 noetig ???
+\@ifdefinable{\SC@tempdima}{\newdimen\SC@tempdima}
+\@ifdefinable{\SC@tempdimb}{\newdimen\SC@tempdimb}
+\newcounter{SC@C} \newsavebox{\SC@BOX} \newcommand*{\SC@FLOAT}{}
+\newcommand*{\SC@IDENT}{SC@\number\value{SC@C}}
+\newcommand*\SC@label[1]{\gdef\SC@LABtext{#1}\ignorespaces}
+\newcommand*\SC@orig@caption{} \newcommand*\SC@orig@label{}
+\newcommand*\sidecaptionsep{} \newcommand*\SC@pageref{}
+\edef\sidecaptionsep{\the\marginparsep}
+\newcommand*\sidecaptionrelwidth{1.0}
+\newcommand*\sidecaptionvpos[2]{% 2002/08/31
+ \@namedef{SC@#1@vpos}{#2}%
+}
+
+\newboolean{SC@wide}
+\def\SC@widefalse{\global\let\ifSC@wide\iffalse}
+\def\SC@widetrue {\global\let\ifSC@wide\iftrue}
+
+ % Kann man auf dieses Laengenregister verzichten? Nein! (RN) <****>
+
+\newcommand*\SC@calcwidths[1]{%
+ \SC@tempdima#1\relax
+ \SC@BOXWD\wd\SC@BOX
+ \SC@CAPWD\SC@fraction\SC@BOXWD
+ \@tempdima\SC@BOXWD
+ \advance\@tempdima\SC@CAPWD
+ \advance\@tempdima\sidecaptionsep
+ \ifdim\@tempdima>\SC@tempdima
+ \advance\SC@CAPWD-\@tempdima
+ \advance\SC@CAPWD\SC@tempdima
+ \fi
+ \SC@tempdimb\@tempdima
+}
+
+%\newcommand*{\isSC@WIDEi}[2]{#2} %default: false
+%\newcommand*{\isSC@WIDEii}[2]{#2} %default: false
+\newcommand*{\isSC@WIDEi}[2]{\ifSC@wide#1\else#2\fi} %default: false
+\newcommand*{\isSC@WIDEii}[2]{\ifSC@wide#1\else#2\fi} %default: false
+
+%\newcommand*{\isSC@First}[2]{#1} %default: true
+
+\newcommand*\SC@justify{}
+\newcommand*\SC@justify@caption{}
+\newcommand*\SC@justify@body{}
+
+\newboolean{SC@origRagged} \setboolean{SC@origRagged}{false} %% ???
+% \end{macrocode}
+% \begin{macro}{\SC@SaveCommands}
+% \changes{v1.5e (RN)}{2001/11/10}{\cmd\SC@AtFirstCall:
+% Saves the old meaning
+% of \cmd\caption\ and \cmd\label\ at first call of some SC macros
+% (compatibility with `hyperref').}
+% \changes{v1.5h (RN/HjG)}{2002/05/24}{Renamed \cmd\SC@AtFirstCall\ ^^A
+% to \cmd\SC@SaveCommands\ and changed definition.}
+% \begin{macrocode}
+\newcommand*{\SC@SaveCommands}{%
+ \let\SC@orig@caption=\caption \let\SC@orig@label=\label%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\SC@SaveCommands % necessary? or even wrong?
+% \end{macrocode}
+%
+% \subsection{Package \textsf{hyperref} compatibility}
+%
+% \changes{v1.5d (RN/HjG)}{2000/02/04}{Compatibility with `hyperref',
+% thanks to Heiko Oberdiek}
+% Note: The |\pageref| doesn't work with \textsf{hyperref} \dots \mbox{:-(}
+% \changes{v1.6 (RN/HjG)}{2002/06/07}{%
+% Oneside mode had been forgotten ;-)}%
+% \begin{macrocode}
+\if@twoside
+ \newcommand*{\isSC@ODD}[2]{%
+ \ifthenelse{\isodd{\SC@pageref{\SC@IDENT}}}{#1}{#2}}
+\else
+ \newcommand*{\isSC@ODD}[2]{#1}%
+\fi
+% \end{macrocode}
+%
+%
+% \subsection{Option processing}
+%
+% \begin{macrocode}
+\DeclareOption{innercaption}{%
+ \renewcommand*{\SC@FLOAT}[2]{%
+ \isSC@ODD{{#1}\hspace{\sidecaptionsep}{#2}} {{#2}\hspace{\sidecaptionsep}{#1}}}
+ \renewcommand*\SC@justify@caption{%
+ \isSC@ODD{\RaggedLeft}{\RaggedRight}}
+}
+
+\DeclareOption{outercaption}{%
+ \renewcommand*{\SC@FLOAT}[2]{%
+ \isSC@ODD{{#2}\hspace{\sidecaptionsep}{#1}} {{#1}\hspace{\sidecaptionsep}{#2}}}
+ \renewcommand*\SC@justify@caption{%
+ \isSC@ODD{\RaggedRight}{\RaggedLeft}}
+}
+
+\DeclareOption{rightcaption}{%
+ \renewcommand*{\SC@FLOAT}[2]{{#2}\hspace{\sidecaptionsep}{#1}}
+ \def\SC@justify@caption{\RaggedRight}%
+}
+
+\DeclareOption{leftcaption}{%
+ \renewcommand*{\SC@FLOAT}[2]{{#1}\hspace{\sidecaptionsep}{#2}}
+ \def\SC@justify@caption{\RaggedLeft}%
+}
+% \end{macrocode}
+% \changes{v1.5a (RN)}{1999/07/18}{New Option and environment `wide'; some
+% small changes}
+% \begin{macrocode}
+\DeclareOption{wide}{%
+ \renewcommand*{\isSC@WIDEi}[2]{\if@twocolumn #2\else #1\fi}% ???
+ \renewcommand*{\isSC@WIDEii}[2]{#1}}
+% \end{macrocode}
+% These `ragged\dots' options should stay here, behind the `\dots caption' options!
+% \changes{v1.5b (RN)}{1999/10/31}{New Option `raggedright' as suggested by
+% James Kilfiger (mailto:mapdn@csv.warwick.ac.uk)}
+% \begin{macrocode}
+\DeclareOption{raggedright}{%
+ \def\SC@justify{\RaggedRight}}
+% \end{macrocode}
+% \changes{v1.5f (RN)}{2002/01/13}{New option `raggedleft'}
+% \begin{macrocode}
+\DeclareOption{raggedleft}{%
+ \def\SC@justify{\RaggedLeft}}
+% \end{macrocode}
+% \changes{v1.5g (RN)}{2002/01/18}{New option `ragged'}
+% \begin{macrocode}
+\DeclareOption{ragged}{%
+ \def\SC@justify{\SC@justify@caption}% \let ?
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption{origragged}{\setboolean{SC@origRagged}{true}}
+% \end{macrocode}
+%
+%
+% \changes{v1.6 (RN/HjG)}{2002/06/07}{%
+% New option `margincaption' added.}%
+% \begin{macrocode}
+\DeclareOption{margincaption}{%
+ \ds@outercaption\ds@outerbody\ds@wide
+ \let\ds@innercaption\@empty
+ \let\ds@leftcaption\@empty
+ \let\ds@rightcaption\@empty
+ \def\SC@calcwidths#1{%
+ \SC@tempdimb#1\relax
+ \SC@BOXWD\SC@tempdimb % *-form !!! ???
+ \advance\SC@BOXWD-\marginparwidth
+ \advance\SC@BOXWD-\marginparsep
+ \SC@CAPWD\marginparwidth
+ }%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\DeclareOption{innerbody}{%
+ \def\SC@justify@body{%
+ \isSC@ODD{\RaggedRight}{\RaggedLeft}}
+}
+
+\DeclareOption{outerbody}{%
+ \def\SC@justify@body{%
+ \isSC@ODD{\RaggedLeft}{\RaggedRight}}
+}
+
+\DeclareOption{centerbody}{%
+ \def\SC@justify@body{\Centering}
+}
+
+\DeclareOption{rightbody}{%
+ \def\SC@justify@body{\RaggedLeft}%
+}
+
+\DeclareOption{leftbody}{%
+ \def\SC@justify@body{\RaggedRight}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExecuteOptions{outercaption}
+%%\InputIfFileExists{sidecap.cfg}{}{} % hier ? % 2002/06/14
+\ProcessOptions\relax
+% \end{macrocode}
+% \changes{v1.6 (RN)}{2002/06/09}{``Smart'' loading of package ragged2e.
+% More simple code for hyperref compatibilty (\cmd\hypergetpageref).}
+% \changes{v1.6f (RN/HjG)}{2003/06/06}{Test for presence of package babel
+% (\cmd\org@pageref).}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifSC@origRagged\else
+ \@ifpackageloaded{ragged2e}{}%
+ {%
+ \IfFileExists{ragged2e.sty}{%
+ \RequirePackage[NewParameters]{ragged2e}}%
+ {%
+ \PackageWarningNoLine{sidecap}{%
+ Package `ragged2e' not found -- expect bad formatting}%
+ }%
+ }
+ \fi
+ \@ifundefined{RaggedRight}%
+ {%
+ \let\RaggedLeft\raggedleft
+ \let\RaggedRight\raggedright
+ \let\Centering\centering
+ }{}
+ \@ifpackageloaded{hyperref}%
+ {\let\SC@pageref=\hypergetpageref}%
+ {%
+ \@ifpackageloaded{babel}%
+ {\let\SC@pageref=\org@pageref}%
+ {\let\SC@pageref=\pageref}%
+ }
+}
+% \end{macrocode}
+%
+%
+% \subsection{User-level macros (environments)}
+%
+% \begin{environment}{SCfigure}
+% Simply passes the first (optional) parameter and the required one,
+% in this case `figure', to |SC@float|\,.
+% The figure caption should be bottom aligned.
+% \begin{macrocode}
+
+%\newcommand*\SCfigureVpos{b}% 2002/06/14
+\@ifdefinable\SC@figure@vpos{\def\SC@figure@vpos{b}}
+\newenvironment{SCfigure}{\SC@float[\SC@figure@vpos]{figure}}{\endSC@float}
+\newenvironment{SCfigure*}{\SC@dblfloat[\SC@figure@vpos]{figure}}{\endSC@dblfloat}
+
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{SCtable}
+% Simply passes the first (optional) parameter and the required one,
+% in this case `table', to |SC@float|\,.
+% The table caption should be top aligned.
+% \begin{macrocode}
+
+%\newcommand*\SCtableVpos{t}% 2002/06/14
+\@ifdefinable\SC@table@vpos{\def\SC@table@vpos{t}}
+\newenvironment{SCtable}{\SC@float[\SC@table@vpos]{table}}{\endSC@float}
+\newenvironment{SCtable*}{\SC@dblfloat[\SC@table@vpos]{table}}{\endSC@dblfloat}
+
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{wide}
+% This is an environment that allows to extend the width of the
+% text body (or of a floating environment) by using the margin space.
+%
+% It shouldn't be used in twocolumn text.
+% \begin{macrocode}
+%
+\newenvironment{wide}%
+{%
+ \@parboxrestore% 2002/06/14 -- SW-Arch.: wozu? 2002/08/24
+ \advance\linewidth\marginparwidth
+ \advance\linewidth\marginparsep
+ \ifx\label\SC@label
+%<+debug> \typeout{WIDE: inside SCfloat}%
+ \SC@widetrue
+ \else
+%<+debug> \typeout{WIDE: outside SCfloat}%
+ \begin{lrbox}\SC@BOX % \begin necessary: --> \@noitemerr
+ \minipage\linewidth
+ \fi
+}%
+{%
+ \ifx\label\SC@label
+%<+debug>
+\typeout{WIDE: inside SCfloat}%
+ %\renewcommand*{\isSC@WIDEi}[2]{\if@twocolumn ##2\else ##1\fi}%
+ %\renewcommand*{\isSC@WIDEii}[2]{##1}%
+ %\let\isSC@WIDE\isSC@WIDEi
+ \else
+%<+debug>
+\typeout{WIDE: outside SCfloat}%
+ \endminipage
+ \end{lrbox}% \end necessary: --> \@noitemerr
+ \global\advance\c@SC@C\@ne
+ \SC@orig@label{\SC@IDENT}% nicht \ref... !!!
+ \trivlist \item\relax
+ \isSC@ODD{\def\SC@hpos{l}}{\def\SC@hpos{r}}%
+%<+debug>
+\typeout{WIDE: \string\linewidth=\the\linewidth}%
+ \noindent\makebox[\textwidth][\SC@hpos]{\copy\SC@BOX}% \usebox{\SC@BOX}
+ \endtrivlist
+ \fi
+}
+
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \subsection{Internal macros}
+%
+% \subsubsection{Collecting arguments}
+%
+% The new internal float environment, similar\slash analogous to
+% \LaTeX's |@float| environment.
+%
+% \smallskip
+% Syntax:
+% |\SC@float[|\meta{vpos}|]{|\meta{name}|}[|\meta{relwidth}|][|\meta{fps}|]|
+%
+% \begin{itemize}
+% \item
+% Parameter \meta{vpos} (optional) is the vertical positioning of the
+% caption.
+% \item
+% Parameter \meta{name} (required) is the name of the `original' \LaTeX\
+% floating environment (e.g., `figure' or `table').
+% \iffalse
+% ; or one defined with the
+% |newfloat| package.
+% \fi
+% \item
+% Parameter \meta{relwidth} (optional) is the desired relative width of the
+% caption.
+% \item
+% Parameter \meta{fps} (optional) is the usual \LaTeX\ float positioning
+% specifier.
+% \end{itemize}
+%
+% The usual `cascading' programming style is applied
+% (cf.\ \LaTeX's |\@float|).
+%
+% \begin{macro}{\SC@float}
+% Initially, the first optional parameter is checked for.
+% \begin{macrocode}
+\def\SC@float{\SC@SaveCommands\@ifnextchar[\SC@xfloat{\SC@xfloat[c]}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SC@xfloat}
+% Then the first and second parameters are consumed and the third one is
+% checked for.
+% \begin{macrocode}
+\def\SC@xfloat[#1]#2{\@ifnextchar[%
+ {\SC@yfloat{#1}{#2}}%
+ {\SC@zfloat{#1}{#2}{\sidecaptionrelwidth}[\@nameuse{fps@#2}]}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SC@yfloat}
+% Again, the fourth (and last) parameter is checked for.
+% \begin{macrocode}
+\def\SC@yfloat#1#2[#3]{\@ifnextchar[%
+ {\SC@zfloat{#1}{#2}{#3}}%
+ {\SC@zfloat{#1}{#2}{#3}[\@nameuse{fps@#2}]}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Capturing the float's contents}
+%
+% \begin{macro}{\SC@zfloat}
+% Finally, here is the macro that does all the work.
+% \begin{macrocode}
+\def\SC@zfloat#1#2#3[#4]{%
+ \def\SC@vpos{#1}%
+ \expandafter\edef\csname fps@#2\endcsname{#4}%
+ \def\SC@captype{#2}%
+ \ifx#3\@empty\def\SC@fraction{1}\else\def\SC@fraction{#3}\fi%
+% \end{macrocode}
+% The |\caption| and |\label| commands must be redefined.
+% \begin{macrocode}
+ \let\SC@CAPtext\@empty \let\SC@OPTCAPtext\@empty \let\SC@LABtext\@empty%
+ \renewcommand\caption[2][]{\gdef\SC@OPTCAPtext{##1}%
+ \gdef\SC@CAPtext{##2}\ignorespaces}% \SC@justify
+ \let\label=\SC@label
+ \@namedef{fnum@#2}{\mbox{\@nameuse{#2name}~\@nameuse{the#2}}}% caption2 ?
+% \end{macrocode}
+% Save the figure or table (or whatever) in a box.
+% \begin{macrocode}
+ \SC@widefalse
+ \begin{lrbox}\SC@BOX % \begin necessary: --> \@noitemerr
+ %%% \strut
+}%
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SC@dblfloat}
+% Analogous to \LaTeX's |\@dblfloat|.
+% \begin{macrocode}
+\def\SC@dblfloat{%
+ \SC@SaveCommands%
+ \if@twocolumn\let\reserved@a\SC@dbflt\else\let\reserved@a\SC@float\fi
+ \reserved@a}
+\def\SC@dbflt{\SC@float}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Output the float's contents}
+%
+% \begin{macro}{\endSC@float}
+% Outputs the figure or table (or whatever) and the caption.
+% \begin{macrocode}
+\def\endSC@float{%
+ %%% \strut
+ \end{lrbox}% \end necessary: --> \@noitemerr
+%<+debug> \typeout{onecolumn}%
+ \let\isSC@WIDE\isSC@WIDEi%
+ \def\@FLOAT{\@float}\def\end@FLOAT{\end@float}%
+ \isSC@WIDE%
+ {\@tempdima\textwidth % \columnwidth ???
+ \advance\@tempdima\marginparwidth
+ \advance\@tempdima\marginparsep}%
+ {\@tempdima\columnwidth}%
+%<+debug> \typeout{endSC@float: \string\@tempdima=\the\@tempdima}%
+ \endSC@FLOAT\@tempdima}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endSC@dblfloat}
+% Ditto for |*|\mbox{-}forms of floats.
+% \begin{macrocode}
+\def\endSC@dblfloat{%
+ \end{lrbox}% \end necessary: --> \@noitemerr
+%<+debug> \typeout{twocolumn}%
+ \let\isSC@WIDE\isSC@WIDEii%
+ \def\@FLOAT{\@dblfloat}\def\end@FLOAT{\end@dblfloat}%
+ \isSC@WIDE%
+ {\@tempdima\textwidth%
+ \advance\@tempdima\marginparwidth
+ \advance\@tempdima\marginparsep}%
+ {\@tempdima\textwidth}%
+%<+debug>
+\typeout{endSC@dblfloat: \string\@tempdima=\the\@tempdima}%
+ \endSC@FLOAT\@tempdima}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\endSC@FLOAT}
+% Sets the caption width. If caption width plus figure\slash table width
+% (plus separation space) is too large then the caption width is set equal
+% to the remaining width.
+% \begin{macrocode}
+\def\endSC@FLOAT#1{%
+ \SC@calcwidths{#1}%
+% \end{macrocode}
+% \begin{macro}{\@FLOAT}
+% Calls the \LaTeX\ float command with the two minipages inside a main minipage.
+% \end{macro}
+% \begin{macrocode}
+ \@FLOAT{\SC@captype}%
+ \abovecaptionskip\z@skip
+ \belowcaptionskip\z@skip
+% \end{macrocode}
+% Creates a label for each figure or table (etc.)\ for later determination if
+% the page is odd or even. The counter |SC@C| must be incremented before.
+% \begin{macrocode}
+ \global\advance\c@SC@C\@ne
+ \SC@orig@label{\SC@IDENT}% nicht \ref... !!!
+% \end{macrocode}
+% \begin{macro}{\isSC@WIDE}
+% ^^A ???
+% \end{macro}
+% \begin{macrocode}
+ \isSC@WIDE%
+ {\ifdim\SC@tempdimb>\textwidth % ???
+ \isSC@ODD{\def\SC@hpos{l}}{\def\SC@hpos{r}}%
+ \else%
+ \def\SC@hpos{c}%
+ \fi
+ \@tempdimc\textwidth}% ???
+ {\@tempdimc\SC@tempdima\def\SC@hpos{c}}%
+% \end{macrocode}
+% ^^A ???
+% \begin{macrocode}
+ \makebox[\@tempdimc][\SC@hpos]{%
+% \end{macrocode}
+% \begin{macro}{\SC@FLOAT}
+% Has two parameters. The first parameter is the minipage with the caption
+% text inside and the last parameter is the minipage with the body of the figure
+% or table ^^A (or whatever floating environment object)
+% inside.
+% \end{macro}
+% \begin{macrocode}
+ \SC@FLOAT%
+ {\minipage[\SC@vpos]{\SC@CAPWD}%
+ %% \nointerlineskip %\offinterlineskip%
+ %% \kern0pt\relax
+ \hrule \@height\z@\@depth\z@ %%% Testen, Doku. (Implementierung) !!!
+ %\show\SC@justify@caption
+%%% \tracingall\tracingonline=0
+ \SC@justify
+ \let\@arrayparboxrestore\relax % sonst Blocksatz! (\@parboxrestore)
+ \let\usecaptionmargin\relax % sonst Pseudo-Blocksatz, nicht-alternierend!
+% \isSC@ODD {\RaggedRight }{\RaggedLeft }
+%%% A B C
+% \isSC@ODD{\typeout{xxxxx ungerade}}{\typeout{xxxxx gerade}}%
+% \def\@makecaption##1##2{##1: ##2\endgraf}%
+% \@parboxrestore
+% \@setminipage
+\iffalse
+% DEBUG:
+ \endgraf
+ \@makecaption{\csname fnum@\SC@captype\endcsname}%
+ {\ignorespaces \SC@CAPtext}%
+ \endgraf
+\else
+ % \ifthenelse{\equal{\SC@OPTCAPtext}{\@empty}}%
+ \ifx\SC@OPTCAPtext\@empty% Noetig?
+% FM: strut needed twice for multiline captions
+ \SC@orig@caption[\SC@CAPtext]%
+ {\strut\ignorespaces\SC@CAPtext\unskip\strut}% \expandafter\protect
+ \else
+% FM: strut needed twice for multiline captions
+% FM: if \SC@CAPtext can contain trailing banks then we also need \unskip
+% FM: (not checked)
+ \SC@orig@caption[\SC@OPTCAPtext]% \expandafter\protect
+ {\strut\ignorespaces\SC@CAPtext\unskip\strut}% \expandafter\protect
+ \fi
+ \unskip% ??? Dok. !!!
+ \ifx\SC@LABtext\@empty\else
+ \SC@orig@label{\SC@LABtext}\fi% \expandafter\protect
+\fi
+%%% X Y Z
+ \hrule \@height\z@\@depth\z@
+ \endminipage}%
+ {\minipage[\SC@vpos]{\SC@BOXWD}%
+ %% \nointerlineskip %\offinterlineskip%
+ %% \kern0pt\relax
+ \hrule \@height\z@\@depth\z@
+ \SC@justify@body
+ \unhbox\SC@BOX % \strut \unhbox/\usebox{\SC@BOX}% TESTEN!
+ % \kern0pt\relax
+ \hrule \@height\z@\@depth\z@
+ \endminipage}%
+ }%
+ \end@FLOAT%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\InputIfFileExists{sidecap.cfg}{}{} % hier ? % 2002/06/14
+%</package>
+% \end{macrocode}
+%
+% ^^A -----------------------------
+%
+% \Finale
diff --git a/macros/latex/contrib/sidecap/sidecap.ins b/macros/latex/contrib/sidecap/sidecap.ins
new file mode 100644
index 0000000000..295b2b6954
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sidecap.ins
@@ -0,0 +1,31 @@
+
+\input docstrip.tex
+\askforoverwritefalse
+\keepsilent
+
+\generate{\file{sidecap.sty}{\from{sidecap.dtx}{package}}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file(s) into a directory searched by TeX.}
+\Msg{*}
+\Msg{* \space\space sidecap.sty}
+\Msg{*}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{* For a list of changes, process the file sidecap.glo by:}
+\Msg{*}
+\Msg{* \space\space makeindex -s gglo.glo -t sidecap.glg -o sidecap.gls sidecap.glo}
+\Msg{*}
+\Msg{* For an index of commands, process the file sidecap.idx by:}
+\Msg{*}
+\Msg{* \space\space makeindex -s gind.ist -t sidecap.ilg -o sidecap.ind sidecap.idx}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+\endbatchfile
+
+%%
+%% End of file `sidecap.ins'.
diff --git a/macros/latex/contrib/sidecap/sidecap.pdf b/macros/latex/contrib/sidecap/sidecap.pdf
new file mode 100644
index 0000000000..5482eef650
--- /dev/null
+++ b/macros/latex/contrib/sidecap/sidecap.pdf
Binary files differ