diff options
author | Karl Berry <karl@freefriends.org> | 2012-12-10 01:29:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-12-10 01:29:36 +0000 |
commit | 64b7e39503022a8c0ce58857cea7f25d57369757 (patch) | |
tree | aa8a571f48b7c1f0717b3520ed33d5be2ea934bf /Master/texmf-dist/tex/latex | |
parent | d70fc5174aac1404c89261fb356e7e552f4b48aa (diff) |
chet (9dec12)
git-svn-id: svn://tug.org/texlive/trunk@28481 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/chet/chet.sty | 386 |
1 files changed, 91 insertions, 295 deletions
diff --git a/Master/texmf-dist/tex/latex/chet/chet.sty b/Master/texmf-dist/tex/latex/chet/chet.sty index d2fa5612e71..c193f413e9a 100644 --- a/Master/texmf-dist/tex/latex/chet/chet.sty +++ b/Master/texmf-dist/tex/latex/chet/chet.sty @@ -1,5 +1,5 @@ % chet.sty -% Copyright 2011 Andreas Stergiou +% Copyright 2012 Andreas Stergiou % % This package is supposed to streamline latex typesetting and give the % look and feel of harvmac to a paper, with the use of LaTex2e. @@ -15,308 +15,105 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{chet} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% chetapp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% chetapp.sty -% Copyright 2011 Andreas Stergiou -% -% This is basically a copy of appendix.sty with minor changes. -% -%% This is file `appendix.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% appendix.dtx (with options: `usc') -%% -%% ----------------------------------------------------------------- -%% Author: Peter Wilson, Herries Press -%% Maintainer: Will Robertson (will dot robertson at latex-project dot org) -%% Copyright 1998--2004 Peter R. Wilson -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either -%% version 1.3c of this license or (at your option) any -%% later version: <http://www.latex-project.org/lppl.txt> -%% -%% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Will Robertson. -%% -%% This work consists of the files listed in the README file. -%% ----------------------------------------------------------------- -%% -\newif\if@chapter@pp\@chapter@ppfalse -\newif\if@knownclass@pp\@knownclass@ppfalse -\@ifundefined{chapter}{% - \@ifundefined{section}{}{\@knownclass@pptrue}}{% - \@chapter@pptrue\@knownclass@pptrue} -\providecommand{\phantomsection}{} -\newcounter{@pps} - \renewcommand{\the@pps}{\alph{@pps}} -\newif\if@pphyper - \@pphyperfalse -\AtBeginDocument{% - \@ifpackageloaded{hyperref}{\@pphypertrue}{}} - -\newif\if@dotoc@pp\@dotoc@ppfalse -\newif\if@dotitle@pp\@dotitle@ppfalse -\newif\if@dotitletoc@pp\@dotitletoc@ppfalse -\newif\if@dohead@pp\@dohead@ppfalse -\newif\if@dopage@pp\@dopage@ppfalse -\DeclareOption{toc}{\@dotoc@pptrue} -\DeclareOption{title}{\@dotitle@pptrue} -\DeclareOption{titletoc}{\@dotitletoc@pptrue} -\DeclareOption{header}{\@dohead@pptrue} -\DeclareOption{page}{\@dopage@pptrue} -\ExecuteOptions{title,titletoc} -\ProcessOptions\relax -\newcommand{\@ppendinput}{} -\if@knownclass@pp\else - \PackageWarningNoLine{appendix}% - {There is no \protect\chapter\space or \protect\section\space command.\MessageBreak - The appendix package will not be used} - \renewcommand{\@ppendinput}{\endinput} -\fi -\@ppendinput - -\newcommand{\appendixtocon}{\@dotoc@pptrue} -\newcommand{\appendixtocoff}{\@dotoc@ppfalse} -\newcommand{\appendixpageon}{\@dopage@pptrue} -\newcommand{\appendixpageoff}{\@dopage@ppfalse} -\newcommand{\appendixtitleon}{\@dotitle@pptrue} -\newcommand{\appendixtitleoff}{\@dotitle@ppfalse} -\newcommand{\appendixtitletocon}{\@dotitletoc@pptrue} -\newcommand{\appendixtitletocoff}{\@dotitletoc@ppfalse} -\newcommand{\appendixheaderon}{\@dohead@pptrue} -\newcommand{\appendixheaderoff}{\@dohead@ppfalse} -\newcounter{@ppsavesec} -\newcounter{@ppsaveapp} -\setcounter{@ppsaveapp}{0} -\newcommand{\@ppsavesec}{% - \if@chapter@pp \setcounter{@ppsavesec}{\value{chapter}} \else - \setcounter{@ppsavesec}{\value{section}} \fi} -\newcommand{\@pprestoresec}{% - \if@chapter@pp \setcounter{chapter}{\value{@ppsavesec}} \else - \setcounter{section}{\value{@ppsavesec}} \fi} -\newcommand{\@ppsaveapp}{% - \if@chapter@pp \setcounter{@ppsaveapp}{\value{chapter}} \else - \setcounter{@ppsaveapp}{\value{section}} \fi} -\newcommand{\restoreapp}{% - \if@chapter@pp \setcounter{chapter}{\value{@ppsaveapp}} \else - \setcounter{section}{\value{@ppsaveapp}} \fi} -\providecommand{\appendixname}{Appendix} -\newcommand{\appendixtocname}{Appendices} -\newcommand{\appendixpagename}{Appendices} -\newcommand{\appendixpage}{% - \if@chapter@pp \@chap@pppage \else \@sec@pppage \fi -} -\newcommand{\clear@ppage}{% - \if@openright\cleardoublepage\else\clearpage\fi} - -\newcommand{\@chap@pppage}{% - \clear@ppage - \thispagestyle{plain}% - \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi - \null\vfil - \markboth{}{}% - {\centering - \interlinepenalty \@M - \normalfont - \Huge \bfseries \appendixpagename\par}% - \if@dotoc@pp - \addappheadtotoc - \fi - \vfil\newpage - \if@twoside - \if@openright - \null - \thispagestyle{empty}% - \newpage - \fi - \fi - \if@tempswa - \twocolumn - \fi -} +\RequirePackage{kvoptions} + +\SetupKeyvalOptions{% + family=Chet, + prefix=Chet@} + +\DeclareBoolOption{macrosonly} + +\ProcessKeyvalOptions* + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\ifChet@macrosonly -\newcommand{\@sec@pppage}{% - \par - \addvspace{4ex}% - \@afterindentfalse - {\parindent \z@ \raggedright - \interlinepenalty \@M - \normalfont - \huge \bfseries \appendixpagename% - \markboth{}{}\par}% - \if@dotoc@pp - \addappheadtotoc - \fi - \nobreak - \vskip 3ex - \@afterheading +\usepackage{xparse} +\usepackage{xspace} +\usepackage{amsmath} +\usepackage{filecontents} +\usepackage[linktocpage]{hyperref} + +% Numbered equation with optional label +\NewDocumentCommand\eqn{mo}{% + \IfNoValueTF{#2} + {\[ #1 \]} + {\begin{equation}\label{#2} #1 \end{equation} \expandafter\newcommand\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces} } -\newif\if@pptocpage - \@pptocpagetrue -\newcommand{\noappendicestocpagenum}{\@pptocpagefalse} -\newcommand{\appendicestocpagenum}{\@pptocpagetrue} -\newcommand{\addappheadtotoc}{% - \phantomsection - \if@chapter@pp - \if@pptocpage - \addcontentsline{toc}{chapter}{\appendixtocname}% - \else - \if@pphyper - \addtocontents{toc}% - {\protect\contentsline{chapter}{\appendixtocname}{}{\@currentHref}}% - \else - \addtocontents{toc}% - {\protect\contentsline{chapter}{\appendixtocname}{}}% - \fi - \fi - \else - \if@pptocpage - \addcontentsline{toc}{section}{\appendixtocname}% - \else - \if@pphyper - \addtocontents{toc}% - {\protect\contentsline{section}{\appendixtocname}{}{\@currentHref}}% - \else - \addtocontents{toc}% - {\protect\contentsline{section}{\appendixtocname}{}}% - \fi - \fi - \fi +% Numbered aligned equation with optional label in the vertical middle +\NewDocumentCommand\eqna{mo}{% + \IfNoValueTF{#2} + {\begin{align*} #1 \end{align*}} + {\begin{equation}\label{#2}\begin{split} #1 \end{split}\end{equation} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces} } -\providecommand{\theH@pps}{\alph{@pps}} - -\newcommand{\@resets@pp}{\par - \@ppsavesec - \stepcounter{@pps} - \setcounter{section}{0}% - \if@chapter@pp - \setcounter{chapter}{0}% - \renewcommand\@chapapp{\appendixname}% - \renewcommand\thechapter{\@Alph\c@chapter}% - \else - \setcounter{subsection}{0}% - \renewcommand\thesection{\@Alph\c@section}% - \fi - \if@pphyper - \if@chapter@pp - \renewcommand{\theHchapter}{\theH@pps.\Alph{chapter}}% - \else - \renewcommand{\theHsection}{\theH@pps.\Alph{section}}% - \fi - \def\Hy@chapapp{\appendixname}% - \fi - \restoreapp +% Numbered subequations +% Two subequations +\NewDocumentCommand\twoseqn{momoo}{% + \IfNoValueTF{#5} + {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4} \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces} + {\begin{subequations}\label{#5}\begin{align} #1\label{#2} \\ #3 \label{#4} \end{align}\end{subequations} \expandafter\def\csname #5\endcsname{\eqref{#5}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces} +} +% Three subequations +\NewDocumentCommand\threeseqn{momomoo}{% + \IfNoValueTF{#7} + {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces} + {\begin{subequations}\label{#7}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \end{align}\end{subequations} \expandafter\def\csname #7\endcsname{\eqref{#7}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces} } -\newenvironment{appendices}{% - \@resets@pp - \if@dotoc@pp - \if@dopage@pp % both page and toc - \if@chapter@pp % chapters - \clear@ppage - \fi - \appendixpage - \else % toc only - \if@chapter@pp % chapters - \clear@ppage - \fi - \addappheadtotoc - \fi - \else - \if@dopage@pp % page only - \appendixpage - \fi - \fi - \if@chapter@pp - \if@dotitletoc@pp \@redotocentry@pp{chapter} \fi - \else - \if@dotitletoc@pp \@redotocentry@pp{section} \fi - \if@dohead@pp - \def\sectionmark##1{% - \if@twoside - \markboth{\@formatsecmark@pp{##1}}{} - \else - \markright{\@formatsecmark@pp{##1}}{} - \fi} - \fi - \if@dotitle@pp - \def\sectionname{\appendixname} - \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }% - \csname the##1\endcsname.\hspace{4.6pt}} - \fi - \fi}{% - \@ppsaveapp\@pprestoresec} - -\newcommand{\setthesection}{\thechapter.\Alph{section}} -\newcommand{\setthesubsection}{\thesection.\Alph{subsection}} - -\newcommand{\@resets@ppsub}{\par - \stepcounter{@pps} - \if@chapter@pp - \setcounter{section}{0} - \renewcommand{\thesection}{\setthesection} - \else - \setcounter{subsection}{0} - \renewcommand{\thesubsection}{\setthesubsection} - \fi - \if@pphyper - \if@chapter@pp - \renewcommand{\theHsection}{\theH@pps.\setthesection}% - \else - \renewcommand{\theHsubsection}{\theH@pps.\setthesubsection}% - \fi - \def\Hy@chapapp{\appendixname}% - \fi +% Four subequations +\NewDocumentCommand\fourseqn{momomomoo}{% + \IfNoValueTF{#9} + {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \\ #7\label{#8} \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces \expandafter\def\csname #8\endcsname{\eqref{#8}\xspace}\ignorespaces} + {\begin{subequations}\label{#9}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \\ #7\label{#8} \end{align}\end{subequations} \expandafter\def\csname #9\endcsname{\eqref{#9}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces \expandafter\def\csname #8\endcsname{\eqref{#8}\xspace}\ignorespaces} } -\newenvironment{subappendices}{% - \@resets@ppsub - \if@chapter@pp - \if@dotitletoc@pp \@redotocentry@pp{section} \fi - \if@dotitle@pp - \def\sectionname{\appendixname} - \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }% - \csname the##1\endcsname\quad} - \fi - \else - \if@dotitletoc@pp \@redotocentry@pp{subsection} \fi - \if@dotitle@pp - \def\subsectionname{\appendixname} - \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }% - \csname the##1\endcsname.\hspace{4.6pt}} - \fi - \fi}{} - -\newcommand{\@formatsecmark@pp}[1]{% - \MakeUppercase{\appendixname\space - \ifnum \c@secnumdepth >\z@ - \thesection\quad - \fi - #1}} -\newcommand{\@redotocentry@pp}[1]{% - \let\oldacl@pp=\addcontentsline - \def\addcontentsline##1##2##3{% - \def\@pptempa{##1}\def\@pptempb{toc}% - \ifx\@pptempa\@pptempb - \def\@pptempa{##2}\def\@pptempb{#1}% - \ifx\@pptempa\@pptempb -\oldacl@pp{##1}{##2}{\appendixname\space ##3}% - \else - \oldacl@pp{##1}{##2}{##3}% - \fi - \else - \oldacl@pp{##1}{##2}{##3}% - \fi} +\newcommand{\rcite}{\cite} +\newcommand{\draftmode}{\usepackage[notref,notcite]{showkeys}} +\providecommand*\showkeyslabelformat[1]{\normalfont\sffamily\footnotesize#1} +\newcommand{\foot}{\footnote} + +% Sections and subsections +\NewDocumentCommand\newsec{mo}{% + \IfNoValueTF{#2} + {\section{#1}} + {\section{#1}\label{#2} \expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces} +} +\NewDocumentCommand\subsec{mo}{% + \IfNoValueTF{#2} + {\subsection{#1}} + {\subsection{#1}\label{#2}\expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces} +} +\NewDocumentCommand\subsubsec{mo}{% + \IfNoValueTF{#2} + {\subsubsection{#1}} + {\subsubsection{#1}\label{#2}\expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces} } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\makeatletter +\renewcommand\section{\@startsection {section}{1}{\z@}% +{-6ex \@plus -1ex \@minus -.2ex}% +{2.3ex \@plus.2ex}% +{\bfseries}} +\makeatother +\makeatletter +\renewcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\itshape}} +\makeatother +\makeatletter +\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\itshape}} +\makeatother + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\else \usepackage{xparse} \usepackage{xspace} @@ -417,8 +214,6 @@ % Dot after section number \def\@seccntformat#1{\csname the#1\endcsname.\hspace{4.6pt}} -\renewcommand{\appendix}{\appendices} - % Acknowledgements \newenvironment{acknowledgments}{\vspace{12pt}\begin{center}\textbf{Acknowledgments}\end{center}\vspace{-12pt}}{} @@ -494,6 +289,7 @@ \noindent\@date \end{titlepage} } +\fi \endinput % |