|
Warning: this is an htmlized version!
The original is across this link, and the conversion rules are here. |
% This is the file "examples/edrxheadfoot.tex" of dednat4.
% See: http://angg.twu.net/dednat4.html
% http://angg.twu.net/dednat4/examples/edrxheadfoot.tex
% http://angg.twu.net/dednat4/examples/edrxheadfoot.tex.html
% Author: Eduardo Ochs <eduardoochs@gmail.com>
% Version: 2008jun24
% Public domain.
%
% This doesn't have much to do with dednat4, but let me explain. :-)
% I "\input" this file from most of my LaTeX files. It changes the
% code for headers and footers to make the page number appear in the
% header and the filename (the "\jobname", actually) and the date of
% the compilation appear of at the footer. Including it in dednat4
% made some examples easier to write.
% (find-dn4ex "edrxmain41.tex")
% (find-dn4ex "edrxmain41a.tex")
% (find-doutfile "")
% (find-doutfile "defs-dnt.tex")
% (find-doutfile "defs-headfoot.tex")
% (find-doutfile "defs-sect.tex")
% (find-doutfile "defs-symbols.tex")
% (find-doutfile "defs.tex")
% p.11=22 (find-lsrcfile "lshort/src/things.tex" "pagestyle")
% source2e p.328=337 (find-lsrcfile "base/ltpage.dtx" "pagestyle")
% classes p.19=19 (find-lsrcfile "base/classes.dtx" "The page style")
% (find-lsrcfile "base/classes.dtx" "<!book>\\pagestyle{plain}")
% (find-lsrcfile "base/classes.dtx" "\\def\\ps@headings")
% (find-lsrcfile "base/book.cls" "if@twoside")
% (find-lsrcfile "base/nfssfont.tex" "time")
%
\makeatletter
\newcount\m \newcount\n
\def\twodigits#1{\ifnum #1<10 0\fi \number#1}
\def\hours{\n=\time \divide\n 60
\m=-\n \multiply\m 60 \advance\m \time
\twodigits\n:\twodigits\m}
%
\def\draftfooter{\jobname{} \today{} \hours}
\def\footertext{\draftfooter}
\def\ps@headings{%
\def\@oddfoot{\hfil \footertext \hfil}
\let\@evenfoot\@oddfoot
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
##1}}}}
\ps@headings
\makeatother
%
\def\shorttoday{%
\number\year%
\ifcase\month\or jan\or feb\or mar\or apr\or may\or
jun\or jul\or aug\or sep\or oct\or nov\or dec\fi
\twodigits\day}
\def\edrxnotesfooter#1{{\tiny #1 (typeset \shorttoday{} \hours)
{\tt Edrx http://angg.twu.net/}}}
\def\edrxnotes#1{\gdef\footertext{\edrxnotesfooter{#1}}}
\def\noedrxfooter{\gdef\footertext{}}
%
% (find-es "tex" "edrxnotes")
% (find-fline "/usr/share/texmf-tetex/tex/generic/babel/portuges.ldf")
% (find-fline "/usr/share/texmf-tetex/tex/generic/babel/portuges.sty")
% Local Variables:
% coding: raw-text-unix
% ee-delimiter-percent: "\n%*\n"
% ee-anchor-format: "«%s»"
% End: