From 927462188c1b8bcf23079bb691ea8f6d1a80abe9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 6 Aug 2008 23:40:48 +0000 Subject: xpackages update (6aug08) git-svn-id: svn://tug.org/texlive/trunk@10126 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/xpackages/xtheorem-test.tex | 98 +++++ .../texmf-dist/source/latex/xpackages/xtheorem.dtx | 416 +++++++++++++++++++++ .../texmf-dist/source/latex/xpackages/xtheorem.ins | 58 +++ 3 files changed, 572 insertions(+) create mode 100644 Master/texmf-dist/source/latex/xpackages/xtheorem-test.tex create mode 100644 Master/texmf-dist/source/latex/xpackages/xtheorem.dtx create mode 100644 Master/texmf-dist/source/latex/xpackages/xtheorem.ins (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/xpackages/xtheorem-test.tex b/Master/texmf-dist/source/latex/xpackages/xtheorem-test.tex new file mode 100644 index 00000000000..48c28658d3b --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xtheorem-test.tex @@ -0,0 +1,98 @@ +% \iffalse +%% File xo-balance.tex +%% (C) Copyright 1999 Achim Blumensath +%% (C) Copyright 2004 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3a of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xtheorem bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +%% $Id: xtheorem-test.tex 274 2004-11-29 19:51:15Z mittelba $ +%% +% \fi +% +\documentclass{article} + +\usepackage{xtheorem} + +\DeclareInstance{theoremstyle}{example}{std} +{ + pre-skip = 1cm, + post-skip = 1cm, + body-style = \ttfamily, + head-style = \sffamily, + post-head-action = \newline, +} + + +\newtheorem{plain}{Thm}{Theorem}[section] +\newtheorem{plain}{Prop}[Thm]{Proposition} +\newtheorem{plain}{Lem}[Thm]{Lemma} +\newtheorem{plain}{Cor}[Thm]{Corollary} +\newtheorem{definition}{Def}[Thm]{Definition} +\newtheorem*{remark}{Rem}{Remark} +\newtheorem*{example}{Exam}{Example} + +\begin{document} + +\section{First Section} + +\begin{Def} +\emph{My package} is the \textsf{xtheorem} package. +\end{Def} +\begin{Thm} +My package works as advertised. +\end{Thm} +\begin{Cor}[Achim] +It can be used. +\end{Cor} +\begin{Rem} +This is good. +\end{Rem} + +\section{Second Section} + +\begin{Def} +\emph{My package} is the \textsf{xtheorem} package. +\end{Def} +\begin{Thm} +My package works as advertised. +\end{Thm} +\begin{Cor}[Achim] +It can be used. +\end{Cor} +\begin{Exam}[Frank] +An this shows a new style. +\end{Exam} +\begin{Rem} +This is good. +\end{Rem} + +\stop diff --git a/Master/texmf-dist/source/latex/xpackages/xtheorem.dtx b/Master/texmf-dist/source/latex/xpackages/xtheorem.dtx new file mode 100644 index 00000000000..c7b8ab8803d --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xtheorem.dtx @@ -0,0 +1,416 @@ +% \iffalse +%% File xtheorem.dtx +%% (C) Copyright 1999 Achim Blumensath +%% (C) Copyright 2004 2006 2008 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xtheorem bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%<*driver|package> +\RequirePackage{l3names} +% +%\fi +\GetIdInfo$Id: xtheorem.dtx 754 2008-08-03 19:30:38Z morten $ + {Experimental theorem package} +%\iffalse +%<*driver> +%\fi +\ProvidesFile{\filename.\filenameext} + [\filedate\space v\fileversion\space\filedescription] +%\iffalse + \documentclass{ltxdoc} + \usepackage{textcomp} + +% \usepackage{xparse,xlists,xlists-samples} +% \usepackage{ldcdoc} + +% next three definitions are big hacks to run the file +% without the above packages +% +\newcommand\NoValue{\texttt{\textbackslash NoValue}} + +\newenvironment{TemplateInterfaceDescription}[1] + {\subsection{The Template Type `#1'}% + \begingroup\description + \def\TemplateArgument##1##2{\item[Arg: ##1]##2\par}% + \def\TemplateSemantics{\enddescription\endgroup + \subsubsection*{Semantics:}}% + } + {\par\bigskip} + +\newenvironment{TemplateDescription}[2] + {\subsection{The Template `#2' (type #1)}% + \subsubsection*{Attributes:}% + \begingroup\description + \def\TemplateKey##1##2##3##4{\item[##1 (##2)]##3% + \ifx\TemplateKey##4\TemplateKey\else +% \hskip0ptplus3em\penalty-500\hskip 0pt plus 1filll Default:~##4% + \hfill\penalty500\hbox{}\hfill Default:~##4% + \nobreak\hskip-\parfillskip\hskip0pt\relax + \fi + \par}% + \def\TemplateSemantics{\enddescription\endgroup + \subsubsection*{Semantics \& Comments:}}% + } + {\par\bigskip} + + \begin{document} + \DocInput{xtheorem.dtx} + \end{document} +% +% \fi +% +% +% +% \title{The \textsf{xtheorem} package\thanks{This file +% has version number \fileversion, last +% revised \filedate.}} +% \author{AB} +% \date{\filedate} +% +% \maketitle +% +% \tableofcontents +% +% \begin{abstract} +% This is a conversion of the AMS theorem classes to the template +% system. Only the interface was changed, the internals still use +% \LaTeXe\ commands. +% \end{abstract} +% +% \section{Interfaces} +% +% \begin{TemplateInterfaceDescription}{theoremstyle} +% +% \TemplateArgument{1} +% {Text of the number of the theorem (e.g., \verb|A.1|), or +% \NoValue\ to indicate that the theorem is unnumbered.} +% +% \TemplateArgument{2} +% {Name of the theorem (e.g. \verb|Theorem|, \verb|Lemma|).} +% +% \TemplateArgument{3} +% {Additional note (e.g. \verb|see [12]|), or \NoValue.} +% +% \TemplateSemantics +% +% This template starts a new environment, typesets the head of a +% theorem, and sets fonts for the body of the theorem. The +% environment is ended by an \verb|\@endtheorem| command. +% +% If the first argument is given, it is printed as the number part. +% The second argument contains the name of the theorem, and the +% third one may contain an additional note. +% +% For instance, the arguments \verb|2.1|, \verb|Lemma|, and +% \verb|Rabin~1960| could produce the output +% +% \medskip +% \noindent\textbf{Lemma 2.1 }(Rabin 1960)\textbf. +% +% \medskip\noindent +% where the following text is set in italic. +% +% \end{TemplateInterfaceDescription} +% +% +% \begin{TemplateDescription}{theoremstyle}{std} +% +% \TemplateKey{pre-skip}{l} +% {Skip above the theorem.} +% {|topsep|} +% \TemplateKey{post-skip}{l} +% {Skip below the theorem.} +% {|topsep|} +% \TemplateKey{body-style}{f0} +% {Commands to be executed before the body of the theorem in +% order to set fonts, etc.} +% {italic} +% \TemplateKey{head-style}{f0} +% {Commands to set the font of the head.} +% {bold} +% \TemplateKey{note-style}{f0} +% {Commands to set the font of the note.} +% {medium upright font} +% \TemplateKey{head-punct}{f0} +% {Text after the head.} +% {|.|} +% \TemplateKey{head-format}{f3} +% {Format of the head.} +% {Name Number (Note)} +% \TemplateKey{head-indent}{l} +% {Indent of the head.} +% {none} +% \TemplateKey{head-sep}{l} +% {Space after the head.} +% {5pt $\pm$ 1pt} +% \TemplateKey{post-head-action}{f0} +% {Command to be executed after the head (e.g., a line break).} +% {none} +% +% \TemplateSemantics +% This are all parameters provided by the AMS package, except `swaphead' +% which can be simulated by \verb|head-format|. +% +% \end{TemplateDescription} +% +% \paragraph{Problem.} +% The current solution for `head-format' is very clumsy. Perhaps it would +% be better to pass just the name of a template which does the layout +% instead of the actual code. +% +% \medskip +% \DescribeMacro\newtheorem +% The \verb|\newtheorem| command defines a new type of theorem. It takes +% the following arguments: +% +% \medskip +% \verb|\newtheorem|[|*|]$\langle$style$\rangle$\relax +% $\langle$name$\rangle$[share counter]$\langle$label$\rangle$\relax +% [count relative] +% +% \medskip\noindent +% and defines an environment named `name'. The arguments have the +% following meanings: +% \begin{description} +% \item[|*|] If present the theorem is unnumbered, otherwise it is +% numbered. +% \item[style] The name of an instace of the `theoremstyle' template +% which is used to typeset the theorem. +% \item[name] The name of the new environment. +% \item[share counter] (optional) The label of another defined theorem. +% If present both kinds of theorem share a common counter. +% \item[label] The name of the theorem which should appear in its head. +% \item[count relative] If present the counter is reset to 1 everything +% the counter with this name is changed (e.g., |section| or |chapter|). +% \end{description} +% +% For instance, the following definitions create environments named +% |Thm|, |Prop|, |Lem|, |Cor|, |Def|, |Rem|, and |Exam|. The first +% five share a common counter which is relative to the current +% section, the last two are unnumbered. +% \begin{verbatim} +% \newtheorem{plain}{Thm}{Theorem}[section] +% \newtheorem{plain}{Prop}[Thm]{Proposition} +% \newtheorem{plain}{Lem}[Thm]{Lemma} +% \newtheorem{plain}{Cor}[Thm]{Corollary} +% \newtheorem{definition}{Def}[Thm]{Definition} +% \newtheorem*{remark}{Rem}{Remark} +% \newtheorem*{remark}{Exam}{Example} +% \end{verbatim} +% +% \section{Implementation} +% +% \begin{macrocode} +%<*package> +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\RequirePackage{xparse} +\RequirePackage{template} +% \end{macrocode} +% +% \begin{macrocode} +\DeclareTemplateType{theoremstyle}{3} + +\skip_new:N \TS_pre_skip +\skip_new:N \TS_post_skip +\dim_new:N \TS_head_indent_dim +\skip_new:N \TS_head_sep_skip + +\DeclareTemplate{theoremstyle}{std}{3} +{ + pre-skip =l [\DelayEvaluation{\topsep}] \TS_pre_skip, + post-skip =l [\DelayEvaluation{\topsep}] \TS_post_skip, + body-style =f0 [\itshape] \TS_body_style_tlp, + head-style =f0 [\bfseries] \TS_head_style_tlp, + note-style =f0 [\fontseries\mddefault\upshape] \TS_note_style_tlp, + head-punct =f0 [.] \TS_head_punct_tlp, + head-format =f3 [\IfNoValueF{#1}{#1\IfNoValueF{#2}{\space}} + \IfNoValueF{#2}{\textup{#2}} + \IfNoValueF{#3}{\space{\TS_note_style_tlp(#3)}}] + \TS_head_format:nnn, + head-indent =l [0pt] \TS_head_indent_dim, + head-sep =l [5pt plus 1pt minus 1pt] \TS_head_sep_skip, + post-head-action =f0 [] \TS_post_head_action_tlp +} +{ + \DoParameterAssignments + \if_mode_horizontal: + \prg_whiledo:nT{ + \int_compare:nNnT \etex_lastnodetype:D = \c_eleven + }{\tex_unskip:D} + \par + \fi: + \normalfont + \trivlist + \let:NN\thmheadnl\scan_stop: + \@topsep\TS_pre_skip + \@topsepadd\TS_post_skip + \IfNoValueF{#1} + {\refstepcounter{#1}} + \deferred@thm@head{ + \TS_head_style_tlp + \skip_horizontal:N \TS_head_indent_dim + \IfNoValueTF{#1} + {\TS_head_format:nnn{#2}{#1}{#3}} + {\TS_head_format:nnn{#2}{\cs_use:c{the#1}}{#3}} + \TS_head_punct_tlp + \TS_post_head_action_tlp + \skip_horizontal:N\TS_head_sep_skip + } + \TS_body_style_tlp + \ignorespaces +} +% \end{macrocode} +% These functions are used by the template above. They are copied +% straight away from amsclass.dtx. +% \begin{macrocode} +\let:NN\adjust@parskip@nobreak \@nbitem +% \end{macrocode} +% +% \begin{macrocode} +\toks_new:N\dth@everypar +\toks_set:Nn \dth@everypar{ + \@minipagefalse + \global\@newlistfalse + \if@inlabel + \global\@inlabelfalse + \begingroup + \setbox\z@\lastbox + \ifvoid\z@ \kern-\itemindent \fi + \endgroup + \unhbox\@labels + \fi + \if@nobreak + \@nobreakfalse + \clubpenalty\@M + \else + \clubpenalty\@clubpenalty + \everypar{} + \fi +} +% \end{macrocode} +% +% \begin{macrocode} +\def\deferred@thm@head#1{% + \if@inlabel \indent \par \fi % eject a section head if one is pending + \if@nobreak + \adjust@parskip@nobreak + \else + \addpenalty\@beginparpenalty + \addvspace\@topsep + \addvspace{-\parskip}% + \fi + \global\@inlabeltrue + \everypar\dth@everypar + \sbox\@labels{\normalfont#1}% + \ignorespaces +} +% \end{macrocode} +% The usual styles `plain', `definition', and `remark'. +% \begin{macrocode} +\DeclareInstance{theoremstyle}{plain}{std}{} + +\DeclareInstance{theoremstyle}{definition}{std} +{ + body-style = \normalfont +} + +\DeclareInstance{theoremstyle}{remark}{std} +{ + pre-skip = \DelayEvaluation{0.5\topsep}, + post-skip = \DelayEvaluation{0.5\topsep}, + body-style = \normalfont, + head-style = \itshape +} +% \end{macrocode} +% The command to end a theorem. +% \begin{macrocode} +\def:Npn\@endtheorem{\endtrivlist\@endpefalse } +% \end{macrocode} +% +% |newtheorem| just checks all cases and defines the appropriate +% environment. +% \begin{macrocode} +\DeclareDocumentCommand{\newtheorem}{smmomo} +{ + \exp_args:Nc\@ifdefinable{#3} + { + \IfBooleanTF{#1} + { + \DeclareDocumentEnvironment{#3}{o} + {\UseInstance{theoremstyle}{#2}{\NoValue}{#5}{##1}} + {\@endtheorem} + } + { + \IfNoValueTF{#4} + { + \IfNoValueTF{#6} + { + \newcounter{#3} + } + { + \newcounter{#3}[#6] + \gdef:cpx{the#3}{\exp_not:c{the#6} + \@thmcountersep\@thmcounter{#3}} + } + \DeclareDocumentEnvironment{#3}{o} + {\UseInstance{theoremstyle}{#2}{#3}{#5}{##1}} + {\@endtheorem} + } + { + \cs_if_free:cTF{c@#4} + { + \@nocounterr{#4} + } + { + \gdef:cpx{the#3}{\exp_not:c{the#4}} + \DeclareDocumentEnvironment{#3}{o} + {\UseInstance{theoremstyle}{#2}{#4}{#5}{##1}} + {\@endtheorem} + } + } + } + } +} +% \end{macrocode} +% +% \begin{macrocode} +\endinput +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% +% \Finale +% +\endinput diff --git a/Master/texmf-dist/source/latex/xpackages/xtheorem.ins b/Master/texmf-dist/source/latex/xpackages/xtheorem.ins new file mode 100644 index 00000000000..990b28c066c --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xtheorem.ins @@ -0,0 +1,58 @@ +% \iffalse +%% +%% This file will generate fast loadable files and documentation +%% driver files from the dtx files in this package when run through +%% LaTeX or TeX. +%% +%% (C) Copyright 2000-2004 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3a of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xtheorem bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +%% $Id: xtheorem.ins 274 2004-11-29 19:51:15Z mittelba $ +%% +% \fi +% +% +\input docstrip +\keepsilent +\askforoverwritefalse + +\preamble + +Not for distribution +\endpreamble + +\generate{ + \file{xtheorem.sty}{\from{xtheorem.dtx}{package,trace}} + } + +\endbatchfile -- cgit v1.2.3