summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/tocenter.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:00:29 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:00:29 +0000
commit8b8fbae5990dee3b8ab739df0de8b7c365e4d227 (patch)
tree824392c1bb07fe8c8b620efd3992cc0daa3e433a /Master/texmf-dist/tex/latex/ncctools/tocenter.sty
parente9351f8ac4f8603d6020be78e092e939e24d89d0 (diff)
ncctools
git-svn-id: svn://tug.org/texlive/trunk@1132 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ncctools/tocenter.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ncctools/tocenter.sty125
1 files changed, 125 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ncctools/tocenter.sty b/Master/texmf-dist/tex/latex/ncctools/tocenter.sty
new file mode 100644
index 00000000000..572ffff8b07
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ncctools/tocenter.sty
@@ -0,0 +1,125 @@
+%%
+%% This is file `tocenter.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tocenter.dtx (with options: `package')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% This file is a generated file from the sources of the `ncctools'
+%% bundle.
+%%
+%% You are not allowed to modify this file.
+%%
+%% You are allowed to distribute this file if and only if
+%% it is distributed with the corresponding source files in
+%% the `ncctools' bundle.
+%%
+%% For the copying and distribution conditions of the source files,
+%% see the README file distributed with the ncctools bundle.
+%%
+%% File: tocenter.dtx Copyright (C) 2002--2004 by Alexander I. Rozhenko
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tocenter}
+ [2004/12/09 v1.1 Centering Page Layout (NCC)]
+\def\NCC@pos#1{%
+ \let\NCC@h\@gobble \let\NCC@f\@gobble \let\NCC@m\@gobble
+ \@tfor\@tempa:=#1\do{%
+ \if h\@tempa
+ \def\NCC@h##1{\advance##1\headsep \advance##1\headheight}%
+ \else
+ \if f\@tempa
+ \def\NCC@f##1{\advance##1\footskip}%
+ \else
+ \if m\@tempa
+ \def\NCC@m##1{\advance##1\marginparwidth
+ \advance##1\marginparsep}%
+ \fi
+ \fi
+ \fi
+ }%
+}
+\newcommand{\ToCenter}{%
+ \@ifstar{\pagestyle{empty}\nofiles\NCC@center[]}{\NCC@center}%
+}
+\@onlypreamble\ToCenter
+\newcommand*{\NCC@center}[3][]{\NCC@pos{#1}%
+ \setlength\textwidth{#2}%
+ \@tempdima\textwidth \NCC@m\@tempdima
+ \if@twocolumn
+ \NCC@m\@tempdima
+ \@tempdimb\paperwidth
+ \advance\@tempdimb -\@tempdima
+ \@tempdima .5\@tempdimb \NCC@m\@tempdima
+ \oddsidemargin\@tempdima
+ \evensidemargin\@tempdima
+ \else
+ \@tempdimb\paperwidth
+ \advance\@tempdimb -\@tempdima \@tempdima .5\@tempdimb
+ \if@reversemargin
+ \evensidemargin\@tempdima
+ \NCC@m\@tempdima
+ \oddsidemargin\@tempdima
+ \else
+ \oddsidemargin\@tempdima
+ \NCC@m\@tempdima
+ \evensidemargin\@tempdima
+ \fi
+ \fi
+ \setlength\textheight{#3}%
+ \@tempdima\textheight \NCC@h\@tempdima \NCC@f\@tempdima
+ \@tempdimb\paperheight
+ \advance\@tempdimb -\@tempdima
+ \topmargin .5\@tempdimb
+ \ifx\NCC@h\@gobble
+ \advance\topmargin -\headsep
+ \advance\topmargin -\headheight
+ \fi
+ \advance \oddsidemargin -1in
+ \advance \evensidemargin -1in
+ \advance \topmargin -1in
+}
+\@onlypreamble\NCC@center
+\newcommand{\FromMargins}{%
+ \@ifstar{\pagestyle{empty}\nofiles\NCC@margin[]}{\NCC@margin}%
+}
+\@onlypreamble\FromMargins
+\newcommand*{\NCC@margin}[5][]{\NCC@pos{#1}%
+ \setlength\oddsidemargin{#2}%
+ \setlength\evensidemargin{#3}%
+ \@tempdima\oddsidemargin \advance\@tempdima\evensidemargin
+ \NCC@m\@tempdima
+ \if@twocolumn
+ \NCC@m\@tempdima
+ \textwidth\paperwidth
+ \advance\textwidth -\@tempdima
+ \NCC@m\oddsidemargin \NCC@m\evensidemargin
+ \else
+ \textwidth\paperwidth
+ \advance\textwidth -\@tempdima
+ \if@reversemargin
+ \NCC@m\oddsidemargin
+ \else
+ \NCC@m\evensidemargin
+ \fi
+ \fi
+ \setlength\topmargin{#4}%
+ \setlength\@tempdima{#5}\advance\@tempdima\topmargin
+ \NCC@h\@tempdima \NCC@f\@tempdima
+ \textheight\paperheight
+ \advance\textheight -\@tempdima
+ \ifx\NCC@h\@gobble
+ \advance\topmargin -\headsep
+ \advance\topmargin -\headheight
+ \fi
+ \advance \oddsidemargin -1in
+ \advance \evensidemargin -1in
+ \advance \topmargin -1in
+}
+\@onlypreamble\NCC@margin
+\endinput
+%%
+%% End of file `tocenter.sty'.