📄 caption2.dtx.svn-base
字号:
% \iffalse meta-comment% % This is file `caption2.dtx'.% % Copyright (C) 1994-2005 Axel Sommerfeldt (caption@sommerfee.de)% % --------------------------------------------------------------------------% % This work may be distributed and/or modified under the% conditions of the LaTeX Project Public License, either version 1.3% of this license or (at your option) any later version.% The latest version of this license is in% http://www.latex-project.org/lppl.txt% and version 1.3 or later is part of all distributions of LaTeX% version 2003/12/01 or later.% % This work has the LPPL maintenance status "maintained".% % This Current Maintainer of this work is Axel Sommerfeldt.% % This work consists of the files caption.ins, caption.dtx,% caption2.dtx, caption.xml, and anleitung.tex and the derived files% caption.sty, caption2.sty, caption3.sty, and manual.tex.% % \fi% \CheckSum{843}%% \iffalse%<*driver>\NeedsTeXFormat{LaTeX2e}[1994/12/01]\documentclass{ltxdoc}\setlength\parindent{0pt}\setlength\parskip{\smallskipamount}%\ifx\pdfoutput\undefined\else \ifcase\pdfoutput\else \usepackage{mathptmx,courier} \usepackage[scaled=0.90]{helvet} \fi\fi%\usepackage{caption2}[2004/04/16]%%<+driver>\OnlyDescription%\begin{document} \DocInput{caption2.dtx}\end{document}%</driver>% \fi%% \newcommand*{\purerm}[1]{{\upshape\mdseries\rmfamily #1}}% \newcommand*{\puresf}[1]{{\upshape\mdseries\sffamily #1}}% \newcommand*{\purett}[1]{{\upshape\mdseries\ttfamily #1}}% \let\package\puresf\def\thispackage{\package{caption2}}% \let\env\purett \let\opt\purett%% \GetFileInfo{caption2.sty}% \title{The \thispackage\ package\thanks{This package has version number% \fileversion, last revised \filedate.}}% \author{Axel Sommerfeldt\\\texttt{caption@sommerfee.de}}% \date{2005/11/02}% \maketitle%% \changes{v2.0}{ 9 Oct 95}{New experimental version: Many new commands and features}% \changes{v2.0}{ 9 Oct 95}{Support of the longtable package added}% \changes{v2.1}{20 Feb 02}{Revised: New commands and options}% \changes{v2.1}{26 Feb 02}{Adapted to version 2.1 of the subfigure package}% \changes{v2.1a}{12 Nov 03}{Some minor bug fixes and improved compatibility to v2.0}% \changes{v2.1b}{16 Apr 04}{Some minor bug fixes and improved compatibility to v2.0}% \changes{v2.1c}{10 May 04}{Some minor bug fixes and improved compatibility to v2.0}% \changes{v2.1d}{ 3 Oct 05}{Some superfluous brackets removed; warning added}%% \providecommand\LaTeXcomp{The \LaTeX{} Companion}%% \section*{This package is obsolete!}%% The \package{caption2} package used to be an experimental side-version of% the regular \package{caption} package. It was made public as beta test version% without documentation in 1995 because of the demand for new features and% adaptations to other packages like the \package{longtable} and% \package{subfigure} package.%% Even in the next seven years I found no time to reintegrate some of the% well-tried features into the regular \package{caption} package. So I% decided to release a version $2.1$ of the \package{caption2} package in 2002% instead, which included some minor bug fixes and adaptations to the new% version $2.1$ of the \package{subfigure} package. Furthermore I started% to write a documentation for this package, but unfortunately did not get% very far with this\ldots%% In 2003 I finally found some (more) time, so a new regular release $3.0$% of the \package{caption} package could be build with massive help from% Frank Mittelbach\cite{A-W:GMS94} and Steven Cochran\cite{subfigure}.% It was released in December 2003 and superseded the neglected% \package{caption2} package.%% {\small (In parallel, Steven Cochran released the \package{subfig} package which% superseded the \package{subfigure} package.)}%% So please don't use this package for new documents. It's old, it's obsolete% and it starts to begin smell bad!% Please ignore all hints in books or other documents which try to tell you% that the \package{caption2} package should be used instead of the% \package{caption} package -- these hints are outdated since December 2003.%% \section*{How to migrate to the regular \package{caption} package?}%% Usually replacing \package{caption2} by \package{caption} is sufficient% because the \package{caption} package emulates most of the options and% commands of the \package{caption2} package.% If you get some errors or wired results afterwards, please take a closer% look at the \package{caption} package documentation which will hopefully% help you clearing these problems.% If all this should fail you can write me an e-mail asking for help.%% \section*{What will happen to this package?}%% The \package{caption2} package is still some kind of supported, that means% it will be part of future releases and bugs will still be fixed so existing% documents using this package will still compile.% But it will \emph{not} be enhanced in the future or adapted to future versions% of foreign packages.%% This means migrating to the actual \package{caption} package should not be% necessary for old documents.%% \StopEventually{}%% \DoNotIndex{\\,\_,\ ,\@@par}% \DoNotIndex{\@classoptionslist,\@currext,\@currname}% \DoNotIndex{\@ehc,\@ehd,\@empty,\@expandtwoargs}% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined,\@latex@error}% \DoNotIndex{\@namedef,\@nameuse}% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempb,\@tempc}% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}% \DoNotIndex{\p@,\z@}% \DoNotIndex{\active,\addtocounter,\addtolength,\advance}% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\bgroup,\box}% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}% \DoNotIndex{\edef,\egroup,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}% \DoNotIndex{\fi,\footnotesize,\global}% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}% \DoNotIndex{\if,\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}% \DoNotIndex{\ifx,\ignorespaces,\itshape}% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}% \DoNotIndex{\next,\nobreakspace,\noexpand,\noindent,\numberline}% \DoNotIndex{\normalsize,\or,\par,\parbox,\parfillskip}% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\providecommand}% \DoNotIndex{\quad}% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}% \DoNotIndex{\rightskip,\rmfamily}% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}% \DoNotIndex{\small,\string,\space,\strut}% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}% \DoNotIndex{\undefined,\unvbox,\uparrow,\upshape,\usebox,\usepackage}% \DoNotIndex{\vbox,\vsize,\vskip,\wd,\width,\z@skip}% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}% \DoNotIndex{\ProcessOptions,\ProvidesPackage}%% \clearpage%% \section{The Implementation}% \iffalse%<*package>% \fi%% \subsection{Identificaton}%% \begin{macrocode}\NeedsTeXFormat{LaTeX2e}[1994/12/01]\ProvidesPackage{caption2}[2005/10/03 v2.1d Customising captions (AS)]\PackageWarning{caption2}{% THIS PACKAGE IS OBSOLETE, PLEASE USE caption INSTEAD}% \end{macrocode}%% \subsection{Preliminary declarations}%% \begin{macro}{\captionfont}% \begin{macro}{\captionlabelfont}% \cs{captionfont} and \cs{captionlabelfont} will hold the font specifications for the caption.% \begin{macrocode}\newcommand*\captionfont{}\newcommand*\captionlabelfont{}% \end{macrocode}% \end{macro}% \end{macro}%% \begin{macro}{\captionlabeldelim}% \begin{macro}{\captionlabelsep}% \cs{captionlabeldelim} \& \cs{captionlabelsep} will hold the iterim% space between caption label and text.% (\cs{captionlabeldelim} will be typeset within \cs{captionlabelfont},% \cs{captionlabelsep} not.)% \begin{macrocode}\newcommand*\captionlabeldelim{}\newcommand*\captionlabelsep{}% \end{macrocode}% \end{macro}% \end{macro}%% \begin{macro}{\captionsize}% The macro \cs{captionsize} is obsolete since v1.4 of the \textsf{caption} package,% but we still support it to provide backward compatibility.% \begin{macrocode}\newcommand*\captionsize{}% \end{macrocode}% \end{macro}%% \begin{macro}{\captionmargin}% \begin{macro}{\captionwidth}% \begin{macro}{\ifcaptionwidth}% Either \cs{captionmargin} (with specifies an extra margin) or \cs{captionwidth}% (with specifies an explicit width) can be set, therefore we need the flag \cs{ifcaptionwidth}% to determine with parameter we should pay attention to.% \begin{macrocode}\newdimen\captionmargin\newdimen\captionwidth\newif\ifcaptionwidth% \end{macrocode}% \end{macro}% \end{macro}% \end{macro}%% \begin{macro}{\captionindent}% \cs{captionindent} will be used in caption style \texttt{indent} and specifies the indention% after the first line.% \begin{macrocode}\newdimen\captionindent% \end{macrocode}% \end{macro}%% \begin{macro}{\ifcaptionlabel}% \begin{macro}{\ifonelinecaptions}% \begin{macro}{\ifignoreLTcapwidth}% More flags. If \cs{ifcaptionlabel} is not set the caption label should be suppressed;% we need this flag to support the \cs{caption*} command.% If \cs{ifonelinecaptions} is set we support the \LaTeX\ base style 'one line captions',% that means the caption will be typeset centered if it fits to one line.% If \cs{ifignoreLTcapwidth} is set we ignore the \cs{LTcapwidth} of \textsf{longtable}.% \changes{v2.1}{20 Feb 02}{New ifs \cs{ifcaptionlabel} and \cs{ifignoreLTcapwidth}}% \begin{macrocode}\newif\ifcaptionlabel\captionlabeltrue\newif\ifonelinecaptions\newif\ifignoreLTcapwidth% \end{macrocode}% \end{macro}% \end{macro}% \end{macro}%% \begin{macro}{\setcaptionmargin}% \begin{macro}{\setcaptionwidth}% User-friendly commands to set the caption margin resp.\ width.% Note that they additionally set the \cs{ifcaptionwidth} flag.% \begin{macrocode}\newcommand*\setcaptionmargin{% \captionwidthfalse \setlength\captionmargin}\newcommand*\setcaptionwidth{% \captionwidthtrue \setlength\captionwidth}% \end{macrocode}% \end{macro}% \end{macro}%% \begin{macro}{\normalcaptionparams}% \cs{normalcaptionparams} resets all caption related parameters to it's normal default values.% \cs{captionfont} will be set to \cs{captionsize} so setting the obsolete \cs{captionsize} will still work.% Same story with \cs{captiondelim} and the obsolete \cs{captionlabeldelim}.% \changes{v2.1}{29 Jan 02}{New command \cs{normalcaptionparams}}% \begin{macrocode}\newcommand*\normalcaptionparams{% \let\captionsize\@empty \renewcommand*\captionfont{\captionsize}% \let\captionlabelfont\@empty \renewcommand*\captionlabeldelim{:}% \renewcommand*\captionlabelsep{\space}% \setcaptionmargin\z@\setlength\captionindent\z@ \onelinecaptionstrue}% \end{macrocode}% \end{macro}%% \begin{macro}{\caption@eh}% Some commands will produce an error message, use this as help text.% \begin{macrocode}\newcommand*\caption@eh{% If you do not understand this error, please take a closer look\MessageBreak at the documentation of the `caption2' package.\MessageBreak \@ehc}% \end{macrocode}% \end{macro}%% \begin{macro}{\defcaptionstyle}% \begin{macro}{\newcaptionstyle}% \begin{macro}{\renewcaptionstyle}% These macros will define a new caption style. \cs{newcaptionstyle} and \cs{renewcaptionstyle}% will additionally check if the caption style already exists or not.% \begin{macrocode}\newcommand*\defcaptionstyle[1]{% \@namedef{caption@@#1}}%\newcommand*\newcaptionstyle[1]{% \expandafter\ifx\csname caption@@#1\endcsname\relax \expandafter\defcaptionstyle \else \PackageError{caption2}{Caption style `#1' already defined}{\caption@eh}% \expandafter\@gobbletwo \fi {#1}}%\newcommand*\renewcaptionstyle[1]{% \expandafter\ifx\csname caption@@#1\endcsname\relax \PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}% \expandafter\@gobbletwo \else \expandafter\defcaptionstyle \fi {#1}}% \end{macrocode}% \end{macro}% \end{macro}% \end{macro}%% \begin{macro}{\dummycaptionstyle}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -