summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-01-25 00:24:01 +0000
committerKarl Berry <karl@freefriends.org>2010-01-25 00:24:01 +0000
commitb07ee562b2659dd10631ebd29a2e6b20929e94ac (patch)
tree8f3b74a60f61951e154dd65de060fb1432da080d /Master/texmf-dist/source
parent2c82ae3369984eafc23b0efad01e947b2c9b8f33 (diff)
new latex package capt-of (22jan10)
git-svn-id: svn://tug.org/texlive/trunk@16813 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r--Master/texmf-dist/source/latex/capt-of/capt-of.dtx176
-rw-r--r--Master/texmf-dist/source/latex/capt-of/capt-of.ins46
2 files changed, 222 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/capt-of/capt-of.dtx b/Master/texmf-dist/source/latex/capt-of/capt-of.dtx
new file mode 100644
index 00000000000..d2e06dfba92
--- /dev/null
+++ b/Master/texmf-dist/source/latex/capt-of/capt-of.dtx
@@ -0,0 +1,176 @@
+% ^^A ignore the tedious stuff when typesetting
+%
+% \CheckSum{6}
+%
+% \iffalse
+% Copyright 1996, 1999, 2010 Robin Fairbairns (rf10@cam.ac.uk)
+%
+% This program may 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 (at your option) any later version.
+%
+% \begin{macrocode}
+%<*!debugins>
+\NeedsTeXFormat{LaTeX2e}
+%</!debugins>
+%<*dtx>
+\ProvidesFile{capt-of.dtx}%
+%</dtx>
+%<package>\ProvidesPackage{capt-of}%
+ [2009/12/29 v0.2
+%<package> standard captions outside of floats%
+%<*dtx>
+ capt-of package source file%
+%</dtx>
+ ]% $Id: footmisc.dtx,v 4.20 2005/03/17 13:41:58 rf Exp rf10 $
+% \end{macrocode}
+%
+% Driver for compiling this file on its own
+% \begin{macrocode}
+%<*driver>
+\setcounter{errorcontextlines}{999}
+\documentclass{ltxdoc}
+\GetFileInfo{capt-of.dtx}
+\EnableCrossrefs
+% to get documented source of the package, comment out the next line,
+% and uncomment the following one; otherwise, create yourself
+% (somewhere on your LaTeX input path) a file ltxdoc.cfg that contains
+% simply \AtBeginDocument{\AlsoImplementation}
+\OnlyDescription
+%\AlsoImplementation
+\setcounter{StandardModuleDepth}{1}
+\begin{document}
+\DocInput{capt-of.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \fi
+%
+% \title{The \textsf{capt-of} package}
+% \author{Robin Fairbairns\thanks{Email: \emph{rf10@cam.ac.uk}}}
+% \maketitle
+%
+% \section{Why this package?}
+%
+% \LaTeX{} provides a command (\cs{caption}) for adding a caption to a
+% float environment (that is to say, a \texttt{figure} or a
+% \texttt{table}, ``out of the box'').
+%
+% The command is a good one, and many users want to use it. Often,
+% they end up using a float environment, in a case where it's not
+% strictly necessary, and get entangled in the positioning problems
+% that floats pose for the innocent user. Using this package, the
+% user can have standard-looking captions without the need of a float
+% environment.
+%
+% This package defines an alternative command, \cs{captionof}, which
+% sets things up so that \cs{caption} will work outside of a float.
+%
+% The \textsf{float} package provides an alternative to
+% \cs{captionof}, in the float \texttt{[H]} option
+% (``place the environment \emph{here} without doing any of this
+% floating stuff''). So why use \textsf{capt-of}? --- its great
+% advantage is simplicity; you load it, and it defines \emph{one}
+% macro, while \textsf{float} defines lots and lots. (Of course, if
+% you need others of \textsf{float}'s capabilities, \textsf{capt-of}
+% loses its advantage...).
+%
+% \section{The potential problem}
+%
+% \cs{captionof} defines a caption in text; it also steps the
+% \texttt{figure} (or \texttt{table} or whatever) counter. The float
+% environments do the same.
+%
+% Now, consider the sequence:
+% \begin{quote}
+% \begin{verbatim}
+% <earlier text>
+% \begin{figure}
+% <figure stuff>
+% \caption{...}
+% \end{figure}
+% ...
+% <intervening text>
+% ...
+% <inline figure stuff>
+% \captionof{figure}{...}
+% \end{verbatim}
+% \end{quote}
+% and suppose the \texttt{figure} environment doesn't fit anywhere
+% between where it's specified and the inline figure (so that it will
+% float to somewhere later).
+%
+% We will then see a document with
+% \begin{quote}
+% \meta{earlier text}\\
+% \dots\\
+% \meta{intervening text}\\
+% \dots\\
+% \meta{inline figure stuff}\\
+% Figure \meta{n+1}: \dots\\
+% \dots\\
+% \meta{yet more text}\\
+% \dots\\
+% \meta{figure stuff}\\
+% Figure \meta{n}: \dots
+% \end{quote}
+% That is, the figure numbers have got out of order, because the
+% floating figure was specified before the inline figure.
+%
+% \LaTeX{} won't do this when everything is specified as a float: it
+% keeps floats of the same type in order (which is why floats stack up
+% if a single one won't fit).
+%
+% The moral of that little tale is to say: don't use \cs{captionof}
+% and floats of the same type in the same document. (Or be
+% extra-specially careful about what's happening if you must.)
+% \AlsoImplementation
+% \StopEventually{}
+%
+% \section{The code (such as it is)}
+%
+% \begin{macro}{\captionof}
+% Usage: \cs{captionof}\marg{type}\oarg{move}\marg{caption}
+% \begin{description}
+% \item[\normalfont\itshape type] is `\texttt{figure}' or
+% `\texttt{table}' (or some type you've defined with the
+% \textsf{float} package)
+% \item[\normalfont\itshape move] is the optional moving argument of
+% \cs{caption} (the thing that goes to the list of tables/figures)
+% \item[\normalfont\itshape caption] is the text of the caption
+% \end{description}
+%
+% It's probably best to use \cs{captionof} within an enclosing group
+% (e.g., \cs{begin}\marg{center} \emph{figure}
+% \cs{captionof}\texttt{\char`{figure\char`}}\marg{blah blah} \cs{end}\marg{center})
+% \begin{macrocode}
+\newcommand\captionof[1]{\def\@captype{#1}\caption}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\endinput
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
+%% \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 \~}
+%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/capt-of/capt-of.ins b/Master/texmf-dist/source/latex/capt-of/capt-of.ins
new file mode 100644
index 00000000000..a9b703236f5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/capt-of/capt-of.ins
@@ -0,0 +1,46 @@
+\input docstrip.tex
+
+\preamble
+----------------------------------------------------------------------
+The capt-off package -- float-style captions outside of floats
+Copyright (c) 2010 Robin Fairbairns
+
+This work may be distributed and/or modified under the conditions of the
+LaTeX Project Public License, either version 1.3c 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.3c or later is part
+of all distributions of LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `author-maintained'.
+
+This work consists of the files capt-of.dtx, capt-of.ins, and README
+and the derived files footmisc.sty (not distributed from the archive)
+and footmisc.pdf.
+-----------------------------------------------------------------------
+
+\endpreamble
+
+\def\batchfile{capt-of.ins}
+\keepsilent
+\Msg{*** Generating the capt-of package ***}
+\askforoverwritefalse
+\generate{%
+ \file{capt-of.sty}{\from{capt-of.dtx}{package}}%
+}
+
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the file}
+\Msg{* footmisc.sty into a directory searched by TeX}
+\Msg{*}
+\Msg{* Usual TDS location:}
+\Msg{* \space\space tex/latex/capt-of}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endbatchfile