caption.dtx.svn-base
来自「moses开源的机器翻译系统」· SVN-BASE 代码 · 共 1,916 行 · 第 1/5 页
SVN-BASE
1,916 行
% \iffalse meta-comment% % This is file `caption.dtx'.% % Copyright (C) 1994-2006 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, and anleitung.tex and the derived files% caption.sty, caption2.sty, caption3.sty, and manual.tex.% % \fi% \CheckSum{1956}%% \iffalse%<*driver>\NeedsTeXFormat{LaTeX2e}[1994/12/01]\documentclass{ltxdoc}\setlength\parindent{0pt}\setlength\parskip{\smallskipamount}%\newcommand\NEWfeature{\NEW{New feature}}\newcommand\NEWdescription{\NEW{New description}}\newcommand\NEW[2]{\hskip 1sp \marginpar{\footnotesize\sffamily\raggedleft#1\\#2}}%\font\manual=manfnt\newcommand\DANGER{\hskip 1sp \marginpar{\raggedleft\textcolor{blue}{{\manual\char127}}}}%\ifx\pdfoutput\undefined\else \ifcase\pdfoutput\else \usepackage{mathptmx,courier} \usepackage[scaled=0.90]{helvet} \addtolength\marginparwidth{15pt} \fi\fi%%\usepackage[french,USenglish]{babel}\usepackage{color,setspace}%%\usepackage{float}\usepackage{longtable}%\usepackage[raggedright]{sidecap}%\usepackage{caption}[2005/08/24]\DeclareCaptionLabelSeparator{endash}{\space\textendash\space}\usepackage{hyperref}%\DeclareCaptionFont{singlespacing}{\singlespacing}\DeclareCaptionFont{onehalfspacing}{\onehalfspacing}\DeclareCaptionFont{doublespacing}{\doublespacing}\DeclareCaptionFont{red}{\color{red}}\DeclareCaptionFont{green}{\color{green}}\DeclareCaptionFont{blue}{\color{blue}}%\DeclareCaptionLabelSeparator{period-newline}{. \\}\DeclareCaptionStyle{period-newline}[labelsep=period]{labelsep=period-newline}\DeclareCaptionStyle{period-newline2}[labelsep=period,justification=centering]{labelsep=period-newline}\DeclareCaptionStyle{period-newline3}[labelsep=period]{labelsep=period-newline,justification=centering}\DeclareCaptionFormat{reverse}{#3#2#1}\DeclareCaptionFormat{llap}{\llap{#1#2}#3\par}\DeclareCaptionLabelFormat{fullparens}{(\bothIfFirst{#1}{ }#2)}\DeclareCaptionLabelSeparator{fill}{\hfill}%\DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em% M\kern.05em A\kern.1em-\kern.1em Script}}%%<+driver>\OnlyDescription%\begin{document} \DocInput{caption.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{caption}}% \let\env\purett \let\opt\purett%% \newcommand*\version[1]{$v#1$}% % \newenvironment{Options}[1]%% {\list{}{\renewcommand{\makelabel}[1]{\texttt{##1}\hfil}%% \settowidth{\labelwidth}{\texttt{#1\space}}%% \setlength{\leftmargin}{\labelwidth}%% \addtolength{\leftmargin}{\labelsep}}}%% {\endlist}% % \newenvironment{Example}%% {\ifvmode\else\unskip\par\fi% \minipage{\linewidth}\smallskip}%% {\smallskip\endminipage}% \newcommand\example[3][figure]{%% \begingroup% \captionsetup{#2}%% \captionof{#1}[]{#3}%% \endgroup}% % \GetFileInfo{caption.sty}% \title{Typesetting captions with the% \thispackage\ package\thanks{This package has version number% \fileversion, last revised \filedate.}}% \author{Axel Sommerfeldt\\\href{mailto:caption@sommerfee.de}{\texttt{caption@sommerfee.de}}}% \date{2006/01/12}% \maketitle% % \begin{abstract}% The \thispackage\ package provides many ways to customise the captions% in floating environments such |figure| and |table| and cooperates with% many other packages.\footnote{A complete re-work of the user interface% done together with Steven D. Cochran and Frank Mittelbach has lead to% this new enhanced version 3.0.}% \end{abstract}% % \tableofcontents% % \newcommand\figuretext{^^A% White sand beaches. The pink smoothness of the conch shell. A sea abundant% with possibilities. Duty-free shops filled with Europe's finest gifts and% perfumes. Play your favorite game of golf amidst the tropical greens on one% of the many championship courses.}%% \iffalse% --------------------------------------------------------------------------- %% \fi% % \section{Introduction}% % Within the standard \LaTeX\ classes captions haven't received the attention% they deserve. Simply typeset as an ordinary paragraph there is no% remarkable visual difference from the rest of the text, like here:% % \example{belowskip=\abovecaptionskip}{\figuretext}% % There should be possibilities to change this; e.g., it would be nice if you% can make the text of the caption a little bit smaller as the normal text,% add an extra margin, typeset the caption label with the same font family and% shape as your headings etc. Just like this one:% % \example{belowskip=\abovecaptionskip,size=small,margin=10pt,labelfont=bf,labelsep=endash}{\figuretext}% % With this package you can do this easily as there are many ready-to-use% caption formatting options, but you are free to define your very own stuff, too.% % \iffalse% --------------------------------------------------------------------------- %% \fi% % \pagebreak[4]% \section{Using the package}% \label{usage}% % \DescribeMacro{\usepackage}% Insert% \begin{quote}% |\usepackage|\oarg{options}|{caption}[|\texttt{\filedate}|]|% \end{quote}% into the preamble of your document, i.e.~the part of your document% between |\documentclass| and |\begin{document}|.% The options control how your captions will look like; e.g.,% \begin{quote}% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|% \end{quote}% would result in captions looking like the second one in the introduction.% % \DescribeMacro{\captionsetup}% For a later change of options the \thispackage\ package provides the command% \begin{quote}% |\captionsetup|\oarg{float type}\marg{options}% \end{quote}% So% \begin{quote}% |\usepackage[margin=10pt,font=small,labelfont=bf]{caption}|% \end{quote}% and% \begin{quote}% |\usepackage{caption}|\\% |\captionsetup{margin=10pt,font=small,labelfont=bf}|% \end{quote}% are equal in their results.% % It's good to know that |\captionsetup| has an effect on the current% environment only. So if you want to change some settings for the% current |figure| or |table| only, just place the |\captionsetup| command% inside the |figure| or |table| right before the |\caption| command.% For example% \begin{quote}% |\begin{figure}|\\% | |\ldots\\% | \captionsetup{singlelinecheck=off}|\\% | \caption{|\ldots|}|\\% |\end{figure}|% \end{quote}% switches the single-line-check off, but only for this |figure| so all% the other captions remain untouched.% % (For a description of the optional parameter \meta{float type} see% section \ref{misc}: \textit{``Useful stuff''}.)% % \iffalse% --------------------------------------------------------------------------- %% \fi%% \pagebreak[3]% \section{Options}% % \def\OptionLabel{RaggedRight}% \def\UserDefined{\ldots}% \makeatletter% \newcommand*\Section{\@ifstar{\@Section\relax}{\@Section{section}}}% \newcommand*\@Section[3]{#1 \ref{#2}: \textit{``#3''}}% \makeatother% \newcommand*\See[1]{{\small (See #1)}}% \newcommand*\SeeUserDefined[1][]{%% \See{\Section{declare}{Do it yourself}#1}}% % \iffalse% --------------------------------------------------------------------------- %% \fi% % \subsection{Formatting}% % \DescribeMacro{format=}% A figure or table caption mainly consits of three parts: the caption label,% which says if this object is a `Figure' or `Table' and what number is% associated with it, the caption text itself, which is normally a short% description of contents, and the caption separator which separates the text% from the label.%% The \textit{caption format} determines how this information will be presented;% it is specified with the option% \begin{quote}% |format=|\meta{format name}\quad ,% \end{quote}% having the name of the caption format as its argument.%% There are two standard caption formats:% \iffalse% \footnote{You have the option to% define your own ones, too. See section \ref{declare}:% \textit{``Do it yourself!''} for details.}% \fi% % \begin{Options}{\OptionLabel}% \item[plain]\NEWdescription{v3.0h}% Typesets the captions as a normal paragraph.% (This is the default behaviour, it% is adapted from the standard \LaTeX\ document classes.)% % \item[hang]% Indents the caption text, so it will `hang' under the first line of the text.% % \item[\UserDefined]% Own formats can be defined using |\DeclareCaptionFormat|.% \SeeUserDefined% \end{Options}% % \begin{Example}% An example: Specifying the option% \begin{quote}% |format=hang|% \end{quote}% yields captions like this:% \example{format=hang}{\figuretext}% \end{Example}% % \DescribeMacro{indention=}% For both formats (\texttt{plain} and \texttt{hang}) you can setup an extra% indention starting at the second line of the caption. You do this with the% option% \begin{quote}% |indention=|\meta{amount}.% \end{quote}% % Three examples:% % \begin{Example}% \begin{quote}% |format=plain,indention=.5cm|% \end{quote}% \captionsetup{aboveskip=0pt}% \example{format=plain,indention=.5cm}{\figuretext}% \end{Example}% % \begin{Example}% \begin{quote}% |format=hang,indention=-0.5cm|% \end{quote}% \captionsetup{aboveskip=0pt}% \example{format=hang,indention=-0.5cm}{\figuretext}% \end{Example}% % \pagebreak[3]% \DescribeMacro{labelformat=}% With the option% \nopagebreak[3]% \begin{quote}% |labelformat=|\meta{label format name}% \end{quote}% \NEWdescription{v3.0e}% you specify how the caption label will be typeset.% There are three standard caption label formats:% % \begin{Options}{\OptionLabel}% \item[default]% The caption label will be typeset as specified by the document class,% usually this means the name and the number (like \texttt{simple}).% (This is the default behaviour.)%% \item[empty]% The caption label will be empty. This option only makes sense when used% together with other options like \texttt{labelsep=none}.% % \item[simple]% The caption label will be typeset as a name and a number.% % \item[parens]% The number of the caption label will be typeset in parentheses.% % \item[\UserDefined]% Own label formats can be defined using |\DeclareCaptionLabelFormat|.% \SeeUserDefined% \end{Options}% % \begin{Example}% An example: Using the options% \begin{quote}% |labelformat=parens,labelsep=quad|% \end{quote}% yields captions like this one:% \example{labelformat=parens,labelsep=quad}{\figuretext}% \end{Example}% % \DescribeMacro{labelsep=}% With the options% \begin{quote}% |labelsep=|\meta{label separator name}% \end{quote}% you specify what caption separator will be used.% You can choose one of the following:% % \begin{Options}{\OptionLabel}% \item[none]% There is no caption separator. This option only makes sense when used% together with other options like \texttt{labelformat=empty}.% % \item[colon]% The caption label and text will be separated by a colon and a space.% (This is the default one.)% % \item[period]% The caption label and text will be separated by a period and a space.% % \item[space]% The caption label and text will be separated by a single space.% % \item[quad]% The caption label and text will be separated by a |\quad|.% % \item[newline]% The caption label and text will be separated by a line break (|\\|).% % \item[endash]\NEWfeature{v3.0h}% The caption label and text will be separated by an en-dash,% surrounded by spaces (| -- |).% % \item[\UserDefined]% Own separators can be defined using |\DeclareCaptionLabelSeparator|.% \SeeUserDefined% \end{Options}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?