summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/typogrid
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:10:08 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:10:08 +0000
commit32d3a82098779150ca9776dfccbdcbcdbaa26436 (patch)
tree1e174d7d5ecad1d4a68233b1b3eb03e4a8b5b052 /Master/texmf-dist/tex/latex/typogrid
parenta19be4e43bf70e8ffc076edf81fb0ab53e361d80 (diff)
typogrid
git-svn-id: svn://tug.org/texlive/trunk@1416 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/typogrid')
-rw-r--r--Master/texmf-dist/tex/latex/typogrid/typogrid.sty83
1 files changed, 83 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/typogrid/typogrid.sty b/Master/texmf-dist/tex/latex/typogrid/typogrid.sty
new file mode 100644
index 00000000000..a7a18c53a5b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/typogrid/typogrid.sty
@@ -0,0 +1,83 @@
+%%
+%% This is file `typogrid.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% typogrid.dtx (with options: `package')
+%%
+%% typogrid package
+%%
+%% Copyright 2003 Harald Harders
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt; either
+%% version 1 of the License, or any later version.
+%%
+%% h.harders@tu-bs.de
+%%
+\def\fileversion{0.10}
+\def\filedate{2003/10/30}
+\def\docdate{2003/10/30}
+\ProvidesPackage{typogrid}[2003/10/29 v\fileversion\space Typographic grid]
+\RequirePackage{eso-pic}[2002/11/16]
+\RequirePackage{calc}
+\RequirePackage{keyval}
+\newlength{\tpg@left}%
+\newlength{\tpg@top}%
+\newlength{\tpg@bottom}%
+\newlength{\tpg@gridwidth}%
+\newcounter{tpg@bloecke}%
+\setcounter{tpg@bloecke}{12}%
+\newcommand*\typogridsetup[1]{%
+ \expandafter\setkeys\expandafter{typogrid}{#1}}
+\define@key{typogrid}{columns}{%
+ \setcounter{tpg@bloecke}{#1}%
+ \ifnum\arabic{tpg@bloecke}<1
+ \PackageError{typogrid}{Less than 1 column given}{You have to
+ declare at least 1 column.}%
+ \setcounter{tpg@bloecke}{1}%
+ \fi
+}
+\newif\iftpg@draft
+\DeclareOption{draft}{\tpg@drafttrue}
+\DeclareOption{final}{\tpg@draftfalse}
+\DeclareOption*{\expandafter\typogridsetup\expandafter{\CurrentOption}}
+\ExecuteOptions{final}
+\ProcessOptions\relax
+\AtBeginDocument{%
+ \iftpg@draft
+ \typeout{Typographic grid switched on}%
+ \AddToShipoutPicture{%
+ \begingroup
+ \normalcolor
+ \setlength{\unitlength}{1pt}%
+ \thinlines
+ \setlength{\tpg@top}{\paperheight-1in-\topmargin-\headheight-\headsep}%
+ \setlength{\tpg@bottom}{\tpg@top-\textheight}%
+ \setlength{\tpg@gridwidth}{\textwidth/\thetpg@bloecke}%
+ \@tempcnta=\thetpg@bloecke
+ \advance\@tempcnta by 1
+ \ifodd\arabic{page}%
+ \setlength{\tpg@left}{\oddsidemargin+1in}%
+ \else
+ \setlength{\tpg@left}{\evensidemargin+1in}%
+ \fi
+ \put(\strip@pt\tpg@left,\strip@pt\tpg@top){%
+ \line(1,0){\strip@pt\textwidth}}%
+ \put(\strip@pt\tpg@left,\strip@pt\tpg@bottom){%
+ \line(1,0){\strip@pt\textwidth}}%
+ \multiput(\strip@pt\tpg@left,\strip@pt\tpg@bottom)%
+ (\strip@pt\tpg@gridwidth,0){\the\@tempcnta}{%
+ \line(0,1){\strip@pt\textheight}}%
+ \endgroup
+ }%
+ \else
+ \typeout{Typographic grid switched off}%
+ \fi
+}
+
+\endinput
+%%
+%% End of file `typogrid.sty'.