lineno and caption packages

This commit is contained in:
Krishna Kumar 2014-04-22 17:46:24 +01:00
parent e60e7dc359
commit cd76a9b5e9
16 changed files with 10740 additions and 4 deletions

View File

@ -53,9 +53,11 @@
%\usepackage{float}
%\restylefloat{figure}
% Subcaption package is available in the sty folder you can use that by
% uncommenting the following line
%\usepackage{sty/caption/subcaption}
\usepackage{subcaption}
% ********************************** Table *************************************
%\usepackage{longtable}

242
sty/caption/bicaption.sty Normal file
View File

@ -0,0 +1,242 @@
%%
%% This is file `bicaption.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bicaption.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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
%% CHANGELOG, README, SUMMARY, caption.ins,
%% caption.dtx, caption2.dtx, caption3.dtx,
%% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% newfloat.dtx, and totalcount.dtx
%% the derived files
%% caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty,
%% newfloat.sty, and totalcount.sty
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: bicaption.dtx 89 2013-05-02 07:05:20Z sommerfeldt $
\ProvidesPackage{bicaption}[\caption@tempa v1.1-\caption@tempb Bilingual Captions (AR)]
\RequirePackage{caption}[2012/12/26] % needs v3.3 or newer
\caption@AtBeginDocument{\caption@ifcompatibility{%
\caption@Error{%
The `bicaption' package does not work correctly\MessageBreak
in compatibility mode}}{}}
\newcommand*\bicaption@Info[1]{%
\PackageInfo{bicaption}{#1}}
\newcommand*\bicaption@InfoNoLine[1]{%
\PackageInfo{bicaption}{#1\@gobble}}
\newcommand*\bicaption@Warning[1]{%
\bicaption@WarningNoLine{#1\on@line}}
\newcommand*\bicaption@WarningNoLine[1]{%
\PackageWarning{bicaption}{#1.^^J\bicaption@wh\@gobbletwo}}
\newcommand*\bicaption@wh{%
See the bicaption package documentation for explanation.}
\newcommand*\bicaption@Error[1]{%
\PackageError{bicaption}{#1}\bicaption@eh}
\newcommand*\bicaption@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `bicaption' package.\MessageBreak\@ehc}
\newcount\bicaption@lang
\DeclareCaptionOption{bi-lang}{%
\caption@ifinlist{#1}{0,all,both}{%
\bicaption@lang=0\relax
}{\caption@ifinlist{#1}{1,1st,first}{%
\bicaption@lang=1\relax
}{\caption@ifinlist{#1}{2,2nd,second}{%
\bicaption@lang=2\relax
}{%
\bicaption@Error{Undefined bi-lang value `#1'}%
}}}}
\DeclareCaptionOption{bi-singlelinecheck}[1]{%
\caption@set@bool\bicaption@ifslc{#1}}
\DeclareCaptionOption{bi-slc}[1]{%
\caption@set@bool\bicaption@ifslc{#1}}
\DeclareCaptionOption{bi-swap}[1]{%
\caption@set@bool\bicaption@ifswap{#1}}
\DeclareCaptionOption{lang}{\def\bicaption@language{#1}}
\let\KV@caption@language\KV@caption@lang
\newcommand*\bicaption@selectlanguage[1]{%
\caption@ifundefined\bicaption@language{}{%
\expandafter\selectcaptionlanguage\expandafter#1\expandafter{\bicaption@language}}}
\g@addto@macro\caption@applyfont{%
\bicaption@selectlanguage\@firstoftwo}
\g@addto@macro\caption@prepareslc{%
\let\bicaption@language\@undefined}
\providecommand*\selectcaptionlanguage[1]{%
#1\select@language\selectlanguage}
\caption@ExecuteOptions{caption}{bi-lang=0,bi-slc=1,bi-swap=0}
\ifcsname captionmainlanguage\endcsname
\bicaption@InfoNoLine{main language is set to \captionmainlanguage}
\else\ifcsname bbl@main@language\endcsname
\bicaption@InfoNoLine{babel found, main language is \bbl@main@language}
\let\captionmainlanguage\bbl@main@language
\else\ifcsname xpg@main@language\endcsname
\bicaption@InfoNoLine{polyglossia found, main language is \xpg@main@language}
\let\captionmainlanguage\xpg@main@language
\else
\bicaption@InfoNoLine{main language is not set}
\fi\fi\fi
\ifcsname captionmainlanguage\endcsname
\edef\@tempa{\noexpand\captionsetup[bi-first]{lang=\captionmainlanguage}}
\@tempa
\fi
\caption@SetupOptions{bicaption}{\captionsetup[bi-second]{#2}}%
\caption@ProcessOptions*{bicaption}
\let\bicaption@addcontentsline@ORI\caption@addcontentsline
\renewcommand*\caption@addcontentsline[2]{%
\caption@ifundefined\bicaption@lentry
{\bicaption@addcontentsline@ORI{#1}{#2}}%
{\expandafter\bicaption@addcontentsline\expandafter
{\bicaption@lentry}{#1}{#2}%
\global\let\bicaption@lentry\@undefined}}
\newcommand\bicaption@addcontentsline[3]{%
\begingroup
\let\caption@addsubcontentslines\@gobble
\caption@setoptions{bi}%
\ifnum\bicaption@lang=2\relax \else
\begingroup
\caption@setoptions{bi-first}%
\bicaption@@addcontentsline{#2}{#3}%
\endgroup
\fi
\ifnum\bicaption@lang=1\relax \else
\begingroup
\caption@setoptions{bi-second}%
\bicaption@@addcontentsline{#2}{#1}%
\endgroup
\fi
\endgroup
\caption@addsubcontentslines{#2}}
\newcommand*\bicaption@@addcontentsline[2]{%
\caption@ifcontentsline{#2}{%
\bicaption@selectlanguage\@secondoftwo
\bicaption@addcontentsline@ORI{#1}{#2}}}
\let\caption@@make@ORI\caption@@make
\renewcommand\caption@@make[2]{%
\caption@ifundefined\bicaption@text
{\caption@@make@ORI{#1}{#2}}%
{\expandafter\bicaption@@make\expandafter
{\bicaption@text}{#1}{#2}%
\global\let\bicaption@text\@undefined}}
\newcommand\bicaption@@make[3]{%
\caption@setoptions{bi}%
\ifnum\bicaption@lang=0\relax
\bicaption@ifslc
{\caption@slc{#2}{#3}{}{\KV@caption@singlelinecheck0}%
\caption@slc{#2}{#1}{}{\KV@caption@singlelinecheck0}}%
{}%
\fi
\ifnum\bicaption@lang=2\relax
\bicaption@label
\global\let\bicaption@label\relax
\else
\begingroup
\caption@setoptions{bi-first}%
\caption@@make@ORI{#2}{#3}%
\endgroup
\fi
\ifnum\bicaption@lang=1\relax
\else
\begingroup
\caption@setoptions{bi-second}%
\caption@@make@ORI{#2}{#1}%
\endgroup
\fi}
\newcommand\bicaption{\@bicaption\caption}
\newcommand\bicaptionbox{\@bicaption\captionbox}
\newcommand\bisubcaption{\@bicaption\subcaption}
\let\subbicaption\bisubcaption
\newcommand\bisubcaptionbox{\@bicaption\subcaptionbox}
\let\subbicaptionbox\bisubcaptionbox
\newcommand*\@bicaption[1]{%
\def\bicaption@cmd{#1}%
\@ifstar
{\l@addto@macro\bicaption@cmd*%
\@@bicaption}%
{\caption@dblarg\@@@bicaption}}
\newcommand\@@bicaption[1]{%
\@@@@bicaption{}{#1}[]}
\long\def\@@@bicaption[#1]#2{%
\caption@dblarg{\@@@@bicaption{#1}{#2}}}
\long\def\@@@@bicaption#1#2[#3]#4{%
\bicaption@getlabel#2\label{}\@nil
\bicaption@ifswap
{\bicaption@setup{#1}{#2}%
\bicaption@cmd[{#3}]{#4}}%
{\bicaption@setup{#3}{#4}%
\bicaption@cmd[{#1}]{#2}}}
\long\def\bicaption@getlabel#1\label#2#3\@nil{%
\def\@tempa{#2}%
\ifx\@tempa\@empty
\let\bicaption@label\relax
\else
\def\@tempb{*}%
\ifx\@tempa\@tempb
\def\bicaption@label{\label*}%
\bicaption@@getlabel#3\@nil
\else
\def\bicaption@label{\label}%
\bicaption@@getlabel{#2}#3\@nil
\fi
\fi}
\long\def\bicaption@@getlabel#1#2\@nil{%
\def\@tempa{#1}%
\def\@tempb{[}%
\ifx\@tempa\@tempb
\bicaption@@@getlabel#1#2\@nil
\else
\l@addto@macro\bicaption@label{{#1}}%
\fi}
\long\def\bicaption@@@getlabel[#1]#2\@nil{%
\l@addto@macro\bicaption@label{[{#1}]}%
\bicaption@@getlabel#2\@nil}
\newcommand\bicaption@setup[2]{%
\def\bicaption@lentry{#1}%
\def\bicaption@text{\ignorespaces#2}}
\AtBeginDocument{%
\ifx\caption@freeze\@undefined \else
\g@addto@macro\caption@freeze{%
\let\caption@frozen@bicaption\bicaption
\def\bicaption{%
\caption@withoptargs\caption@SC@bicaption}%
\long\def\caption@SC@bicaption#1#2{%
\@ifnextchar[%]
{\caption@SC@bi@caption{#1}{#2}}%
{\caption@SC@bi@caption@{#1}{#2}}}%
\long\def\caption@SC@bi@caption#1#2[#3]#4{%
\caption@@freeze{\bicaption#1{#2}[{#3}]{#4}}%
\ignorespaces}%
\long\def\caption@SC@bi@caption@#1#2#3{%
\caption@@freeze{\bicaption#1{#2}{#3}}%
\ignorespaces}%
\l@addto@macro\caption@warmup{%
\let\bicaption\caption@frozen@bicaption}}%
\fi}
\endinput
%%
%% End of file `bicaption.sty'.

1767
sty/caption/caption.sty Normal file

File diff suppressed because it is too large Load Diff

447
sty/caption/caption2.sty Normal file
View File

@ -0,0 +1,447 @@
%%
%% This is file `caption2.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% caption2.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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,
%% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
%% the derived files caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
%% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: caption2.sty 62 2013-02-03 10:40:15Z sommerfeldt $
\ProvidesPackage{caption2}[\caption@tempa v2.2-\caption@tempb Customising captions (AR)]
\PackageWarning{caption2}{%
****************************************************\MessageBreak
THIS PACKAGE IS OBSOLETE:\MessageBreak
This package attempts to provide an `caption2'\MessageBreak
package v2.0/2.1 author environment so that OLD\MessageBreak
documents can be successfully processed. It should\MessageBreak
NOT be used for NEW documents! New documents should\MessageBreak
use the regular `caption' package v3.x instead.\MessageBreak
****************************************************\@gobbletwo}%
\RequirePackage{caption3}[2007/09/01] % needs v3.1 or newer
\@ifpackageloaded{caption}{%
\PackageError{caption2}{%
You can't use both, the (current) caption *and*\MessageBreak
the (obsolete) caption2 package}\caption@eh
\endinput
}{}
\newcommand*\captionlabeldelim{}
\newcommand*\captionlabelsep{}
\newcommand*\ifcaptionwidth{\ifdim\captionwidth>\z@}
\let\captionindent\caption@indent
\def\ifcaptionlabel{%
\ifcaption@star
\@tempswafalse
\else
\@tempswatrue
\fi
\if@tempswa}
\def\captionlabeltrue{\caption@starfalse}
\def\captionlabelfalse{\caption@startrue}
\def\ifonelinecaptions{%
\caption@ifslc{\@tempswatrue}{\@tempswafalse}%
\if@tempswa}
\def\onelinecaptionstrue{\caption@setbool{slc}{1}}
\def\onelinecaptionsfalse{\caption@setbool{slc}{0}}
\newif\ifignoreLTcapwidth
\newcommand*\normalcaptionparams{%
\let\captionsize\@empty
\renewcommand*\captionfont{\captionsize}%
\let\captionlabelfont\@empty
\renewcommand*\captionlabeldelim{:}%
\renewcommand*\captionlabelsep{\space}%
\setcaptionmargin\z@
\setlength\captionindent\z@
\onelinecaptionstrue}
\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}}
\newcommand*\dummycaptionstyle[2]{%
\defcaptionstyle{#1}{%
\expandafter\ifx\csname caption@@\caption@style\expandafter\endcsname%
\csname caption@@#1\endcsname
\PackageError{caption2}{You can't use the caption style `#1' directy}{%
The caption style `#1' is only a dummy and does not really exists.%
\MessageBreak You have to redefine it (with \protect\renewcaptionstyle)
before you can select\MessageBreak it with \protect\captionstyle.
\space\caption@eh}%
\else
#2\usecaptionstyle\caption@style
\fi}}
\newcommand*\captionstyle[1]{%
\expandafter\ifx\csname caption@@#1\endcsname\relax
\PackageError{caption2}{Undefined caption style `#1'}{\caption@eh}%
\else
\def\caption@style{#1}%
\fi}
\newcaptionstyle{normal}{\caption@make{normal}}
\newcaptionstyle{center}{\caption@make{center}}
\newcaptionstyle{centerlast}{\caption@make{centerlast}}
\newcaptionstyle{flushleft}{\caption@make{flushleft}}
\newcaptionstyle{flushright}{\caption@make{flushright}}
\newcaptionstyle{hang}{\caption@make{hang}}
\newcaptionstyle{hang+center}{\caption@make{hang@center}}
\newcaptionstyle{hang+centerlast}{\caption@make{hang@centerlast}}
\newcaptionstyle{hang+flushleft}{\caption@make{hang@flushleft}}
\newcaptionstyle{indent}{\caption@make{indent}}
\newcommand*\caption@makecaption[1]{%
\usecaptionmargin
\ifcaptionlabel
\def\caption@label{%
{\captionlabelfont\captionlabel\captionlabeldelim}\captionlabelsep}%
\else
\let\caption@label\@empty
\fi
\captionfont
\onelinecaption
{\caption@label\captiontext}%
{\parbox[b]\captionlinewidth{\strut\@nameuse{caption@@@#1}\par}\par}}
\newcommand*\caption@@@normal{%
\caption@label\captiontext}
\newcommand*\caption@@@center{%
\centering\caption@label\captiontext}%
\newcommand*\caption@@@centerlast{%
\centerlast\caption@label\captiontext}
\newcommand*\caption@@@flushleft{%
\raggedright\caption@label\captiontext}%
\newcommand*\caption@@@flushright{%
\raggedleft\caption@label\captiontext}%
\newcommand*\caption@@@hang{%
\sbox\@tempboxa{\caption@label}%
\hangindent\wd\@tempboxa\noindent
\usebox\@tempboxa\caption@hangplus\captiontext}
\newcommand*\caption@hangplus{}
\newcommand*\caption@@@hang@center{%
\let\caption@hangplus\centering\caption@@@hang}
\newcommand*\caption@@@hang@centerlast{%
\let\caption@hangplus\centerlast\caption@@@hang}
\newcommand*\caption@@@hang@flushleft{%
\let\caption@hangplus\raggedright\caption@@@hang}
\newcommand*\caption@@@indent{%
\hangindent\captionindent\noindent
\caption@label\captiontext}
\DeclareOption{normal}{\captionstyle{normal}}
\DeclareOption{center}{\captionstyle{center}}
\DeclareOption{centerlast}{\captionstyle{centerlast}}
\DeclareOption{flushleft}{\captionstyle{flushleft}}
\DeclareOption{flushright}{\captionstyle{flushright}}
\DeclareOption{anne}{\ExecuteOptions{centerlast}}
\DeclareOption{hang}{\captionstyle{hang}}
\DeclareOption{hang+center}{\captionstyle{hang+center}}
\DeclareOption{hang+centerlast}{\captionstyle{hang+centerlast}}
\DeclareOption{hang+flushleft}{\captionstyle{hang+flushleft}}
\DeclareOption{isu}{\ExecuteOptions{hang}}
\DeclareOption{indent}{\captionstyle{indent}}
\DeclareOption{scriptsize}{\g@addto@macro\captionsize\scriptsize}
\DeclareOption{footnotesize}{\g@addto@macro\captionsize\footnotesize}
\DeclareOption{small}{\g@addto@macro\captionsize\small}
\DeclareOption{normalsize}{\g@addto@macro\captionsize\normalsize}
\DeclareOption{large}{\g@addto@macro\captionsize\large}
\DeclareOption{Large}{\g@addto@macro\captionsize\Large}
\DeclareOption{up}{\g@addto@macro\captionlabelfont\upshape}
\DeclareOption{it}{\g@addto@macro\captionlabelfont\itshape}
\DeclareOption{sl}{\g@addto@macro\captionlabelfont\slshape}
\DeclareOption{sc}{\g@addto@macro\captionlabelfont\scshape}
\DeclareOption{md}{\g@addto@macro\captionlabelfont\mdseries}
\DeclareOption{bf}{\g@addto@macro\captionlabelfont\bfseries}
\DeclareOption{rm}{\g@addto@macro\captionlabelfont\rmfamily}
\DeclareOption{sf}{\g@addto@macro\captionlabelfont\sffamily}
\DeclareOption{tt}{\g@addto@macro\captionlabelfont\ttfamily}
\DeclareOption{oneline}{\onelinecaptionstrue}
\DeclareOption{nooneline}{\onelinecaptionsfalse}
\newcommand*\caption@setpackage[1]{\@namedef{caption@pkt@#1}}
\DeclareOption{float}{%
\caption@twozerofalse\caption@setpackage{float}{1}}
\DeclareOption{longtable}{%
\caption@twozerofalse\caption@setpackage{longtable}{1}}
\DeclareOption{subfigure}{%
\caption@twozerofalse\caption@setpackage{subfigure}{1}}
\DeclareOption{none}{\caption@twozerofalse
\caption@setpackage{float}{0}\caption@setpackage{longtable}{0}%
\caption@setpackage{subfigure}{0}}
\DeclareOption{all}{\ExecuteOptions{float,longtable,subfigure}}
\newif\ifcaption@ruled
\DeclareOption{ruled}{\caption@ruledtrue}
\DeclareOption{boxed}{}
\DeclareOption{ignoreLTcapwidth}{\ignoreLTcapwidthtrue}
\DeclareOption{debug}{\captionsetup{debug}}
\newif\ifcaption@twozero
\normalcaptionparams
\ExecuteOptions{none,normal}
\caption@twozerotrue
\ProcessOptions*
\ifcaption@twozero
\PackageInfo{caption2}{Running in caption2 v2.0 compatibility mode}
\fi
\def\captionof{\@ifstar{\caption@of{\caption*}}{\caption@of\caption}}
\newcommand*\caption@of[2]{\def\@captype{#2}#1}
\caption@ifundefined\abovecaptionskip{%
\newlength\abovecaptionskip\setlength\abovecaptionskip{10\p@}}{}
\caption@ifundefined\belowcaptionskip{%
\newlength\belowcaptionskip\setlength\belowcaptionskip{0\p@}}{}
\newdimen\captionlinewidth
\newdimen\realcaptionwidth
\newcommand*\usecaptionmargin{%
\ifcaptionwidth
\leftskip\captionlinewidth
\advance\leftskip by -\captionwidth
\divide\leftskip by 2
\rightskip\leftskip
\captionlinewidth\captionwidth
\else
\leftskip\captionmargin
\rightskip\captionmargin
\advance\captionlinewidth by -2\captionmargin
\fi
\realcaptionwidth\captionlinewidth}
\newcommand\onelinecaption[1]{%
\let\next\@firstofone
\ifonelinecaptions
\sbox\@tempboxa{#1}%
\ifdim\wd\@tempboxa >\captionlinewidth
\else
\def\next{{\centering\usebox\@tempboxa\par}\@gobble}%
\fi
\fi\next}
\newcommand*\usecaptionstyle[1]{%
\caption@ifundefined\captiontext{%
\PackageError{caption2}{You can't use \protect#1
in normal text}{The usage of \protect#1 is only
allowed inside code declared with\MessageBreak \protect\defcaptionstyle,
\protect\newcaptionstyle \space or \protect\renewcaptionstyle.
\space\caption@eh}
}{%
\@ifundefined{caption@@#1}%
{\PackageError{caption2}{Caption style `#1' undefined}{\caption@eh}}%
{\let\caption@make\caption@makecaption
\@nameuse{caption@@#1}}%
}}
\renewcommand\@makecaption[2]{%
\vskip\abovecaptionskip
\captionlinewidth\hsize
\realcaptionwidth\hsize
\def\captionlabel{#1}%
\def\captiontext{#2}%
\usecaptionstyle\caption@style
\vskip\belowcaptionskip}
\newcommand*\caption@ifpackage[3]{%
\if1\@nameuse{caption@pkt@#1}%
\@ifundefined{#2}%
{\let\next\AtBeginDocument}%
{\let\next\@firstofone}%
\else\ifcaption@twozero
\@ifundefined{#2}%
{#3\let\next\@gobble}%
{\let\next\@firstofone}%
\else
#3\let\next\@gobble
\fi\fi
\expandafter\let\csname caption@pkt@#1\endcsname\undefined
\caption@ifdebug{%
\ifx\next\@gobble\PackageInfo{caption2}{#1 => gobble}%
\else\ifx\next\@firstofone\PackageInfo{caption2}{#1 => firstofone}%
\else\ifx\next\AtBeginDocument\PackageInfo{caption2}{#1 => AtBeginDocument}%
\fi\fi\fi}{}%
\next}
\caption@ifpackage{float}{floatc@plain}{}{%
\ifx\floatc@plain\relax
\PackageWarning{caption2}{%
Option `float' was set but there is no float package loaded}
\else
\PackageInfo{caption2}{float package v1.2 (or newer) detected}
\newcommand\caption@floatc[3]{%
\ifx\captionlabelfont\@empty
\let\captionlabelfont\@fs@cfont
\fi
\captionlinewidth\hsize
\realcaptionwidth\hsize
\def\captionlabel{#2}%
\def\captiontext{#3}%
\usecaptionstyle{#1}}
\renewcommand*\floatc@plain{\caption@floatc{\caption@style}}
\ifcaption@ruled
\dummycaptionstyle{ruled}{\onelinecaptionsfalse\setcaptionmargin{\z@}}%
\else
\newcaptionstyle{ruled}{%
\ifcaptionlabel
{\@fs@cfont\captionlabel}\space%
\fi\captiontext\par}%
\fi
\renewcommand*\floatc@ruled{\caption@floatc{ruled}}
\renewcommand*\caption@of[2]{\def\@captype{#2}%
\@ifundefined{fst@#2}{}{%
\@nameuse{fst@#2}%
\caption@ifundefined\@float@setevery{}{\@float@setevery{#2}}%
\let\caption@fs@capt\@fs@capt
\let\@fs@capt\caption@of@float}%
#1}
\newcommand\caption@of@float[2]{\egroup
\vskip\abovecaptionskip
\normalsize\caption@fs@capt{#1}{#2}%
\vskip\belowcaptionskip
\bgroup}%
\fi}
\caption@ifpackage{longtable}{LT@makecaption}{}{%
\ifx\LT@makecaption\relax
\PackageWarning{caption2}{%
Option `longtable' was set but there is no longtable package loaded}
\else
\PackageInfo{caption2}{longtable package v3.15 (or newer) detected}
\dummycaptionstyle{longtable}{}
\renewcommand\LT@makecaption[3]{%
\LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\hsize{%
\ifignoreLTcapwidth
\else
\setcaptionwidth\LTcapwidth
\fi
\captionlinewidth\hsize
\realcaptionwidth\hsize
\captionlabelfalse#1\captionlabeltrue
\def\captionlabel{#2}%
\def\captiontext{#3}%
\usecaptionstyle{longtable}%
\endgraf\vskip\baselineskip}%
\hss}}}
\fi}
\newcommand*\setsubcapstyle{%
\caption@ifundefined\subcapraggedrightfalse{%
\newif\ifsubcapraggedright}{}%
\ifsubcaphang
\ifsubcapcenter
\subcapstyle{hang+center}%
\else\ifsubcapcenterlast
\subcapstyle{hang+centerlast}%
\else\ifsubcapraggedright
\subcapstyle{hang+flushleft}%
\else
\subcapstyle{hang}%
\fi\fi\fi
\else\ifsubcapcenter
\subcapstyle{center}%
\else\ifsubcapcenterlast
\subcapstyle{centerlast}%
\else\ifsubcapraggedright
\subcapstyle{flushleft}%
\else
\subcapstyle{normal}%
\fi\fi\fi\fi}
\newcommand\caption@makesubcaption[2]{%
\renewcommand*\captionfont{\subcapsize\subcapfont}%
\renewcommand*\captionlabelfont{\normalfont\subcapsize\subcaplabelfont}%
\let\captionlabeldelim\subcaplabeldelim
\let\captionlabelsep\subcaplabelsep
\ifsubfigcapwidth
\setcaptionwidth\subfigcapwidth
\else
\setcaptionmargin\subfigcapmargin
\fi
\setlength\captionmargin\subfigcapmargin
\setlength\captionwidth\subfigcapwidth
\captionindent\subcapindent
\ifsubcapnooneline
\onelinecaptionsfalse
\else
\onelinecaptionstrue
\fi
\hbox to\@tempdima{%
\caption@subfig@hss\parbox[t]\@tempdima{%
\captionlinewidth\@tempdima
\realcaptionwidth\@tempdima
\captionlabeltrue
\def\captionlabel{#1}%
\def\captiontext{\ignorespaces #2}%
\usecaptionstyle\caption@substyle}%
\caption@subfig@hss}}
\caption@ifpackage{subfigure}{@makesubfigurecaption}{%
\let\setsubcapstyle\undefined
\let\caption@makesubcaption\undefined}{%
\ifx\@makesubfigurecaption\relax
\PackageWarning{caption2}{%
Option `subfigure' was set but there is no subfigure package loaded}
\let\setsubcapstyle\undefined
\let\caption@makesubcaption\undefined
\else
\ifx\subcapfont\undefined
\PackageInfo{caption2}{subfigure package v2.0 detected}
\let\subcapfont\@empty
\newcommand*\subfigcapwidth{\z@}
\newcommand*\setsubcapmargin{%
\subfigcapwidthfalse
\renewcommand*\subfigcapmargin}
\newcommand*\setsubcapwidth{%
\subfigcapwidthtrue
\renewcommand*\subfigcapwidth}
\newcommand*\subcaplabelsep{\space}
\let\caption@subfig@hss\hfil
\else
\PackageInfo{caption2}{subfigure package v2.1 (or newer) detected}
\newdimen\subfigcapwidth
\newcommand*\setsubcapmargin{%
\subfigcapwidthfalse
\setlength\subfigcapmargin}
\newcommand*\setsubcapwidth{%
\subfigcapwidthtrue
\setlength\subfigcapwidth}
\newcommand*\subcaplabelsep{\hskip\subfiglabelskip}
\let\caption@subfig@hss\hss
\fi
\newif\ifsubfigcapwidth
\newdimen\subcapindent
\newcommand*\subcaplabeldelim{}
\newcommand*\subcapstyle[1]{%
\expandafter\ifx\csname caption@@#1\endcsname\relax
\PackageError{caption2}{Undefined caption style `#1'}{\caption@eh}%
\else
\def\caption@substyle{#1}%
\fi}
\setsubcapstyle
\renewcommand*\@thesubfigure{\thesubfigure}
\renewcommand*\@thesubtable{\thesubtable}
\let\@makesubfigurecaption\caption@makesubcaption
\let\@makesubtablecaption\caption@makesubcaption
\fi}
\let\caption@ifpackage\undefined
\endinput
%%
%% End of file `caption2.sty'.

1642
sty/caption/caption3.sty Normal file

File diff suppressed because it is too large Load Diff

200
sty/caption/ltcaption.sty Normal file
View File

@ -0,0 +1,200 @@
%%
%% This is file `ltcaption.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ltcaption.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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,
%% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
%% the derived files caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
%% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: ltcaption.sty 62 2013-02-03 10:40:15Z sommerfeldt $
\ProvidesPackage{ltcaption}[\caption@tempa v1.3-\caption@tempb longtable captions (AR)]
\@ifpackageloaded{longtable}{}{%
\PackageError{ltcaption}{longtable package not loaded, aborting}{RTFM}}
\providecommand*\LTcaptype{table}
\providecommand*\ext@table{lot}
\@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
\@ifpackageloaded{listings}{%
\providecommand*\ext@lstlisting{lol}}{}}
\@ifpackageloaded{caption}{}{%
\newskip\LTcapskip \LTcapskip=\abovecaptionskip
\newskip\LTcapleft \LTcapleft=\fill
\newskip\LTcapright \LTcapright=\fill
\newif\ifLTcapmargins \LTcapmarginstrue
\providecommand*\CaptionLabelFont{}
\providecommand*\CaptionTextFont{}
\providecommand*\CaptionLabelSeparator{:}
}
\@ifundefined{caption@AtBeginDocument}\AtBeginDocument\caption@AtBeginDocument{%
\let\ltcaption@ORI@LT@array\LT@array
\renewcommand*\LT@array{%
\let\caption@LT@refstepcounter\refstepcounter
\def\refstepcounter{%
\caption@LTtype\caption@LT@refstepcounter}%
\let\caption@LT@Hrefstepcounter\H@refstepcounter
\def\H@refstepcounter{%
\caption@LTtype\caption@LT@Hrefstepcounter}%
\let\caption@LT@makecurrent\hyper@makecurrent
\def\hyper@makecurrent{%
\caption@LTtype\caption@LT@makecurrent}%
\def\lst@@caption{\relax}%
\ltcaption@ORI@LT@array}}
\newcommand*\caption@LTtype[2]{%
\edef\caption@LT@tempa{#2}%
\ifx\caption@LT@tempa\caption@LT@table
\caption@LT@type#1%
\else
#1{#2}%
\fi}%
\newcommand*\caption@LT@type[1]{%
\expandafter#1\expandafter{\LTcaptype}}
\newcommand*\caption@LT@table{table}%
\long\def\LT@c@ption#1[#2]#3{%
\LT@makecaption#1{\csname fnum@\LTcaptype\endcsname}{#3}%
\def\@tempa{#2}%
\ifx\@tempa\@empty\else
{\let\\\space
\addcontentsline{\csname ext@\LTcaptype\endcsname}{\LTcaptype}%
{\protect\numberline{\csname the\LTcaptype\endcsname}{#2}}}%
\fi
\ignorespaces}
\renewcommand\LT@makecaption[3]{%
\LT@@makecaption{%
\sbox\@tempboxa{%
#1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3}%
\ifdim\wd\@tempboxa>\hsize
#1{{\CaptionLabelFont#2\CaptionLabelSeparator} }\CaptionTextFont#3%
\else
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\endgraf\vskip\LTcapskip}}
\newcommand\LT@@makecaption[1]{%
\caption@LT@make{\hb@xt@\hsize{%
\ifLTcapmargins
\hspace\LTcapleft
\FBifLTcapwidth{\advance\LTcapwidth-\LTcapleft}%
\else
\hspace\LTleft
\FBifLTcapwidth{\advance\LTcapwidth-\LTleft}%
\fi
\FBifLTcapwidth{\advance\LTcapwidth-%
\ifLTcapmargins\LTcapright\else\LTright\fi}%
\parbox[t]\LTcapwidth{#1}%
\ifLTcapmargins
\hskip\LTcapright
\else
\hskip\LTright
\fi}}}
\AtBeginDocument{\providecommand*\FBifLTcapwidth[1]{}}
\newcommand\caption@LT@make[1]{%
\noalign{\caption@LT@config}%
\expandafter\LT@mcol\expandafter\LT@cols\expandafter{\caption@LTfmt}{%
\hb@xt@\z@{%
\hspace\caption@LTleft
\parbox[t]\linewidth{#1}%
\hspace\caption@LTright}}}%
\newcommand*\caption@LT@config{%
\caption@LT@parse\LTleft\caption@LTleft\caption@ifLTleft
\caption@LT@parse\LTright\caption@LTright\caption@ifLTright
\xdef\caption@LTfmt{%
@{}\caption@ifLTleft{\caption@ifLTright{c}{r}}{l}@{}}}
\newcommand*\caption@LT@parse[3]{%
\let\@pluspart\@undefined
\let\@minuspart\@undefined
\expandafter\caption@LT@parse@\expandafter\@fixpart\the#1 x %
\xdef#2{-\@fixpart
\ifx\@minuspart\@undefined\else
\space\@plus\space\@minuspart
\fi
\ifx\@pluspart\@undefined\else
\space\@minus\space\@pluspart
\fi}%
\let#3\@firstoftwo
\ifx\@pluspart\@undefined
\ifx\@minuspart\@undefined
\let#3\@secondoftwo
\fi
\fi}
\def\caption@LT@parse@#1#2 {%
\edef\@tempa{\@car#2\@nil}%
\if p\@tempa
\def\next{\caption@LT@parse@\@pluspart}%
\else\if m\@tempa
\def\next{\caption@LT@parse@\@minuspart}%
\else\if x\@tempa
\let\next\relax
\else
\def#1{#2}%
\def\next{\caption@LT@parse@ @}%
\fi\fi\fi
\next}
\newenvironment{longtable*}{%
\let\caption@LT@type\@gobble
\let\caption@LT@raisedlink\Hy@raisedlink
\def\Hy@raisedlink{%
\let\Hy@raisedlink\caption@LT@raisedlink
\@gobble}%
\let\ltcaption@ORI@LT@c@ption\LT@c@ption
\def\LT@c@ption##1[##2]##3{%
\ifx##1\@firstofone
\PackageError{ltcaption}%
{Not allowed in longtable* environment}%
{If you do not understand this error, please take a closer
look\MessageBreak at the documentation of the `ltcaption'
package.\MessageBreak \@ehc}%
\else
\ltcaption@ORI@LT@c@ption{##1}[{##2}]{##3}%
\fi}%
\longtable}%
{\endlongtable}
\@ifundefined{@komalongtablefalse}{}{%
\if@komalongtable
\renewcommand{\LT@makecaption}[3]{%
\noalign{%
\if@captionabove
\vskip\belowcaptionskip
\else
\vskip\abovecaptionskip
\fi
}%
\caption@LT@make{%
\@@makecaption{#1}{#2}{#3}%
\endgraf
\if@captionabove
\vskip\abovecaptionskip
\else
\vskip\belowcaptionskip
\fi
}%
}%
\let\LT@@makecaption\@undefined
\fi}
\endinput
%%
%% End of file `ltcaption.sty'.

734
sty/caption/newfloat.sty Normal file
View File

@ -0,0 +1,734 @@
%%
%% This is file `newfloat.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% newfloat.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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
%% CHANGELOG, README, SUMMARY, caption.ins,
%% caption.dtx, caption2.dtx, caption3.dtx,
%% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% newfloat.dtx, and totalcount.dtx
%% the derived files
%% caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty,
%% newfloat.sty, and totalcount.sty
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: newfloat.sty 91 2013-05-11 12:25:57Z sommerfeldt $
\ProvidesPackage{newfloat}[\caption@tempa v1.1-\caption@tempb Defining new floating environments (AR)]
\newcommand*\newfloat@Info[1]{%
\PackageInfo{newfloat}{#1}}
\newcommand*\newfloat@InfoNoLine[1]{%
\newfloat@Info{#1\@gobble}}
\newcommand*\newfloat@Error[1]{%
\PackageError{newfloat}{#1}\newfloat@eh}
\newcommand*\newfloat@eh{%
If you do not understand this error, please take a closer look\MessageBreak
at the documentation of the `newfloat' package.\MessageBreak\@ehc}
\RequirePackage{keyval}[1997/11/10]
\newcommand*\newfloat@def[2]{%
\newfloat@ifundefined{#1}{%
\@namedef{#1}{#2}}}
\newcommand*\newfloat@let[2]{%
\newfloat@ifundefined{#1}{%
\expandafter\let\csname #1\endcsname#2}}
\newcommand*\newfloat@ifundefined[2]{%
\@ifundefined{#1}{#2}{%
\newfloat@Info{%
\expandafter\string\csname#1\endcsname\space is already defined}}}
\newcommand*\DeclareFloatingEnvironment{%
\@testopt\@DeclareFloatingEnvironment{}}
\@onlypreamble\DeclareFloatingEnvironment
\def\@DeclareFloatingEnvironment[#1]#2{%
\newfloat@Info{New float `#2' with options `#1'}%
\edef\newfloat@Type{\def\noexpand\newfloat@Type{\@car#2\@nil}}%
\uppercase\expandafter{\newfloat@Type}%
\edef\@tempa{%
\noexpand\g@addto@macro\noexpand\newfloat@Type{\@cdr#2\@nil}}%
\@tempa
\newfloat@ifundefined{c@#2}{\newcounter{#2}}%
\ifdefined\c@float@type % from float package
\expandafter\edef\csname ftype@#2\endcsname{\the\value{float@type}}%
\addtocounter{float@type}{\value{float@type}}%
\else\ifdefined\c@newflo@tctr % from memoir document class
\expandafter\edef\csname ftype@#2\endcsname{\the\c@newflo@tctr}%
\advance\c@newflo@tctr \c@newflo@tctr
\else
\ifdefined\newfloat@ftype \else
\newcount\newfloat@ftype
\newfloat@ftype=8\relax
\fi
\expandafter\xdef\csname ftype@#2\endcsname{\the\newfloat@ftype}%
\advance\newfloat@ftype\newfloat@ftype
\fi\fi
\newfloat@Info{float type `#2'=\@nameuse{ftype@#2}}%
\newfloat@def{fnum@#2}%
{\@nameuse{#2name}\nobreakspace\@nameuse{the#2}}%
\newfloat@let{#2name}{\newfloat@Type}%
\newfloat@def{fleg#2}{\@nameuse{#2name}}% legend naming (memoir)
\newfloat@ifundefined{flegtoc#2}{\@namedef{flegtoc#2}##1{}}%
\ifcsname @tufte@float\endcsname
\newenvironment{#2}[1][htbp]%
{\begin{@tufte@float}[##1]{#2}{}}%
{\end{@tufte@float}}%
\newenvironment{#2*}[1][htbp]%
{\begin{@tufte@float}[##1]{#2}{star}}%
{\end{@tufte@float}}%
\else
\newenvironment{#2}{\@float{#2}}{\end@float}%
\newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}%
\fi
\newfloat@def{listof#2}{\newfloat@listof{#2}}%
\newfloat@def{listof#2s}{\@nameuse{listof#2}}%
\newfloat@def{listof#2es}{\@nameuse{listof#2s}}%
\newfloat@def{newfloat@listof#2@hook}{}%
\ifdefined\l@figure
\newfloat@let{l@#2}{\l@figure}%
\else
\newfloat@def{l@#2}{\@dottedtocline{1}{1.5em}{2.3em}}%
\fi
\edef\newfloat@tempa{List of \newfloat@Type s}%
\newfloat@let{list#2name}{\newfloat@tempa}%
\expandafter\let\csname fst@#2\endcsname\@undefined
\newfloat@ifundefined{fps@#2}{\newfloat@setplacement{#2}{tbp}}%
\newfloat@ifundefined{ext@#2}{\newfloat@setfileext{#2}{lo#2}}%
\newfloat@setoptions*{#2}{#1}%
\@expandtwoargs\newfloat@announce{#2}{\@nameuse{ext@#2}}%
\@ifnextchar[\newfloat@DFE@setname\relax}
\@onlypreamble\@DeclareFloatingEnvironment
\def\newfloat@DFE@setname[#1]{%
\KV@@newfloat@name{#1}%
\@ifnextchar[\newfloat@DFE@setlistname\relax}
\@onlypreamble\newfloat@DFE@setname
\def\newfloat@DFE@setlistname[#1]{%
\KV@@newfloat@listname{#1}}
\@onlypreamble\newfloat@DFE@setlistname
\newcommand*\newfloat@listof[1]{%
\@expandtwoargs\newfloat@list@of{#1}{\@nameuse{ext@#1}}}
\newcommand*\newfloat@list@of[2]{%
\begingroup
\expandafter\let\expandafter\listfigurename\csname list#1name\endcsname
\def\ext@figure{#2}%
\let\newfloat@starttoc\@starttoc
\def\@starttoc##1{\newfloat@starttoc{#2}}%
\let\newfloat@listoftoc\listoftoc
\def\listoftoc##1{\newfloat@listoftoc{#2}}%
\@nameuse{newfloat@listof#1@hook}%
\listoffigures
\endgroup}
\newcommand*\newfloat@setoptions{%
\@ifstar
{\newfloat@@setoptions\@firstofone}%
{\newfloat@@setoptions\@gobble}}
\newcommand*\newfloat@@setoptions[3]{%
\let\newfloat@within@value\@undefined
\let\newfloat@chapterlistsgaps@value\@undefined
#1{\KV@@newfloat@within\newfloat@within@default}% set default value for new floats
\def\newfloat@type{#2}%
\setkeys{@newfloat}{#3}%
\ifx\newfloat@within@value\@undefined \else
\newfloat@setoption{within}\newfloat@within@value
\fi
\ifx\newfloat@chapterlistsgaps@value\@undefined \else
\newfloat@setoption{chapterlistsgaps}\newfloat@chapterlistsgaps@value
\fi}
\newcommand*\newfloat@within@default{%
\ifcsname c@chapter\endcsname chapter\else none\fi}
\@onlypreamble\newfloat@within@default
\newcommand*\newfloat@setoption[1]{%
\expandafter\@expandtwoargs\csname newfloat@set#1\endcsname\newfloat@type}
\newcommand*\newfloat@setfileext[2]{%
\@namedef{ext@#1}{#2}}
\define@key{@newfloat}{fileext}{%
\newfloat@setoption{fileext}{#1}}
\newcommand*\newfloat@setlistname[2]{%
\@namedef{list#1name}{#2}}
\define@key{@newfloat}{listname}{%
\newfloat@setoption{listname}{#1}}
\newcommand*\newfloat@setname[2]{%
\newfloat@@setname{#1}{#2}%
\begingroup
\ifcsname languagename\endcsname
\ifcsname captions\languagename\endcsname
\expandafter\g@addto@macro\csname captions\languagename\endcsname
{\newfloat@@setname{#1}{#2}}%
\fi
\fi
\endgroup}
%%\AtBeginDocument{\let\newfloat@setname\newfloat@@setname}
\newcommand*\newfloat@@setname[2]{%
\@namedef{#1name}{#2}}
\define@key{@newfloat}{name}{%
\newfloat@setoption{name}{#1}}
\newcommand*\newfloat@setplacement[2]{%
\@namedef{fps@#1}{#2}}
\define@key{@newfloat}{placement}{%
\newfloat@setoption{placement}{#1}}
\newcommand*\newfloat@setwithin[2]{%
\ifcsname c@chapter\endcsname
\@removefromreset{#1}{chapter}%
\fi
\@removefromreset{#1}{section}%
\edef\@tempa{#2}%
\ifx\@tempa\@empty
\def\@tempa{none}%
\fi
\def\@tempb{none}%
\ifx\@tempa\@tempb
\ifcsname c@chapter\endcsname
\@chapterlistsgap@off{#1}%
\fi
\newfloat@@setwithin{#1}{}{}%
\else
\def\@tempb{chapter}%
\ifx\@tempa\@tempb
\@addtoreset{#1}{chapter}%
\@chapterlistsgap@on{#1}%
\newfloat@@setwithin{#1}{\ifnum\c@chapter>\z@ \thechapter.\fi}{\theHchapter.}%
\else
\def\@tempb{section}%
\ifx\@tempa\@tempb
\@addtoreset{#1}{section}%
\ifcsname c@chapter\endcsname
\@addtoreset{#1}{chapter}%
\@chapterlistsgap@on{#1}%
\newfloat@@setwithin{#1}{\thesection.}{\theHsection.}%
\else
\newfloat@@setwithin{#1}{\ifnum\c@section>\z@ \thesection.\fi}{\theHsection.}%
\fi
\else
\newfloat@Error{Invalid value `#2' for option `within'}%
\fi
\fi
\fi}
\newcommand*\newfloat@@setwithin[3]{%
\global\@namedef{the#1}{#2\arabic{#1}}%
\global\@namedef{theH#1}{#3\arabic{#1}}}
\define@key{@newfloat}{within}{%
\def\newfloat@within@value{#1}}
\newcommand*\newfloat@setwithout[1]{%
\newfloat@setwithin{#1}{none}}
\define@key{@newfloat}{without}[]{%
\def\newfloat@within@value{none}}
\newcommand*\newfloat@setchapterlistsgaps[2]{%
\edef\@tempa{#2}%
\def\@tempb{off}%
\ifx\@tempa\@tempb
\@chapterlistsgap@off{#1}%
\else
\def\@tempb{on}%
\ifx\@tempa\@tempb
\@chapterlistsgap@on{#1}%
\else
\newfloat@Error{Invalid value `#2' for option `chapterlistsgaps'}%
\fi
\fi}
\define@key{@newfloat}{chapterlistsgaps}{%
\def\newfloat@chapterlistsgaps@value{#1}}
\providecommand*\@removefromreset[2]{{%
\expandafter\let\csname c@#1\endcsname\@removefromreset
\def\@elt##1{%
\expandafter\ifx\csname c@##1\endcsname\@removefromreset
\else
\noexpand\@elt{##1}%
\fi}%
\expandafter\xdef\csname cl@#2\endcsname{%
\csname cl@#2\endcsname}}}
\newcommand*\newfloat@announce[2]{%
\@cons\newfloat@list{{#1}}%
\@cons\newfloat@@list{{#1}}%
\newfloat@ifundefined{newfloat@ext@#2}{%
\@namedef{newfloat@ext@#2}{#1}%
\ifcsname c@lofdepth\endcsname
\newfloat@ifundefined{c@#2depth}{%
\newcounter{#2depth}%
\setcounter{#2depth}{1}}%
\fi
\ifcsname addtotoclist\endcsname
\addtotoclist[float]{#2}%
\newfloat@def{listof#2name}{\@nameuse{list#1name}}%
\fi
}%
\ifcsname contentsuse\endcsname
\contentsuse{#1}{#2}%
\fi
\newfloat@hook{#1}}
\@onlypreamble\newfloat@announce
\newcommand*\newfloat@@list{}
\newcommand*\SetupFloatingEnvironment[1]{%
\newfloat@addtolist{#1}%
\newfloat@setoptions{#1}}
\newcommand\ForEachFloatingEnvironment{%
\@ifstar
{\@ForEachFloatingEnvironment\@gobble}%
{\@ForEachFloatingEnvironment\@iden}}
\newcommand\@ForEachFloatingEnvironment[2]{%
\def\@elt##1{#2}%
\newfloat@list
\let\@elt\relax
#1{\newfloat@addtohook{#2}}}
\providecommand\newfloat@addtohook[1]{%
\toks@=\expandafter{\newfloat@hook{##1}#1}%
\edef\@tempa{\def\noexpand\newfloat@hook####1{\the\toks@}}%
\@tempa}
\providecommand*\newfloat@hook[1]{}
\newcommand\PrepareListOf[1]{%
\expandafter\g@addto@macro\csname newfloat@listof#1@hook\endcsname}
\@onlypreamble\PrepareListOf
\newcommand*\newfloat@list{}
\newcommand*\newfloat@addtolist[1]{%
\newfloat@ifinlist{#1}{}{%
\ifcsname ext@#1\endcsname
\@cons\newfloat@list{{#1}}%
\@namedef{newfloat@ext@\@nameuse{ext@#1}}{#1}%
\newfloat@let{@ifchapterlistsgap@#1}{\@iden}%
\else
\newfloat@Error{`#1' does not seem to be a floating environment}%
\fi}}
\newcommand*\newfloat@ifinlist[1]{%
\let\next\@secondoftwo
\begingroup
\expandafter\let\csname c@#1\endcsname\newfloat@ifinlist
\def\@elt##1{%
\expandafter\ifx\csname c@##1\endcsname\newfloat@ifinlist
\global\let\next\@firstoftwo
\fi}%
\newfloat@list
\endgroup
\next}
\ifcsname ext@figure\endcsname
\newfloat@addtolist{figure}
\fi
\ifcsname ext@table\endcsname
\newfloat@addtolist{table}
\fi
\ifcsname @chapter\endcsname
\providecommand*\@chapterlistsgap{10\p@}%
\providecommand*\@addchapterlistsgap[2]{%
\@nameuse{@ifchapterlistsgap@#1}{% if switched on
\@@addchapterlistsgap{#1}{#2}}}
\providecommand*\@@addchapterlistsgap[2]{%
\@ifundefined{@addchapterlistsgap@#2}{% only once per extension
\@namedef{@addchapterlistsgap@#2}{#1}%
\@@@addchapterlistsgap{#2}}{}}
\providecommand*\@@@addchapterlistsgap[1]{%
\ifdim \@chapterlistsgap>\z@
\addtocontents{#1}{\protect\addvspace{\@chapterlistsgap}}%
\fi}
\providecommand*\@addchapterlistsgaps{%
\begingroup
\def\@elt##1{%
\@expandtwoargs\@addchapterlistsgap{##1}{\@nameuse{ext@##1}}}%
\newfloat@list
\endgroup}
\providecommand*\@chapterlistsgap@off[1]{%
\expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@gobble
\ifcsname unsettoc\endcsname
\@expandtwoargs\unsettoc{\@nameuse{ext@#1}}{chapteratlist}%
\fi}
\providecommand*\@chapterlistsgap@on[1]{%
\expandafter\let\csname @ifchapterlistsgap@#1\endcsname\@iden
\ifcsname setuptoc\endcsname
\@expandtwoargs\setuptoc{\@nameuse{ext@#1}}{chapteratlist}%
\fi}
\fi
\define@key{newfloat}{chapterlistsgap}{%
\renewcommand*\@chapterlistsgap{#1}}
\define@key{newfloat}{within}{%
\def\newfloat@within@default{#1}% set new default value
\def\@elt##1{\newfloat@setwithin{##1}{#1}}%
\newfloat@list
\let\@elt\relax}
\define@key{newfloat}{without}[]{%
\KV@newfloat@within{none}}
\def\@elt#1{%
\define@key{newfloat}{#1name}{%
\newfloat@setname{#1}{##1}}%
\define@key{newfloat}{list#1name}{%
\newfloat@setname{list#1}{##1}}%
\define@key{newfloat}{#1within}{%
\newfloat@setwithin{#1}{##1}}%
\define@key{newfloat}{#1without}[]{%
\newfloat@setwithout{#1}}%
}%
\newfloat@list
\let\@elt\relax
\define@key{newfloat}{planb}[true]{%
\def\@tempa{#1}%
\def\@tempb{false}%
\ifx\@tempa\@tempb
\let\newfloat@ifplanb\@gobble
\else
\def\@tempb{true}%
\ifx\@tempa\@tempb
\let\newfloat@ifplanb\@iden
\else
\newfloat@Error{Invalid value `#1' for option `planb'}%
\fi
\fi}
\define@key{newfloat}{planb-fileext}{%
\newfloat@Info{Setting Plan B file extension to `#1'}
\xdef\newfloat@addtocontents@ext{#1}}
\let\@tempc\relax
\@expandtwoargs\setkeys{newfloat}{planb,\@ptionlist{\@currname.\@currext}}%
\AtEndOfPackage{\let\@unprocessedoptions\relax}
\newcommand*\newfloatsetup{\setkeys{newfloat}}
\newcommand\newfloat@replace@chapter[2]{%
\begingroup
\let\if@twocolumn\iffalse
\let\if@mainmatter\iffalse
\let\if@thema\iffalse
\def\@tempa[##1]##2{#1}%
\ifx\@tempa\@chapter
\gdef\@chapter[##1]##2{#2}%
\global\let\newfloat@replace@chapter\@gobbletwo
\else\ifx\@tempa\Hy@org@chapter
\gdef\Hy@org@chapter[##1]##2{#2}%
\global\let\newfloat@replace@chapter\@gobbletwo
\fi\fi
\endgroup}
\ifcsname @chapter\endcsname \else
\let\newfloat@replace@chapter\@gobbletwo
\fi
\newfloat@replace@chapter{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
}{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\newfloat@replace@chapter{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
}{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\newfloat@replace@chapter{%
\refstepcounter{chapter}%
\ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
\else \let\@secnumber\thechapter \fi
\typeout{\chaptername\space\@secnumber}%
\def\@toclevel{0}%
\ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
\else \@tocwriteb\tocchapter{chapter}{#2}\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\@makechapterhead{#2}\@afterheading
}{%
\refstepcounter{chapter}%
\ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
\else \let\@secnumber\thechapter \fi
\typeout{\chaptername\space\@secnumber}%
\def\@toclevel{0}%
\ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
\else \@tocwriteb\tocchapter{chapter}{#2}\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\@makechapterhead{#2}\@afterheading}
\@ifpackageloaded{tocbasic}{%
\let\newfloat@replace@chapter\@gobbletwo}{}
\ifcsname insertchapterspace\endcsname
\renewcommand*\insertchapterspace{\@addchapterlistsgaps}
\let\newfloat@replace@chapter\@gobbletwo
\fi
\newfloat@replace@chapter{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}\toc@font0 #1}%
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
}{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}\toc@font0 #1}%
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
% boek(3).cls [2004/06/07 v2.1a NTG LaTeX document class]
\newfloat@replace@chapter{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}\toc@font0 #1}%
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi
}{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}\toc@font0 #1}%
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\else
\addcontentsline{toc}{chapter}{\toc@font0 #1}%
\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\newfloat@replace@chapter{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\chaptername\space\thechapter.}
\if@thema
\ifx\@shortauthor\@empty
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}%
\else
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}%
\@shortauthor\hfill\mbox{}\vskip\normallineskip #1}%
\fi
\else
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}
\fi
\else
\addcontentsline{toc}{chapter}{#1}
\fi
\chaptermark{#1}
\addtocontents{lof}{\protect\addvspace{10pt}}
\addtocontents{lot}{\protect\addvspace{10pt}}
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]
\else
\@makechapterhead{#2}
\@afterheading
\fi
}{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\chaptername\space\thechapter.}%
\if@thema
\ifx\@shortauthor\@empty
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}%
\else
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}%
\@shortauthor\hfill\mbox{}\vskip\normallineskip #1}%
\fi
\else
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\@addchapterlistsgaps
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\ifx\newfloat@replace@chapter\@gobbletwo \else
\newfloat@InfoNoLine{%
Unsupported document class, or \noexpand\@chapter\MessageBreak
was already redefined by another package}
\newfloat@InfoNoLine{\string\@chapter\space=\space\meaning\@chapter}
\newfloat@InfoNoLine{\string\Hy@org@chapter\space=\space\meaning\Hy@org@chapter}
\newfloat@ifplanb{%
\newfloat@InfoNoLine{Trying Plan B..}%
\let\newfloat@addtocontents@ORI\addtocontents
\long\def\addtocontents#1#2{%
\newfloat@addtocontents{#1}{#2}#2\addvspace\newfloat@nil}%
\long\def\newfloat@addtocontents#1#2#3\addvspace#4\newfloat@nil{%
\def\newfloat@tempa{#4}%
\ifx\newfloat@tempa\@empty
\newfloat@addtocontents@ORI{#1}{#2}%
\else
\ifx\newfloat@addtocontents@ext\@undefined
\newfloat@Info{Setting Plan B file extension to `#1'...}%
\xdef\newfloat@addtocontents@ext{#1}%
\fi
\edef\newfloat@tempa{#1}%
\ifx\newfloat@tempa\newfloat@addtocontents@ext
\begingroup
\let\addtocontents\newfloat@addtocontents@ORI
\@addchapterlistsgaps
\endgroup
\fi
\fi}}
\fi
\newcommand\newfloat@ForEachNew[2][newfloat@@list]{%
\AtBeginDocument{%
\ifcsname#1\endcsname
\def\@elt##1{#2}%
\newfloat@@list
\let\@elt\relax
\fi}}%
\@onlypreamble\newfloat@ForEachNew
%% \begin{macrocode}
\newfloat@ForEachNew[float@exts]{%
\@nameuse{@ifchapterlistsgap@#1}{% if switched on
\let\float@do=\relax
\edef\@tempa{%
\noexpand\float@exts{\the\float@exts\float@do{\@nameuse{ext@#1}}}}%
\@tempa}}
\newfloat@ForEachNew[FP@floatBegin]{%
\newcounter{FP@#1C}%
\newenvironment{FP#1}{\FP@floatBegin{#1}}{\FP@floatEnd}}
\providecommand*\ext@lstlisting{lol}%
\newfloat@ForEachNew[@rotfloat]{%
\newenvironment{sideways#1}{\@rotfloat{#1}}{\end@rotfloat}%
\newenvironment{sideways#1*}{\@rotdblfloat{#1}}{\end@rotdblfloat}}
\newcommand*\newfloat@For@SC[2]{%
\def#1{b}% = \sidecaptionvpos{#2}{b} (v1.6)
\newenvironment{SC#2}%
{\SC@float[#1]{#2}}{\endSC@float}%
\newenvironment{SC#2*}%
{\SC@dblfloat[#1]{#2}}{\endSC@dblfloat}}
\@onlypreamble\newfloat@For@SC
\newfloat@ForEachNew[SC@float]{%
\expandafter\newfloat@For@SC\csname SC@#1@vpos\endcsname{#1}}
\newfloat@ForEachNew[wrapfloat]{%
\newenvironment{wrap#1}{\wrapfloat{#1}}{\endwrapfloat}}
\endinput
%%
%% End of file `newfloat.sty'.

118
sty/caption/subcaption.sty Normal file
View File

@ -0,0 +1,118 @@
%%
%% This is file `subcaption.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% subcaption.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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,
%% caption3.dtx, bicaption.dtx, ltcaption.dtx, subcaption.dtx, and newfloat.dtx,
%% the derived files caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty, and newfloat.sty,
%% and the user manuals caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: subcaption.sty 62 2013-02-03 10:40:15Z sommerfeldt $
\ProvidesPackage{subcaption}[\caption@tempa v1.1-\caption@tempb Sub-captions (AR)]
\RequirePackage{caption}[2012/03/25] % needs v3.3 or newer
\caption@AtBeginDocument{\caption@ifcompatibility{%
\caption@Error{%
The `subcaption' package does not work correctly\MessageBreak
in compatibility mode}}{}}
\@ifpackageloaded{subfigure}{%
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfigure package}%
{RTFM}%
\endinput}{}%
\@ifpackageloaded{subfig}{%
\PackageError{subcaption}%
{This package can't be used in cooperation\MessageBreak
with the subfig package}%
{RTFM}%
\endinput}{}%
\caption@SetupOptions{subcaption}{\captionsetup[sub]{#2}}%
\caption@ExecuteOptions{subcaption}{%
font+=small,labelformat=parens,labelsep=space,skip=6pt,list=0,hypcap=0}
\caption@ProcessOptions*{subcaption}
\caption@ForEachType{\DeclareCaptionSubType{#1}}
\def\subcaption{%
\caption@iftype
{\setcaptionsubtype*\caption}%
{\caption@Error{\noexpand\subcaption outside float}%
\caption@gobble}}%
\g@addto@macro\caption@subtypehook{%
\let\subcaption\caption}
\newcommand*\phantomsubcaption{%
\caption@iftype
{\setcaptionsubtype*\phantomcaption}%
{\caption@Error{\noexpand\phantomsubcaption outside float}}}%
\g@addto@macro\caption@subtypehook{%
\let\phantomsubcaption\phantomcaption}
\caption@For{subtypelist}{%
\newenvironment{sub#1}%
{\caption@withoptargs\subcaption@minipage}%
{\endminipage}}%
\newcommand*\subcaption@minipage[2]{%
\minipage#1{#2}%
\setcaptionsubtype\relax}
\newcommand*\subcaptionbox{%
\caption@withoptargs{\caption@ibox\setcaptionsubtype}}
\g@addto@macro\caption@subtypehook{%
\ifx\label\subcaption@label \else
\let\subcaption@ORI@label\label
\let\label\subcaption@label
\fi}
\newcommand*\subcaption@label{
\caption@withoptargs\subcaption@@label}
\newcommand*\subcaption@@label[2]{%
\@bsphack\begingroup
\subcaption@ORI@label#1{#2}%
\let\SK@\@gobbletwo
\protected@edef\@currentlabel{\csname thesub\@captype\endcsname}%
\subcaption@ORI@label#1{sub@#2}%
\endgroup\@esphack}
\DeclareRobustCommand*\subref{%
\@ifstar
{\caption@withoptargs\subcaption@ref*}%
{\caption@withoptargs\@subref}}
\newcommand*\@subref[2]{%
\caption@ifundefined\hyperref
{\subcaption@ref{#1}{#2}}%
{\hyperref[#2]{\subcaption@ref{*#1}{#2}}}}
\newcommand*\subcaption@ref[2]{%
\begingroup
\caption@setoptions{sub}%
\subcaption@reffmt\p@subref{\ref#1{sub@#2}}%
\endgroup}
\newcommand*\p@subref{}
\DeclareCaptionOption{subrefformat}{\subcaption@setrefformat{#1}}
\newcommand*\subcaption@setrefformat[1]{%
\@ifundefined{caption@lfmt@#1}%
{\caption@Error{Undefined label format `#1'}}%
{\expandafter\let\expandafter\subcaption@reffmt\csname caption@lfmt@#1\endcsname}}
\subcaption@setrefformat{simple}
\endinput
%%
%% End of file `subcaption.sty'.

104
sty/caption/totalcount.sty Normal file
View File

@ -0,0 +1,104 @@
%%
%% This is file `totalcount.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% totalcount.dtx (with options: `package')
%%
%% Copyright (C) 1994-2013 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
%%
%% http://sourceforge.net/projects/latex-caption/
%%
%% --------------------------------------------------------------------------
%%
%% 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
%% CHANGELOG, README, SUMMARY, caption.ins,
%% caption.dtx, caption2.dtx, caption3.dtx,
%% bicaption.dtx, ltcaption.dtx, subcaption.dtx,
%% newfloat.dtx, and totalcount.dtx
%% the derived files
%% caption.sty, caption2.sty, caption3.sty,
%% bicaption.sty, ltcaption.sty, subcaption.sty,
%% newfloat.sty, and totalcount.sty
%% and the user manuals
%% caption-deu.tex, caption-eng.tex, and caption-rus.tex.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\def\caption@tempa$Id: #1 #2 #3-#4-#5 #6${%
\def\caption@tempa{#3/#4/#5 }\def\caption@tempb{#2 }}
\caption@tempa $Id: totalcount.sty 92 2013-05-12 09:06:59Z sommerfeldt $
\ProvidesPackage{totalcount}[\caption@tempa v1.0-\caption@tempb Total values of counters (AR)]
\newcommand*\DeclareTotalCounter[1]{%
\newcounter{totalcount@#1}%
\@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}%
\@namedef{total#1es}{\@nameuse{total#1s}}%
\expandafter\newif\csname iftotal#1s\endcsname
\@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}%
\AtBeginDocument{\@ifundefined{c@#1}%
{\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
{\@cons\totalcount@counters{{#1}}}}}
\@onlypreamble\DeclareTotalCounter
\let\totalcount@counters\@empty
\newcommand*\totalcount@xspace{}
\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}}
\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
\ProcessOptions\relax
\ifx\totalcount@xspace\@empty\else
\RequirePackage{xspace}
\fi
\newcommand*\totalcount@addtocounter[1]{%
\@ifundefined{c@totalcount@#1}{}{%
\addtocounter{totalcount@#1}{\value{#1}}}}
\let\totalcount@stpelt@ORI\@stpelt
\renewcommand*\@stpelt[1]{%
\totalcount@addtocounter{#1}%
\totalcount@stpelt@ORI{#1}}
\newcommand*\totalcount@set[2]{%
\@ifundefined{c@totalcount@#1}%
{}%
{\global\@namedef{total#1s}{#2\totalcount@xspace}%
\ifnum#2=0\relax \else
\global\@nameuse{total#1strue}%
\fi}}
\AtBeginDocument{\AtEndDocument{%
\begingroup
\@tempswafalse
\if@filesw
\immediate\write\@mainaux{%
\string\providecommand\string\totalcount@set[2]{}}%
\fi
\def\@elt#1{%
\totalcount@addtocounter{#1}%
\edef\totalcount@tempa{\the\value{totalcount@#1}}%
\expandafter\let\expandafter\totalcount@tempb\csname total#1s\endcsname
\@expandtwoargs\totalcount@set{#1}{\totalcount@tempa}%
\expandafter\ifx\csname total#1s\endcsname\totalcount@tempb \else
\@tempswatrue
\fi
\if@filesw
\immediate\write\@mainaux{%
\string\totalcount@set{#1}{\totalcount@tempa}}%
\fi}%
\totalcount@counters
\if@tempswa
\PackageWarningNoLine{totalcount}{%
Total counter(s) have changed.\MessageBreak
Rerun to get them right}%
\fi
\endgroup}}%
\endinput
%%
%% End of file `totalcount.sty'.

202
sty/lineno/ednmath0.sty Normal file
View File

@ -0,0 +1,202 @@
%% Macro package `ednmath0.sty' for LaTeX2e,
%% copyright (C) 2004 Uwe L\"uck,
%% http://www.contact-ednotes.sty.de.vu
%% --author-maintained;
%% math support for `lineno.sty' and `ednotes.sty'.
%%
\def\fileversion{v0.2b} \def\filedate{2005/01/10}
%% 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.3a of the License, or any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% There is NO WARRANTY.
%% This code is very EXPERIMENTAL!
%%
%% Please report bugs, problems, and suggestions via
%%
%% http://www.contact-ednotes.sty@web.de
%
%% * MAIN FEATURE *
%
% lineno.sty's \linelabel and ednotes.sty's commands are enabled
% to work in math mode if it's "entered in outer mode"
% (including `displaymath' and `equation' environments).
% (lineno.sty is the package by Stephan Boettcher.)
% They will even work in tabular environments that are adjusted
% to notes by package `edtable.sty'.
%
% CAVEATS:
% -- Does not work yet in environments like LaTeX's
% `eqnarray'. (This could probably repaired along the lines
% of Edtable.sty--we're short of time and will try later.)
% -- Useful error messages when (i) math mode is entered from
% inner mode or when (ii) a math display gets not line number
% are missing at present.
%
%% * USAGE: *
%
% * Most simple: *
% --If you are working with ednotes and want to use its
% commands in math mode, load ednotes.sty--version 0.8
% onwards--with its package option `mathnotes'.
% --If you don't work with ednotes, only with lineno, you
% get the main feature of making \linelabel work in math mode
% by loading lineno.sty--version 4.1 onwards--with its
% package option `mathrefs'.
%
% * Switch off and on: *
% To reduce danger resulting from missing error messages
% ("caveat" above), you may switch these new math facilities
% off by \NoNotesToMath where you don't expect to need them.
% You may switch them on again by \NotesToMath where you want
% to use them, being aware of the danger. Both commands work
% locally, so you can replace one of them by enclosing it in
% a group. E.g., even, after \NoNotesToMath you can use an
% environment as follows:
% \begin{NotesToMath}
% <text>
% \end{NotesToMath}
% (I am not quite sure that this is useful.)
%
% * Customize ellipsis: *
% ednotes' \lemmaellipsis is changed to expand to
% \mathlemmaellipsis when entering math, and this is preset
% to be LaTeX's \mathellipsis. (This is three dots as
% \mathinner.) You can change this by redefining
% \mathlemmaellipsis, e.g.:
% \renewcommand{\mathlemmaellipsis}{\cdots}
% If you need \cdots as the ellipsis at a single place only,
% you may, of course, use the `<...>' option of \<, e.g.:
% $ x = \Anote{a\<<\cdots>bcd\>e}{Indeed?} - y $
%
% * Customize note mode: *
% For variant readings, you may want that the note is
% usually set in math mode--so you may want that you
% needn't type the dollar signs in the note text.
% Note that you can do this by customizing \notefmt,
% and you can do this by customizing \Anotefmt (e.g.)
% to have this feature for \Anote only.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ednmath0}[\filedate\space\fileversion\space
math support for lineno/ednotes (ul)]
%
%% User commands:
\def\NotesToMath{\let\@LN@mathhook\@LN@labelinmath
\@bsphack \@esphack
% For \begin{NotesToMath}
}
\def\NoNotesToMath{\@bsphack
\def\@LN@mathhook{\@parmoderr\@gobble}%
\@esphack
}
\def\endNotesToMath{\@bsphack\@Esphack}
\let\endNoNotesToMath\endNotesToMath
%
%% Core code for lineno.sty:
\@ifundefined{@LN@postlabel}{%
\PackageError{ednmath0}{%
Bad lineno.sty version%
}{%
lineno.sty from 2004/08/16 or later
must be loaded earlier.%
}%
}{%
\def\@LN@labelinmath#1{%
\ifmmode
\@LN@postlabel{#1}%
\else
\@parmoderr
\fi
}
}
%
%% Core code for ednotes.sty:
\@ifundefined{@EN@note}{%
% v0.01 sent a warning in this case. Considered superfluous now.
}{%
\def\@EN@themathlemmatag{%
\ifmmode
\toks@\expandafter{\@EN@lemmatag}%
\edef\@EN@lemmatag{%
$%
\def\noexpand\lemmaellipsis{%
\noexpand\mathlemmaellipsis}%
\the\toks@
$%
}%
% \expandafter \def \expandafter \@EN@lemmatag
% \expandafter {\expandafter $\expandafter
% \def \expandafter \lemmaellipsis \expandafter {%
% \expandafter \mathlemmaellipsis \expandafter }%
% \@EN@lemmatag $}%
\fi
}
% To be sure, \lemmaellipsis doesn't need to be changed when
% ednotes `\<...\>' feature is not used. Though I prefer to
% use one hook only in ednotes for both situations, with and
% without `\<...\>'.
%
% The final \unskip in ednotes' \@EN@lemmatag would undo a final
% \quad. That's OK: outside math the same happens.
% In v0.01, \NoNotesToMath undid ednotes changes for math mode.
% However, re-appearence of \linelabel error messages suffices.
%
% Now add lemma switch to the left of \[No]NotesToMath:
\toks@\expandafter{\NotesToMath}
\edef\NotesToMath{%
\let \noexpand\@EN@mathlemmatag \noexpand\@EN@themathlemmatag
\the\toks@
}
% \typeout{\string\NotesToMath: \meaning\NotesToMath}
\toks@\expandafter{\NoNotesToMath}
\edef\NoNotesToMath{%
\let \noexpand\@EN@mathlemmatag \relax
\the\toks@
}
% \typeout{\string\NoNotesToMath: \meaning\NoNotesToMath}
}
% We need no extra device for a choice for users whether the *note*
% should be set in math mode or in horizontal mode by default
% (which might depend on the kind ["layer"] of notes).
% This can be done already by customization of ednotes' \notefmt.
% However, we might change ednotes' default \notefmt to default
% \renewcommand*{\notefmt}[1]{$#1$}
%
\let\mathlemmaellipsis\mathellipsis
%% TODO: Since when has LaTeX provided \mathellipsis?
%% -> \Needs...
%
% Default:
\NotesToMath
%
\endinput
%% TODO: Without \linenumberdisplaymath, in displaymath,
%% an error should be shown. Use, e.g., that in a displaymath
%% \ifinner is false.
%% TODO: E.g., by changing \everymath, perhaps can be warned
%% that the math group is in a box already, so the vertical
%% items will get lost.
%% TODO: Adjust `eqnarray' (in Edtable?) as well.
%% VERSION HISTORY:
v0.01 2004/08/16 First version, sent to Christian.
v0.02 2004/08/16 Considerably simplified for ednotes.
2004/08/19 Added ellipsis stuff, documentation, and
instructions. Uncapitalized package names.
Added \end[No]NotesToMath.
2004/08/20 Added \@bsphack and \@esphack; corrected
ednotes extension (too much deleted, completely
wrong), introducing \@EN@themathlemmatag.
v0.02b .../08/31 Rearranged preamble concerning maintenance.
v0.1 2004/09/20 Removed mentions of `linenox0.sty'.
v0.2 2004/10/07 Removed another mention of `linenox0.sty';
Instructions: `lineno' or `ednotes.sty' option.
v0.2a 2004/11/07 LPPL v1.3a.
v0.2b 2005/01/10 Contact via http.

571
sty/lineno/edtable.sty Normal file
View File

@ -0,0 +1,571 @@
%% `edtable.sty'---Uwe L"uck, direction Christian Tapp.
%% LaTeX package for tables with line numbers and
%% editorial notes.
%%
%% Copyright (C) 2003-2005 Uwe L"uck--author-maintained.
%%
\def\fileversion{1.3c} \def\filedate{2005/10/03}
%%
%% This file can be redistributed and/or modified under
%% the terms of the LaTeX Project Public License; either
%% version 1.3 of the License, or any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% We did our best to help you, but there is NO WARRANTY.
%%
%% Please send your comments via
%%
%% http://www.contact-ednotes.sty.de.vu
%%
%% * USAGE: *
%
% *Requirements/overview:*
%
% The package is made for the background of the LaTeX2e macro
% package and enhances functionality of the following packages:
% 1.) Stephan I. B"ottcher's `lineno.sty' for printing line
% numbers in the margin and a \label version \linelabel
% relating labels to line numbers;
% 2.) our `ednotes.sty' for indicating variant readings and
% other editorial remarks in separate footnote apparatuses;
% 3.) David Carlisle's `longtable.sty' for multi-page tables.
% %% TODO: supertabular etc.!?
% 4.) our `ltabptch.sty' for a patch of `longtable.sty'
% (i.e., optionally, see below).
%
% Actually, only the first package is necessary for using the
% present one. The present one needs your line numbering commands
% according to the first one and its documentation to which we
% refer here. We likewise refer to the remaining packages for the
% details of their functionality.
%
% `lineno.sty' version 4.1 and (in case it is used) `ednotes.sty'
% version 0.8 (onwards) are needed. For obtaining recent versions
% of required packages, see the CTAN folder
% /macros/latex/contrib/ednotes.
%
% *Install/load:*
% 1.) To be used, the present file must be put into a folder
% that (La)TeX searches. You should have obtained a file
% containing more detailed hints about this.
% 2.) We recommend loading this file *not* by
% \usepackage[<options>]{edtable} but by loading `lineno.sty'
% or `ednotes.sty' with package option `edtable'.
% 3.) To use the package options `longtable' and
% `nolongtablepatch' that are described below, enter them
% as options for `lineno.sty' or `ednotes.sty'.
%
% *User Commands:*
%
% 1. The package defines an environment `edtable' -- for its
% syntax we consider two cases:
% (a) Let <stdtable> be a tabular environment "like `tabular'".
% "Like" here means: (i) we have tested it with `tabular', but
% it should work with many more (e.g., from the `array' and
% `tabularx' packages) -- which share certain properties of
% implementation and requirements. Sorry, you must try, or we
% hope you will (and tell us). (For wizards: <stdtable> may
% probably be anything using a single \halign and \tabskip=0pt.)
% Definitively:
% (ii) LaTeX's standard `array' and other environments are *not*
% "like" `tabular'. Namely, environments that work only in math
% mode are not meant here. They are considered below in `b.'.
% (iii) `longtable' from the `longtable' package of the `tools'
% bundle neither is meant. An option of the present package
% deals with it as described below. Neither `supertabular' is
% meant.
% (iv) In general, usage with tabular environments that can
% break across pages as in (iii) is not recommended, at least
% when working with `ednotes.sty'. Even if some worked here, a
% shortcoming with `ednotes.sty' would be that the footnotes can
% appear on bad pages.
% -- Now the syntax is:
% \begin{edtable}{<stdtable>}<args><entries>\end{edtable}
% -- where <args> and <entries> are usual arguments and entries
% for <stdtable>. So an example is:
% \begin{edtable}{tabular}{cc}
% left upper & right upper \\ left lower & right lower
% \end{edtable}
% This produces just what <stdtable> does in an extra line,
% only adding line numbers in the margin and processing `ednotes'
% commands in the entries appropriately.
% (b) Let <stdarray> be an "array environment" like -- standard
% LaTeX's `array'! "Like" here means (i) ... analogously to
% <stdtable> above. (ii) "Text" ... oh, sorry, this is not clear
% to me at present, and I am in a hurry. %% TODO
% (iii) Nothing from the `amsmath' package seems to work here,
% sorry, I have tried a lot ... (iv) For standard LaTeX's
% `eqnarray', it is better to try the `linenomath' environment
% of `lineno.sty' [with package option `mathlines']. Its
% modifications in `amsmath' produce (at best) a spurious line
% number with the `linenomath' environment (up to now).
% -- Now the syntax is:
% \begin{edtable}[<$$$>]{<stdarray>}
% <args><entries>\end{edtable}
% -- where <args> and <entries> are usual arguments and entries
% for <stdarray>. <$$$> can be one of `$' or `$$'. Indeed, the
% <stdtable> syntax above (without [<$$$>]) *does not work*
% inside $...$ or $$...$$. -- An example:
% \begin{edtable}[$$]{array}{cc}
% a_{11} & a_{12} \\ a_{21} & a_{22}
% \end{edtable}
% Now, this produces just what <stdarray> does in an extra line
% etc. as with <stdtable>. However, \linelabel and `ednotes.sty'
% footnotes may need the `mathrefs' option of `lineno.sty'. For
% the difference between `[$]' and `[$$]', see below.
%
% 2. When working with `ednotes.sty', in
% \Anote{L1\<L2\>L3}{NOTE}
% L2 may contain &'s and \\'s, but L1, L3 must not! Analogously
% for \Bnote, etc., \Anotelabel...\donote..., etc. -- Well this
% holds for <stdtable>, hardly for <stdarray> ... %% TODO
%
% 3. On positioning: You may have wondered about `extra line'
% above. This means that `edtable' starts a new line at
% \begin{edtable} and at \end{edtable}. %% TODO: sure!?
% (a) It should be placed within a `center', `flushleft', or
% `flushright' environment for proper (vertical) spacing, but
% also works without. However, with <stdarray> and optional
% parameter `$$' of `edtable' (i.e., \begin{edtable}[$$]...),
% you can obtain the usual math display spacing *within a
% paragraph*; especially, the vertical space is less when the
% previous line is short ... and so on.
% (b) Horizontal positioning of line numbers (usually) needs a
% second run (after changing a table)! %% TODO: automatic warning.
% (For wizards: It may fail if some of \leftskip, \rightskip,
% \linewidth, and \@totalleftmargin are used in an unusual way.)
% A <dimen> register \ETextraoffset is provided whose value is
% 0pt by default and which additionally moves line numbers
% to the left (right) if given a positive (negative) value.
% %% TODO: any use?
%
% *Package options:*
%
% 1. Option `longtable' adjusts the `longtable' environment
% defined by David Carlisle's longtable.sty for use with
% `lineno.sty' and `ednotes.sty'. The option makes `longtable'
% environments appear with line numbers in the margin, according
% to `lineno.sty', and process `ednotes.sty' commands if line
% numbering is active according to `lineno.sty'.
% [We maintain an alternative package with just this function
% in a slightly different implementation.] %% -> ulnltab.sty.
% Lemmas may go across table entries as with `edtable' (see above).
% ---There might be options like `supertabular' for adjusting
% other tabular environments that cannot be handled by the
% `edtable' environment provided here---they have not been
% implemented yet! %% TODO
%
% 2. Option `nolongtablepatch' avoids loading/asking for
% `ltabptch.sty'. I.e.: according to LaTeX bugs database,
% tools/3180 and tools/3485, there have been problems with
% vertical spacing around `longtable' environments. By default
% the present package loads our `ltabptch.sty' or asks for it.
% Option `nolongtablepatch' overrides this. This is useful when
% you don't want to have the patch, especially when you use an
% "emergency stop" installation of TeX.
%
% *Wizard interface:*
% Macros \@ET@makeLineNumber, \@ET@use@outerhook,
% \@ET@execute@outerhook, \@ET@ampnotes \@ET@startlinewith,
% \@ET@trivialize@linelabel are provided as tools for adjusting
% tabular environments for use with `lineno.sty' and
% `ednotes.sty'. \@ET@step@linenumber is \let \stepLineNumber
% (from `lineno.sty'), but could be used as a hook for
% something different. See Environment `edtable' and Option
% `longtable' below for examples of application.
% %% TODO: specification here.
%
%
%% * Acknowledgements: *
%
% Stephan I. B"ottcher told us how to do it in extensive discussion
% and by providing some first code lines. We changed these essentially
% in some respects, but kept his general ideas and some parts of his
% macros, the latter even without knowing what we are doing.
%
% v1.3 is due to a request by Martin Brandenburg.
%
% * Now for internals: *
%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
% 1994/12/01: \newenvironment* etc. %% TODO: more recent needed?
\ProvidesPackage{edtable}[\filedate\space v\fileversion\space
arrays with lineno + ednotes (ul)]
%
% Alternative ideas for implementation:
% 1. There is a German package `TABMAC' enhancing `EDMAC' (cf.
% documentation of `ednotes.sty'). We could have rewritten its
% macros so it would work with `lineno.sty' and `ednotes.sty'
% in place of `EDMAC'. [TODO: "tabmac.sty"]
% 2. We redefine `longtable' by Option `longtable' because
% there seems to be only one reasonable use of the `longtable'
% environment in the course of a critical edition. This may be
% different for environments like `array' and `tabular' which
% can be used within text lines. Therefore, these environments
% are not redefined.
% 3. One might use \everycr, however: (a) it is executed
% before the first row, (b) it is executed in fake lines that
% `longtable' uses.
% 4. As an alternative to \everycr, there is the approach of
% redefining \cr and \crcr for setting \noalign. This needs
% redefining \@tabularcr etc.---not nice. We use this approach
% here for `longtable' which uses a stretching \tabskip.
% For \tabskip=0pt, we attach line numbers by a template.
%
% \RequirePackage{lineno}[2004/10/06]
% Wanted to check lineno version--causes unknown option error.
% See LaTeX bug latex/3730.
% Options:
%% TODO: underful page with `longtable.sty'!?
\let\if@ET@longtable\iffalse % \newif\if@ET@longtable@
\DeclareOption{longtable}{\let\if@ET@longtable\iftrue}
\let\if@ET@ltabptch\iftrue
\DeclareOption{nolongtablepatch}{\let\if@ET@ltabptch\iffalse}
\ProcessOptions
% Redefine \longtable if option:
\if@ET@longtable
% Stephan's direction for attaching a line number to each row
% is using \noalign in the course of \\.
% However, (1) the user should not worry about closing the table
% with \\ or without, and (2) the line number thing should not
% happen twice if \\ is the last token before \end{longtable}.
% Our solution: attach something to the beginning of \endlongtable
% which attaches line number unless an unsucceeded \\ has done it.
% This thing is activated by each row start and turned off by \\.
% Since the switch at row start may happen to be in a pbox,
% let it act globally on \endlongtable. (The \crcr at the beginning
% of \endlongtable must not be changed directly, since original
% \crcr may be required in table entries using \oalign etc.)
%
\RequirePackage{longtable}%
% \IfFileExists{longtable.sty}{\RequirePackage{longtable}}%
% {\RequirePackage{longtabl}}%
% For Atari problem, it suffices to rename `longtable.sty'
% into `longtabl.sty'.
%
% Patch for tools/3180 and tools/3485 of LaTeX bug database:
\if@ET@ltabptch
\IfFileExists{ltabptch.sty}{\RequirePackage{ltabptch}}{%
\PackageError{edtable}{%
ltabptch.sty (for improving spacing around\MessageBreak
longtable) missing! Be sure to use it always\MessageBreak
or never!%
}{%
To omit ltabptch.sty *and* escape this error,\MessageBreak
use package option `nolongtablepatch'.%
}%
}
\fi
\let\@ET@@longtable\longtable
\def\longtable{%
\ifLineNumbers
\expandafter\@ET@longtable
\else
\let\@ET@sw@cr\@ET@crcr % ... in \endlongtable.
\expandafter\@ET@@longtable
\fi
}
\def\@ET@longtable{%
% Since we have made it anyway, we use the method of redefining
% \halign for inserting the activating row start as well.
% However, redefinition must be repeated before every \LT@bchunk.
% \longtable and \LT@get@withs are good places for this.
\@ET@startlinewith\@ET@sw@cr@on
\@ET@trivialize@linelabel
\@ET@use@outerhook
\@ET@ampnotes
\let\LT@tabularcr\@ET@LT@tabularcr
\expandafter\def\expandafter\LT@get@widths\expandafter
{\LT@get@widths\@ET@startlinewith\@ET@sw@cr@on}
% Admittedly, we could make it less of a hack by using @{...}
% ---we could then leave \LT@get@widths untouched.
\@ET@@longtable
}
\def\@ET@sw@cr@on{\global\let\@ET@sw@cr\@ET@cr@attach}
% We are hacking a longtable version offering
% \def\LT@tabularcr{%
% \relax\iffalse{\fi\ifnum0=`}\fi
% \@ifstar
% {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr
% \LT@t@bularcr}%
% {\LT@t@bularcr}}
% We need a redefinition of \cr which is not overridden by \@ifstar:
\def\@ET@LT@tabularcr{%
\relax\iffalse{\fi\ifnum0=`}\fi
\def\cr{\@ET@sw@cr}%
% So \crcr is affected by change of \@ET@sw@cr, cf. below.
\let\crcr\cr
\@ifstar
{\gdef\@ET@sw@nobreak{\nobreak
\global\let\@ET@sw@nobreak\relax}%
% {\def\cr{\@ET@sw@cr\noalign{\nobreak}}\let\cr\crcr
% Why didn't this work? %% TODO: try shorter again.
\LT@t@bularcr}%
\LT@t@bularcr
% {\let\cr\@ET@sw@cr \let\crcr\cr
% \LT@t@bularcr}% This accompanied \def\cr... above.
}
% Attach \@ET@sw@cr to beginning of \endlongtable:
\expandafter\def\expandafter\endlongtable\expandafter
{\expandafter\@ET@sw@cr\endlongtable}
\def\@ET@cr@attach{% Actually attaching line numbers.
\@ET@crcr\noalign{% Basically Stephan's approach.
% If we were not careful, following box containing line number
% could fool interline glue after longtable, even if tools/3485
% is repaired in some way. This box should have same depth as
% the line composed previously.
\nobreak %% \@ET@ex... might cause page break. 2003/10/30.
\setbox\z@\@ET@makeLineNumber
\ht\z@-\prevdepth \dp\z@\prevdepth \box\z@
\@ET@step@linenumber
\global\let\@ET@sw@cr\@ET@crcr % ... if called by \\.
% This also resets the \crcr starting \LT@echunk following
% \@xargarraycr or \@yargarraycr in \LT@argtabularcr.
% \let...\relax seems to suffice at well, but in case ...
\@ET@execute@outerhook %% 2003/10/30.
\@ET@sw@nobreak
% \@ET@execute@outerhook
}%
}
\let\@ET@crcr\crcr
\global\let\@ET@sw@nobreak\relax % Just to remind ...
\fi
\let\@ET@step@linenumber\stepLineNumber
% \def\@ET@step@linenumber{\global\advance\c@linenumber\@ne}
\def\@ET@makeLineNumber{\hb@xt@\z@{\makeLineNumber}}
%% TODO: export to lineno.sty!?
% Special \halign:
% For `array' etc., we insert line numbers by a leftmost template.
% @{...} in the last argument of `array' etc. is difficult for this
% since `tabular*' has an additional argument. So we redefine
% \halign to put something to the right of the next \bgroup.
% Now, as a macro, \halign would break in an \edef or \xdef.
% Horribly, this danger has become quite real in longtable.sty's
% definition of \LT@bchunk. Only its latest version 4.10 has
% preceded \halign by a \noexpand (for mathtext.sty which
% redefines \halign as well). We need not rely on such a
% provision if we let \halign expand to \the<token register>
% for some token register. However, using \toks@ or \@temptokena
% is neither very safe---might be filled by macro ahead with
% something new. So reserve an own token register.
\newtoks\@ET@toks
\@ET@toks{\@ET@specialhalign}
% v1.3: In 'AMSmath', there are \halign's followed by explicit
% left braces. Thus '\def\@ET@specialhalign#1\bgroup{%' broke.
%% TODO ...
\def\@ET@specialhalign{%
\ifmeasuring@ \expandafter\@firstoftwo
% v1.3 2005/03/04, for `amsmath'.
\else \expandafter\@secondoftwo
\fi
{\let\halign\@ET@@halign \halign}%
{\@ifnextchar\bgroup\@ET@replace@arg\@ET@sphalign@to}}
%% TODO: change back, commenting out code above, report
%% error with `alignat'.
% \@ifnextchar\bgroup\@ET@replace@arg\@ET@sphalign@to}
% If `amsmath' not loaded (v1.3):
\AtBeginDocument{\@ifundefined{measuring@true}{%
\let\ifmeasuring@\iffalse}\relax}
\def\@ET@replace@arg#1{%
\def\@EN@tempa{#1}\def\@EN@tempb{\bgroup}% Corr. after v1.3b.
\ifx\@EN@tempa\@EN@tempb
\def\@EN@tempa{\@ET@sphalign@to\bgroup}%
\else
\def\@EN@tempa{\@ET@sphalign@to{#1}}%
% This may be wrong, #1 might be `t' from `to' ...
\fi
\@EN@tempa}
\def\@ET@sphalign@to#1\bgroup{%
\let\halign\@ET@@halign % Reset for nested arrays.
\halign#1\bgroup
% \ifmeasuring@\else % For `amsmath', moved backwards.
\@ET@startline % [Wizard interface, via \@ET@starlinewith.]
% \fi
}
% Wizard interface:
\def\@ET@startlinewith{% Next token precedes preamble.
% \let\@ET@@halign\halign % Or \AtBeginDocument?
% ... indeed: bad loop with long longtable (\LT@get@widths!?)
\def\halign{\the\@ET@toks}%
\let\@ET@startline
}
\AtBeginDocument{\let\@ET@@halign\halign}
% Or save it at start of environment only
% (don't repeat inside longtable).
%
% Outer hook for inserts: (wizard interface)
\def\@ET@execute@outerhook{% To be placed outside inner mode.
\@ET@outerhook \global\let\@ET@outerhook\@empty
}
\global\let\@ET@outerhook\@empty % Just to remind: global!
% \@EN@hookfn (ednotes) sends to outer hook:
\def\@ET@use@outerhook{% Wizard interface.
\def\@EN@hookfn{\g@addto@macro\@ET@outerhook}%
}%% TODO: move last line to `ednotes', \let\@ET@use...\@empty.
%% But this requires re-installing both packages
%% at the same time. See the `ampnotes' thing as well.
%
% Trivialize \linelabel: (wizard interface)
\def\@ET@trivialize@linelabel{\let\linelabel\@ET@linelabel}
\def\@ET@linelabel{%
\protected@edef\@currentlabel{\theLineNumber}%
\label
}
% Change ampersand at \Anote etc.: (wizard interface)
%% 2003/10/31.
% & is changed by \Anote etc. No \begin...\endgroup,
% next \\ or & after % note/donote command switches back.
% ---Global change seems to break table setup.
\begingroup
\gdef\@ET@hideamps{\catcode`\&\active}
\@ET@hideamps
\gdef\@ET@ampnotes{%
\let&\@ET@hideamp
%% & would be undefined after \\ in lemma.
\let\@ET@EN@rnote\@EN@note
\def\@EN@note{\@ET@hideamps\@ET@EN@rnote}%
\let\@ET@EN@rnotelb\@EN@notelabel
\def\@EN@notelabel{\@ET@hideamps\@ET@EN@rnotelb}%
}
%% TODO: & and \\ in \@EN@lemmaexpands!?
\endgroup
\def\@ET@hideamp{&}
\newenvironment*{edtable}[2][]{%
% #1 $ or $$, #2 standard environment name.
%% TODO: star version!? cf. lineno.sty's `numquote'.
\def\@ET@mode{#1}%
\def\@ET@currenvir{#2}%
\ifhmode \ifnum\the\lastpenalty=-\@M\else
% \par must be executed for printing/stopping line numbers:
\@centercr\relax \noindent
\fi \fi
\ifvmode \noindent \fi % Otherwise linenumbers are indented
% -- however, not recommended.
\@ET@use@outerhook
\@ET@trivialize@linelabel
\@ET@ampnotes
\@ET@startlinewith\@ET@normal@startline
\global\advance\c@linenumber\m@ne % Stepping correction.
% (Must come after closing previous paragraph.)
% Calculate offset:
\global\advance\c@ET@array\@ne
% Saving/calling width of table (`longtable's algorithm).
% Test if there is \@flushglue on the left (center or flushleft):
\edef\@EN@tempa{\the\@flushglue}%
% ... v1.3: fool this for "$$".
\in@{$$}{#1\@nil}% \in@{#1}{#2} searches #1 in #2#1 ...
\edef\@EN@tempb{\the\ifin@\@flushglue\else\leftskip\fi}%
\ifx\@EN@tempa\@EN@tempb
% Assume \@ET@offset is 0pt else here.
\@ET@offset\linewidth
\advance\@ET@offset-%
\@ifundefined\@ET@arraywidth@csn % Shortened for v1.3.
{\linewidth\G@refundefinedtrue
\PackageWarningNoLine{edtab}{^^JLine numbers at
\@ET@currenvir\space need \jobname.aux}}%
{\csname\@ET@arraywidth@csn\endcsname}%
% Test if \@flushglue on the right (center):
% ... v1.3: fool it again. Repeat \in@ in case ...
\in@{$$}{#1\@nil}%
\edef\@EN@tempb{\the\ifin@\@flushglue\else\rightskip\fi}%
\ifx\@EN@tempa\@EN@tempb \divide\@ET@offset\tw@ \fi
\fi
\advance\@ET@offset\@totalleftmargin
\advance\@ET@offset\ETextraoffset % Offset ready.
\setbox\@tempboxa\hbox\bgroup
% v1.3: `alignat' complains later when this is \vbox instead.
% \vbox\bgroup % Tried in vain.
\ifx\@ET@mode\@empty\else $\fi
\csname#2\endcsname
}{%
\csname end\@ET@currenvir \endcsname
\ifx\@ET@mode\@empty\else $\fi
\egroup
\@ET@step@linenumber % Stepping correction.
\if@filesw
\immediate\write\@auxout{%
\gdef\expandafter\noexpand
\csname\@ET@arraywidth@csn\endcsname
{\the\wd\@tempboxa}}%
%% TODO: warning if changed!?
\fi
% No automatic line number at array line:
\nolinenumbers
\@ET@mode\ensuremath{\vcenter{\box\@tempboxa}}\@ET@mode % v1.3.
\@ET@execute@outerhook
\ifhmode \@centercr\relax \fi
% \par must be executed for proper restart of printing line numbers
% (think so).
\@endpetrue % Outside \@flushglue environment, avoid indent ahead.
%% TODO: slightly change for math mode around? Or give an error
%% in math mode.
}
%% TODO: make \edtable \outer!?
\def\@ET@normal@startline{%
\@ET@step@linenumber
\llap{\@ET@makeLineNumber \hskip\@ET@offset}%
}
\newdimen\@ET@offset
\newdimen\ETextraoffset
%% TODO: export to lineno.sty!?
\newcount\c@ET@array
\def\@ET@arraywidth@csn{ET@a@\romannumeral\c@ET@array}
%
%% TODO: .dtx
\endinput
%% VERSION HISTORY:
v0.22 2003/01/13 First version, named `edtab02.sty', sent around,
together with ednotes.sty.
v0.23 2003/01/22 Added version history.
v0.24 2003/01/27 Copyright notice.
%%% v0.3 2003/03/03 Requires linenox0.sty. %% RETREATED
%% TODO: reconsider, see `lineno[x].sty'.
v0.25 2003/03/05 Added <ednotes.sty@web.de>.
v0.26 2003/03/23 Added \@ET@startlinewith to wizard command list;
moved redefinition \LT@get@widths from option code
into \@ET@longtable so this really happens in
line number mode only; moved \let\@ET@@halign\halign
from \@ET@startlinewith to \AtBeginDocument.
v0.27 2003/06/02 Added \ifvmode \noindent \fi to `edtable' definition;
2003/06/10 added `lemma cannot run' to instructions.
v0.28 2003/10/31 \@ET@cr@attach: moved \@ET@execu..., added \nobreak.
Added \@ET@ampnotes and documentation: now working
across entries.
v1.0 2004/05/13 `ednotes.sty' etc., updated copyright. Renamed as
`edtable.sty' for TUGboat article.
\RequirePackage{lineno}, changed doc. accordingly.
Removed `may be released under different name'.
v1.10 2004/07/27 Looking for `longtabl.sty' for my Atari!
2004/08/22 Added warning (screen/documentation) concerning
ltabptch.sty.
2004/08/23 Added suggestion of option `nolongtablepatch';
LPPL v1.3.
v1.2 2004/08/31 Rearranged preamble concerning maintenance,
removed `preliminary release'.
2004/10/06 \newif -> \let...; option `nolongtablepatch';
changed documentation accordingly and for
loading edtable.sty by lineno/ednotes option;
\let\@ET@step@linenumber\stepLineNumber; use
\ifLineNumbers.
2004/10/07 Needed version numbers.
2004/10/08 ltabptch warning -> error!
2004/10/11 Disabled \RequirePackage{lineno}[...]; undid
the `longtabl.sty' thing from 2004/07/27.
2004/10/12 latex/3730.
v1.2a 2004/11/07 LPPL v1.3a.
v1.2b 2005/01/10 Contact via http.
v1.3b 2005/03/04 Support for environments like `array'
environment. The description of `edtable' was
wrong in this respect!
v1.3 2005/03/07 Adaptations in documentation, and extended usage
instructions very much, correcting some
errors as well. Acknowledgement to M. B.
v1.3a 2005/03/09 Corrected numbering in `usage'.
v1.3c 2005/03/15 \@centercr\relax, TODO on math mode.
2005/04/09 `editory' -> `editorial'.

1149
sty/lineno/fnlineno.sty Normal file

File diff suppressed because it is too large Load Diff

3484
sty/lineno/lineno.sty Normal file

File diff suppressed because it is too large Load Diff

74
sty/lineno/vplref.sty Normal file
View File

@ -0,0 +1,74 @@
%% `vplref.sty'
%% -- extended line number referencing with lineno.sty.
\def\filedate{2005/04/25} \def\fileversion{0.2a}
%% Copyright (C) 2004, 2005 Uwe Lueck,
%% http://contact-ednotes.sty.de.vu --author-maintained
%% -- support of lineno.sty for varioref.sty.
%% This file can be redistributed and/or modified under
%% the terms of the LaTeX Project Public License; either
%% version 1.3 of the License, or any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% We did our best to help you, but there is NO WARRANTY.
%% USAGE:
%
% \vpagelineref{<label>} expands to
%
% a) \ref{<label>}
% -- if on same page as \linelabel{<label>}
%
% b) \LineWithPage{<label>} -- otherwise.
%
% \LineWithPage{<label>} expands -- by default -- to
%
% \pageref{<label>}.\ref{<label>}
%
% This can be customized by editing
%
% \renewcommand*{\LineWithPage}[1]{\pageref{#1}.\ref{#1}}
%
% in your document preamble, after vplref.sty has been loaded
% (which may have happened through lineno.sty with option
% `addpageno').
%% IMPLEMENTATION:
\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \Declare...*
\ProvidesPackage{vplref}[\filedate\space v\fileversion \space
page-line cross-refs] %% UL 2011/02/13
\AtBeginDocument{\RequirePackage{lineno,varioref}}
%% Anderer Ansatz: GPNo (\FirstOnPage)
\DeclareRobustCommand*\vpagelineref[1]{{%
% \def\reftextcurrent{\lineref{#1}}%% First vpageref arg.
\let\reftextfaraway\LineWithPage
\def\reftextafter{\reftextfaraway{#1}}%
\let\reftextbefore\reftextafter
\let\reftextfaceafter\reftextafter
\let\reftextfacebefore\reftextafter
%% <- Looks somewhat stupid, but varioref.sty has its merits
%% as compared with the mechanism in ednotes.sty.
\vpageref[\ref{#1}][]{#1}%% The robust alternative.
%% Here and with \LineWithPage, \lineref seems more appropriate
%% than \ref, but it produces errors when labels have not been
%% defined. This seems to be an incompatibility with lineno.sty.
}}
%% Customizable format for different page:
\newcommand*\LineWithPage[1]{\pageref{#1}.\ref{#1}}
\endinput
VERSION HISTORY:
v0.1 2004/10/19 First, sent to Sergei Mariev.
v0.11 2004/10/19 Fit to recent varioref version;
sent to Sergei.
v0.2 2005/04/25 \Require... \AtBeginDocument.
v0.2a 2011/02/13 add. caption to \ProvidesPackage

Binary file not shown.

View File

@ -1,7 +1,7 @@
%!PS-Adobe-2.0
%%Creator: dvips(k) 5.993 Copyright 2013 Radical Eye Software
%%Title: thesis.dvi
%%CreationDate: Mon Apr 21 23:20:22 2014
%%CreationDate: Tue Apr 22 17:45:44 2014
%%Pages: 39
%%PageOrder: Ascend
%%BoundingBox: 0 0 596 842
@ -11,9 +11,9 @@
%%DocumentPaperSizes: a4
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -o thesis.ps thesis.dvi
%DVIPSCommandLine: dvips thesis.dvi -o thesis.ps
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2014.04.21:2320
%DVIPSSource: TeX output 2014.04.22:1745
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S