1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
|
% \iffalse
%% File: sidecap.dtx
%%
%
%<package>\NeedsTeXFormat{LaTeX2e}[2022-06-01]
%<package>\ProvidesPackage{sidecap}[2023/01/24 v1.7a 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--2016 Rolf Niepraschk and Hubert Gaesslein.
% Copyright 2016--.. Rolf Niepraschk
% 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.3 of the License, or any later version.
%
% This work has the LPPL maintenance status "author-maintained".
% \fi
%
% \CheckSum{683}
%
% \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 \~}
%
%
% \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{}
\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{\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).}
% \changes{v1.7a (RN)}{2023/01/24}{%
% Special handling with \cmd\SC@pageref is no longer necessary.}
% \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
}{}
}
% \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
|