|
% |
|
% bxproofstyle.sty |
|
% |
|
%% package declaration |
|
\NeedsTeXFormat{LaTeX2e} |
|
\ProvidesPackage{bxproofstyle} |
|
|
|
%% preparations |
|
\RequirePackage{amsthm} |
|
|
|
%%-------------------------------------- |
|
|
|
%% \bxpy@style |
|
% Current proof-like style. (macro) |
|
\def\bxpy@style{plain} |
|
|
|
%%<*> \newprooflikestyle{<name>}{<space above>}{<space below>} |
|
% {<body font>}{<indent amount>}{<proof head font>} |
|
% {<punctuation after head>}{<space after head>} |
|
\newcommand{\newprooflikestyle}[8]{% |
|
\toks@{#4}% |
|
\def\@tempa{#8}\ifx\space\@tempa |
|
\toks@\@xp{\the\toks@ \thm@headsep\fontdimen\tw@\font\relax}% |
|
\else |
|
\def\@tempb{\newline}% |
|
\def\bxpy@tempa{\par}% |
|
\ifx\@tempb\@tempa |
|
\toks@\@xp{\the\toks@ \thm@headsep\z@skip |
|
\def\thmheadnl{\newline}}% |
|
\else\ifx\bxpy@tempa\@tempa |
|
\toks@\@xp{\the\toks@ \thm@headsep\z@skip |
|
\def\thmheadnl{\par}}% |
|
\else |
|
\toks@\@xp{\the\toks@ \thm@headsep#8\relax}% |
|
\fi\fi |
|
\fi |
|
\begingroup |
|
\thm@space@setup |
|
\@defaultunits\dimen@#5\z@skip\relax\@nnil |
|
\@defaultunits\@tempskipa#2\thm@preskip\relax\@nnil |
|
\@defaultunits\@tempskipb#3\thm@postskip\relax\@nnil |
|
\xdef\@gtempa{\thm@preskip\the\@tempskipa |
|
\thm@postskip\the\@tempskipb |
|
\parindent\the\dimen@\relax}% |
|
\endgroup |
|
\@temptokena\@xp{\@gtempa |
|
\thm@headfont{#6}\thm@headpunct{#7}% |
|
}% |
|
\@xp\xdef\csname bxpy@s@#1\endcsname{\the\toks@ \the\@temptokena}% |
|
} |
|
|
|
%%<*> \prooflikestyle{<name>} |
|
\newcommand{\prooflikestyle}[1]{% |
|
\@ifundefined{bxpy@s@#1}{% |
|
\PackageWarning{amsthm}{Unknown proofstyle `#1'}% |
|
\def\bxpy@style{plain}% |
|
}{% |
|
\edef\bxpy@style{#1}% |
|
}% |
|
} |
|
|
|
%% \bxpy@s@plain |
|
% The 'plain' style uses the default values. |
|
\def\bxpy@s@plain{} |
|
|
|
%%<*> \newprooflike{<env name>}{<label>} |
|
\newcommand{\newprooflike}{\bxpy@new@prooflike} |
|
\def\bxpy@new@prooflike#1#2{% |
|
\@xp\bxpy@ifdefinable\csname #1\endcsname{% |
|
\global\@xp\let\csname end#1\endcsname\bxpy@endprooflike |
|
\@xp\xdef\csname#1\endcsname{\@nx\bxpy@prooflike |
|
{\@xp\@nx\csname bxpy@s@\bxpy@style\endcsname}{#2}}}% |
|
} |
|
|
|
%% \bxpy@ifdefinable\CS{<proc>} |
|
% Same as \@ifdefinable except that "\proof" is treated as definable. |
|
\def\bxpy@cs@proof{\proof} |
|
\def\bxpy@ifdefinable#1{% |
|
\def\bxpy@tempa{#1}% |
|
\ifx\bxpy@tempa\bxpy@cs@proof |
|
\expandafter\@firstofone |
|
\else |
|
\expandafter\@ifdefinable\expandafter#1% |
|
\fi |
|
} |
|
|
|
%% \bxpy@prooflike |
|
\def\bxpy@prooflike#1#2{% |
|
\pushQED{\qed}% |
|
\normalfont |
|
\let\thmheadnl\relax |
|
\thm@headfont{\itshape}% |
|
\thm@headpunct{.}% add period after heading |
|
\thm@headsep \labelsep |
|
\thm@preskip=6\p@\@plus6\p@\relax |
|
\thm@postskip=\thm@preskip |
|
#1% style overrides |
|
% Here vertical spacing is processed in normal way of trivlist |
|
\topsep \thm@preskip |
|
\def\bxpy@label{#2}% |
|
\bxpy@prooflike@a |
|
} |
|
\def\bxpy@prooflike@a{% |
|
\@ifnextchar[%] |
|
{\bxpy@prooflike@b}{\bxpy@prooflike@a[\bxpy@label]}% |
|
} |
|
\def\bxpy@prooflike@b[#1]{% |
|
\par \trivlist |
|
\advance\@topsepadd-\thm@preskip % |
|
\advance\@topsepadd\thm@postskip % |
|
\item[\hskip\labelsep \the\thm@headfont |
|
#1\@addpunct{\the\thm@headpunct}]% |
|
\hskip-\labelsep \hskip\thm@headsep |
|
\ifx\thmheadnl\relax\else |
|
\leavevmode\thmheadnl |
|
\fi |
|
\ignorespaces |
|
} |
|
|
|
%% \bxpy@endprooflike |
|
\def\bxpy@endprooflike{% |
|
\popQED\endtrivlist\@endpefalse |
|
} |
|
|
|
%%-------------------------------------- |
|
\endinput |