summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/typogrid
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-11 23:03:17 +0000
committerKarl Berry <karl@freefriends.org>2006-01-11 23:03:17 +0000
commitecf966f305f6aeff2bbdf42c82d8425921aa9eda (patch)
treedb606a57e3619610e4c35cae849d41cf4e0937d5 /Master/texmf-dist/source/latex/typogrid
parentac3c55a3216b5988f0e48ba9414ddb059f19a699 (diff)
source 1
git-svn-id: svn://tug.org/texlive/trunk@105 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/typogrid')
-rw-r--r--Master/texmf-dist/source/latex/typogrid/Makefile69
-rw-r--r--Master/texmf-dist/source/latex/typogrid/typogrid.dtx214
-rw-r--r--Master/texmf-dist/source/latex/typogrid/typogrid.ins25
3 files changed, 308 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/typogrid/Makefile b/Master/texmf-dist/source/latex/typogrid/Makefile
new file mode 100644
index 00000000000..6f6cfa0a53d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/Makefile
@@ -0,0 +1,69 @@
+
+SRCDIR=typogrid
+INSTALLDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/tex/latex/typogrid
+DOCDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/doc/latex/typogrid
+VERSION=`grep '^\\\\def\\\\fileversion' typogrid.dtx | sed 's/^\\\\def\\\\fileversion{\\(.*\\)\\.\\(.*\\)}/\\1_\\2/'`
+
+
+.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf
+
+.ins.sty:
+ latex $<
+
+.dtx.dvi:
+ latex $<
+ latex $<
+ makeindex -s gind.ist $(*D)/$(*F)
+ makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
+ latex $<
+
+.dvi.ps:
+ dvips -o $(*D)/$(*F).ps $(*D)/$(*F)
+
+
+all: typogrid.sty typogrid.dvi
+
+
+clean:
+ @-rm -f typogrid.glo typogrid.gls typogrid.idx typogrid.ilg
+ @-rm -f typogrid.ind typogrid.aux typogrid.log typogrid.toc
+ @-rm -f testtypogrid.aux testtypogrid.log
+ @-rm -f *~
+
+distclean: clean
+ @-rm -f typogrid.sty typogrid.dvi
+ @-rm -f testtypogrid.dvi
+
+tar: all clean
+ echo Lege typogrid-$(VERSION).tar.gz an
+ -rm -f typogrid-$(VERSION).tar.gz
+ tar czCf .. typogrid-$(VERSION).tar.gz \
+ $(SRCDIR)/README \
+ $(SRCDIR)/Makefile \
+ $(SRCDIR)/typogrid.dtx \
+ $(SRCDIR)/typogrid.ins \
+ $(SRCDIR)/typogrid.dvi \
+ $(SRCDIR)/testtypogrid.tex
+
+zip: all clean
+ -@rm -f typogrid-$(VERSION).zip
+ mkdirhier tex/latex/typogrid
+ mkdirhier doc/latex/typogrid
+ mkdirhier source/latex/typogrid
+ mv typogrid.sty tex/latex/typogrid
+ cp typogrid.dtx typogrid.ins typogrid.xml source/latex/typogrid
+ cp Makefile source/latex/typogrid
+ cp README typogrid.dvi testtypogrid.tex doc/latex/typogrid
+ zip -r typogrid-$(VERSION).zip tex doc source
+ rm -r tex/ doc/ source/
+
+install: all
+ if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
+ if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
+ install -m644 typogrid.sty $(INSTALLDIR)
+ install -m644 typogrid.dvi $(DOCDIR)
+ texhash
+
+
+typogrid.sty: typogrid.ins typogrid.dtx
+
diff --git a/Master/texmf-dist/source/latex/typogrid/typogrid.dtx b/Master/texmf-dist/source/latex/typogrid/typogrid.dtx
new file mode 100644
index 00000000000..4fb0af5ed09
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/typogrid.dtx
@@ -0,0 +1,214 @@
+% \iffalse meta comment
+% File: typogrid.dtx Copyright (C) 2003 Harald Harders
+% \fi
+%
+% \iffalse
+%
+%<*package>
+\def\fileversion{0.10}
+\def\filedate{2003/10/30}
+\def\docdate{2003/10/30}
+%</package>
+%<*driver>
+\listfiles
+\documentclass[a4paper]{ltxdoc}
+\title{The \texttt{typogrid} package\thanks{This file has version
+ \fileversion\ last revised \filedate, documentation dated
+ \docdate.}}
+\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
+\date{File Date \filedate, Printed \today}
+\usepackage[T1]{fontenc}
+%\def\meta@font@select{\normalfont\itshape}
+\makeatother
+%%
+\EnableCrossrefs
+\CodelineIndex
+\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter}
+\DoNotIndex{\setcounter,\space,\if,\else,\fi,\empty,\@empty,\ifx,\fi}
+\DoNotIndex{\ifnum,\fi,\expandafter,\csname,\endcsname,\the}
+\DoNotIndex{\MessageBreak,\message,\newlength,\newif,\xdef,\newcount}
+\DoNotIndex{\begingroup,\endgroup,\,,\@tempcnta,\@tempdima,\advance}
+\DoNotIndex{\ensuremath,\filedate,\fileversion,\docdate}
+\DoNotIndex{\mathit,\mathrm,\mathsf,\nprt@tmp,\nprt@tmpnum,\relax}
+\DoNotIndex{\protect,\renewcommand,\setlength,\settowidth,\stepcounter}
+\DoNotIndex{\string}
+\CodelineNumbered
+\RecordChanges
+\CheckSum{111}
+\begin{document}
+ \DocInput{typogrid.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{0.10}{2003/10/30}{First version}%
+%
+% \maketitle
+% \begin{abstract}
+% \noindent
+% This package produces a typographic grid on every page of the
+% document.
+% That grid consists of vertical lines that devide the text block into
+% columns.
+% This may be useful to get the horizontal measures (distances etc.)
+% into good values.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section*{Copyright}
+% 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.
+%
+% \section{Usage}
+%
+% Load the package using the
+% \begin{quote}
+% \cs{usepackage}\oarg{options}|{typogrid}|
+% \end{quote}
+% command.
+% Valid options are |final|, |draft|, and
+% |columns=|\meta{value}.
+% The options |final| and |draft| may be given explicitely or
+% implicitely from the document-class options.
+%
+% When |draft| is given the typographic grid is switched on; if
+% |final| or none of the above is given it is switched off.
+%
+% The |columns| option determines the number of columns printed.
+% If it is not given, a default of 12 is used.
+%
+% \DescribeMacro{\typogridsetup}
+% There is a second possibility to change the number of columns.
+% You may use the \cs{typogridsetup} command that takes a keyval list
+% as argument.
+% This version suports only |columns=|\meta{value}, e.g.,
+% \begin{quote}
+% |\typogridsetup{columns=4}|
+% \end{quote}
+% You may also change the number of columns within the text.
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+% \section{The implementation}
+% \iffalse
+%<*package>
+% \fi
+% Heading of the package:
+% \begin{macrocode}
+\ProvidesPackage{typogrid}[2003/10/29 v\fileversion\space Typographic grid]
+\RequirePackage{eso-pic}[2002/11/16]
+\RequirePackage{calc}
+\RequirePackage{keyval}
+% \end{macrocode}
+% Introduce the used lengths.
+% \begin{macrocode}
+\newlength{\tpg@left}%
+\newlength{\tpg@top}%
+\newlength{\tpg@bottom}%
+\newlength{\tpg@gridwidth}%
+% \end{macrocode}
+% Introduce the used counters and set the default number of columns.
+% \begin{macrocode}
+\newcounter{tpg@bloecke}%
+\setcounter{tpg@bloecke}{12}%
+% \end{macrocode}
+% \begin{macro}{\typogridsetup}
+% Declare a command that can be used to change the appearence of the
+% typographic grid.
+% The argument takes a list of keyval options.
+% \begin{macrocode}
+\newcommand*\typogridsetup[1]{%
+ \expandafter\setkeys\expandafter{typogrid}{#1}}
+% \end{macrocode}
+% \end{macro}
+% Define the key |columns| that takes the number of columns.
+% \begin{macrocode}
+\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
+}
+% \end{macrocode}
+% Package options:
+% \begin{macrocode}
+\newif\iftpg@draft
+\DeclareOption{draft}{\tpg@drafttrue}
+\DeclareOption{final}{\tpg@draftfalse}
+\DeclareOption*{\expandafter\typogridsetup\expandafter{\CurrentOption}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExecuteOptions{final}
+\ProcessOptions\relax
+% \end{macrocode}
+% Start the grid with the first page (should not be necessary).
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% Print the grid on any page.
+% \begin{macrocode}
+ \iftpg@draft
+ \typeout{Typographic grid switched on}%
+ \AddToShipoutPicture{%
+% \end{macrocode}
+% Set the unit length each time because the use may have changed it.
+% Do everything inside a group to prevent the changes to be seen
+% outside.
+% \begin{macrocode}
+ \begingroup
+ \normalcolor
+ \setlength{\unitlength}{1pt}%
+ \thinlines
+% \end{macrocode}
+% Calculate the distance of the text block from the page corner.
+% \begin{macrocode}
+ \setlength{\tpg@top}{\paperheight-1in-\topmargin-\headheight-\headsep}%
+ \setlength{\tpg@bottom}{\tpg@top-\textheight}%
+ \setlength{\tpg@gridwidth}{\textwidth/\thetpg@bloecke}%
+% \end{macrocode}
+% Calculate the number of vertical lines to be printed.
+% \begin{macrocode}
+ \@tempcnta=\thetpg@bloecke
+ \advance\@tempcnta by 1
+% \end{macrocode}
+% The left distance varies between odd and even pages.
+% \begin{macrocode}
+ \ifodd\arabic{page}%
+ \setlength{\tpg@left}{\oddsidemargin+1in}%
+ \else
+ \setlength{\tpg@left}{\evensidemargin+1in}%
+ \fi
+% \end{macrocode}
+% Print horizontal lines.
+% \begin{macrocode}
+ \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}}%
+% \end{macrocode}
+% Print equidistant vertical lines.
+% \begin{macrocode}
+ \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
+}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+% \Finale
+
diff --git a/Master/texmf-dist/source/latex/typogrid/typogrid.ins b/Master/texmf-dist/source/latex/typogrid/typogrid.ins
new file mode 100644
index 00000000000..1e19f6e146e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/typogrid.ins
@@ -0,0 +1,25 @@
+\input docstrip.tex
+\preamble
+
+ 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
+
+\endpreamble
+
+\askforoverwritefalse
+
+% Files
+%%%%%%%%%%%%%%%%%%%%%%
+\generate{%
+ \file{typogrid.sty}{\from{typogrid.dtx}{package}}%
+}%
+
+\endbatchfile