summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memexsupp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-03-21 17:38:02 +0000
committerKarl Berry <karl@freefriends.org>2008-03-21 17:38:02 +0000
commitfbad46c95a0870250bacff1df845b93b00b67b4d (patch)
treeb030f07549b5ac35c3571cde8224b11acb90deb1 /Master/texmf-dist/tex/latex/memexsupp
parent86c756ee6f056328a39127f60560f00a7fde7cb3 (diff)
memexsupp installed (20mar08)
git-svn-id: svn://tug.org/texlive/trunk@7061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memexsupp')
-rw-r--r--Master/texmf-dist/tex/latex/memexsupp/memexsupp.sty131
1 files changed, 131 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/memexsupp/memexsupp.sty b/Master/texmf-dist/tex/latex/memexsupp/memexsupp.sty
new file mode 100644
index 00000000000..69b871ac813
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/memexsupp/memexsupp.sty
@@ -0,0 +1,131 @@
+%%
+%% This package can 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".
+%%
+%% The Current Maintainer of this work is Lars Madsen (daleif@imf.au.dk).
+%%
+
+%% HISTORY
+% 2007/02/24 initial release
+% 2008/03/20 updated with new code, and old code removed as to reflect
+% changes in memoir
+
+\ProvidesPackage{memexsupp}[2008/03/20 v0.1 by daleif]
+
+% only for the memoir class
+\@ifclassloaded{memoir}{}{
+ \PackageError{memsupp}{This package can only be used together with
+ the memoir class.}{Either outcomment this package or switch to the
+ memoir class}
+}
+
+\newcounter{tempcounter}
+\newcommand\MXScreatesimplemark[2]{%
+ \@namedef{#1mark}{\markboth{\memUChead{#2}}{\memUChead{#2}}}}
+\newcommand\MXScreatemark[5]{%
+ % #1 type: chapter, section, subsection, subsubsection
+ % #2 mark type: both, right
+ % #3 whether to show the counter part in mainmatter (true/false),
+ % #4 prefix: text before number (including the spacing)
+ % #5 number postfix: (. plus spacing)
+ \@tempswafalse%
+ \nametest{#3}{true}%
+ \ifsamename\@tempswatrue\def\@tempa{00}\fi
+ \nametest{#3}{false}%
+ \ifsamename\@tempswatrue\def\@tempa{01}\fi
+ \if@tempswa\else
+ \@memerror{bad boolean value (#3)}%
+ {I expect the use of 'true' or 'false'}%
+ \fi
+ \expandafter\if\@tempa
+ \@namedef{#1marksn}##1{##1}
+ \else
+ \@namedef{#1marksn}{\@gobble}
+ \fi
+ \@namedef{#1mark}##1{%
+ \@tempswafalse%
+ \nametest{#2}{both}
+ \ifsamename
+ \@setclcnt{#1}{tempcounter}
+ \addtocounter{tempcounter}{-1}
+ \markboth{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \value{tempcounter}
+ \if@mainmatter
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi
+ \fi
+ ##1}}{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \value{tempcounter}
+ \if@mainmatter
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi
+ \fi
+ ##1}}%
+ \@tempswatrue
+ \fi
+ \nametest{#2}{right}
+ \ifsamename
+ \@setclcnt{#1}{tempcounter}
+ \addtocounter{tempcounter}{-1}
+ \markright{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \value{tempcounter}%
+ \if@mainmatter%
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ %#4\@nameuse{the#1}#5
+ \fi%
+ \fi%
+ ##1}}%
+ \@tempswatrue
+ \fi
+ \if@tempswa\else
+ \@memerror{%
+ Unknown mark setting type (#2)
+ }{%
+ I expect the use of 'both' or 'right'}%
+ \fi
+ }
+}
+
+\newcommand\MXSaddtopsmarks[3]{
+ % #1: name of pagestyle
+ % #2: code for the beginning
+ % code for the end
+ \expandafter\addtodef\expandafter{\csname #1pshook\endcsname}{#2}{#3}%
+}
+
+
+
+
+
+
+\newenvironment{MXStitlingpage}%
+ {\let\footnoterule\relax
+ \let\footnotesize\small
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \thispagestyle{titlingpage}%
+ \setcounter{page}{\@ne}%
+ \let\MXSoldnewpage\newpage
+ \let\MXSoldclearpage\clearpage
+ \def\newpage{\MXSoldnewpage\thispagestyle{titlingpage}}%
+ \def\clearpage{\MXSoldclearpage\thispagestyle{titlingpage}}%
+ }{%
+ \thispagestyle{titlingpage}%
+ \let\newpage\MXSoldnewpage
+ \let\clearpage\MXSoldclearpage
+ \if@restonecol \twocolumn \fi
+ \if@twoside \cleardoublepage \else \clearpage \fi
+ \setcounter{page}{\@ne}}