diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/gene |
Initial commit
Diffstat (limited to 'macros/latex/contrib/gene')
37 files changed, 9948 insertions, 0 deletions
diff --git a/macros/latex/contrib/gene/crossword/Makefile b/macros/latex/contrib/gene/crossword/Makefile new file mode 100644 index 0000000000..663c046768 --- /dev/null +++ b/macros/latex/contrib/gene/crossword/Makefile @@ -0,0 +1,56 @@ +#****************************************************************************** +#* $Id: Makefile,v 1.9 2009/09/13 08:37:19 gene Exp gene $ +#****************************************************************************** +#* Author: Gerd Neugebauer +#*============================================================================= + +INSTALLDIR = /usr/local/lib/texmf/tex/latex/cwpuzzle + +FILES = cwpuzzle.dtx \ + cwpuzzle.ins \ + Makefile \ + README + +LATEX = latex +PDFLATEX = pdflatex +MAKEINDEX = makeindex +RM = rm -f +INSTALL = install +MKDIR = mkdir + +#*============================================================================= + +all: cwpuzzle.pdf + +cwpuzzle.sty sty: cwpuzzle.dtx cwpuzzle.ins + $(RM) cwpuzzle.cls cwpuzzle.sty + $(PDFLATEX) cwpuzzle.ins + +cwpuzzle.dvi dvi: cwpuzzle.dtx cwpuzzle.sty + $(LATEX) cwpuzzle.dtx + $(LATEX) cwpuzzle.dtx + $(MAKEINDEX) -s gind.ist cwpuzzle + $(MAKEINDEX) -s gglo.ist -o cwpuzzle.gls cwpuzzle.glo + $(LATEX) cwpuzzle.dtx + +cwpuzzle.pdf pdf: cwpuzzle.sty cwpuzzle.gls + $(PDFLATEX) cwpuzzle.dtx + $(PDFLATEX) cwpuzzle.dtx + $(MAKEINDEX) -s gind.ist cwpuzzle + $(MAKEINDEX) -s gglo.ist -o cwpuzzle.gls cwpuzzle.glo + $(PDFLATEX) cwpuzzle.dtx + +cwpuzzle.gls: + +zip dist: ${FILES} cwpuzzle.pdf + zip cwpuzzle-` perl -n -e 'print $$1 if m/\\\\def\\\\fileversion[{](.*)[}]/' cwpuzzle.dtx`.zip \ + ${FILES} cwpuzzle.pdf + +clean: + $(RM) cwpuzzle.log cwpuzzle.aux cwpuzzle.glo cwpuzzle.gls \ + cwpuzzle.idx cwpuzzle.ilg cwpuzzle.ind cwpuzzle.toc + +veryclean: clean + $(RM) cwpuzzle.cls cwpuzzle.sty cwpuzzle.dvi cwpuzzle.pdf + +# diff --git a/macros/latex/contrib/gene/crossword/README b/macros/latex/contrib/gene/crossword/README new file mode 100644 index 0000000000..c9c50b9133 --- /dev/null +++ b/macros/latex/contrib/gene/crossword/README @@ -0,0 +1,88 @@ + + cwpuzzle.sty + - + a LaTeX package for typesetting crossword puzzles and more + + Gerd Neugebauer + + +CROSSWORD PUZZLES + +Since I know only of one additional package for typesetting crossword +puzzles on CTAN -- named crosswrd.sty -- I will compare it against +this package to show the advantages and disadvantages of both +packages. + +I have developed cwpuzzle.sty because I needed to typeset a puzzle +which required more features than those provided by crosswrd. The +feature I was missing was the inclusion of rectangular regions in the +puzzles containing ads or other texts not directly related to the +characters to be filled in. + +I have generalized this requirement by allowing arbitrary rectangles +to be left free. Thus it is possible to typeset puzzles which have no +rectangular border (See the documentation for examples). + +Another idea was to have different types of puzzles generated from the +same source: + +- The classical puzzle contains numbers for the words and clues for + the words to be filled in. + +- The numbered puzzle contains numbers in each cell where identical + numbers represent identical letters. The goal is to find out which + number corresponds to which letter. + +- The fill-in type of puzzle consists of a grid and a list of words. + The goal is to place all words in the grid. + +crosswrd supports the first type of puzzle only. cwpuzzle supports all +of them. + +The input for both packages is completely different. crosswrd assumes +that a user uses this package to develop a puzzle. Thus it is tailored +towards a human user. It checks for consistency and requires +non-redundant input. (As a unpleasant side effect fragile macros used +in clues have to be protected) + +cwpuzzle needs some redundancy in the input for the sake of +flexibility. But it seems quite natural to specify the frame of the +puzzle and the clues separately. Especially for those types where no +clues are needed at all. + +cwpuzzle currently assumes that words are terminated by a black block +(or the border of the puzzle). crosswrd also supports also the variant +where words are terminated by a thicker border. This might also be +incorporated into a future release of cwpuzzle. + +In cwpuzzle it is also possible to specify whether the crossword +puzzle or it's solution should be produced (from the same +source). Thus it is possible to include the puzzle in one issue of a +journal and the solution into another, or to typeset the solution +several pages after the puzzle. + +cwpuzzle provides a larger number of options and hooks which can be +used to customize the result. E.g it is possible to modify the size of +the boxes or the fonts used as well as the appearance of graphical +elements like the black blocks. + + +MORE CELL-BASED PUZZLES + +In addition to crossword puzzles Sudoku and Kakuro are supported. They +are also grid-based. Thus it was easy to facilityte the infrastructure +already in place for them. + +There is a package for sudoku on CTAN. But it does not support +solutions yet. + + +LOCATION + +cwpuzzle is located in the CTAN directory + + tex-archive/macros/latex/contrib/gene/crossword + +Run tex on cwpuzzle.ins to produce the package and (pdf)latex on +cwpuzzle.dtx to get the documentation (or the Makefile to do both). +Per default the Makefile produces the documentation as PDF. diff --git a/macros/latex/contrib/gene/crossword/cwpuzzle.dtx b/macros/latex/contrib/gene/crossword/cwpuzzle.dtx new file mode 100644 index 0000000000..3442440ea4 --- /dev/null +++ b/macros/latex/contrib/gene/crossword/cwpuzzle.dtx @@ -0,0 +1,2177 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\filename{cwpuzzle.dtx} +\def\fileversion{1.9} +\def\filedate{2014/01/12} +\let\docversion=\fileversion +\let\docdate=\filedate +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\iffalse +\typeout{% +%% Purpose: + Package: cwpuzzle \filedate\space\fileversion\space + for typesetting crossword puzzles and more. +}% +%% +%% Documentation: +%% The documentation can be generated from the original file +%% cwpuzzle.dtx with the doc style/package. LaTeX the file +%% cwpuzzle.dtx to get the full documentation in dvi format. +%% +%% +%% Author: Gerd Neugebauer +%% Im Lerchelshl 5 +%% 64521 Gro-Gerau +%% Mail: gene@gerd-neugebauer.de +%% +%% Copyright (c) 1995-2014 Gerd Neugebauer +%% +%% cwpuzzle.dtx is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY. No author or distributor accepts +%% responsibility to anyone for the consequences of using it or for +%% whether it serves any particular purpose or works at all, unless +%% he says so in writing. +%% +%% Everyone is granted permission to copy, modify and redistribute +%% cwpuzzle.dtx, provided this copyright notice is preserved and +%% any modifications are indicated. +%% +%% +%% This style is still under development and may be replaced with a +%% new version which provides an enhanced functionality. +%% +%<*driver> +\documentclass{ltxdoc} +\usepackage{xcolor} +\usepackage{cwpuzzle} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\setcounter{IndexColumns}2 +\begin{document} + \DocInput{cwpuzzle.dtx} + \newpage + \PrintChanges +\end{document} +%</driver> +%\fi +% +% \title{A \LaTeX\ Package for Typesetting\\ Crossword +% Puzzles and More\thanks{This file documents \filename\ version +% \fileversion\ as of \filedate.}} +% \author{Gerd Neugebauer\\ +% Im Lerchels\"ohl 5\\ +% 64521 Gro\ss{}-Gerau (Germany)\\ +% Net: {\tt gene@gerd-neugebauer.de}} +% +% \date{{\footnotesize Documentation date: \docdate}} +% +% \maketitle +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \DoNotIndex{\ ,\|,\",\',\.,\,,\[,\\,\],\^,\`,\~,\@,\@dottedtocline} +% \DoNotIndex{\@empty,\@namedef,\@nameuse,\advance,\begin,\begingroup} +% \DoNotIndex{\catcode,\csname,\def,\else,\end,\endcsname,\endgroup} +% \DoNotIndex{\fi,\filedate,\footnotesize,\framebox,\gdef,\global} +% \DoNotIndex{\hfill,\if,\ifx,\large,\let,\makebox,\mbox,\newcommand} +% \DoNotIndex{\newcount,\newdimen,\newenvironment,\newif,\noindent} +% \DoNotIndex{\normalsize,\null,\par,\put,\raggedright,\raggedleft} +% \DoNotIndex{\relax,\renewcommand,\RequirePackage,\rm,\rule} +% \DoNotIndex{\scriptsize,\sf,\small,\textsf,\textwidth} +% \DoNotIndex{\the,\tiny,\unitlength,\uppercase,\xdef,\ProvidesPackage} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \changes{1.3}{1996/10/28}{First public release.} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \CheckSum{640} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \MakeShortVerb{|} +% +% \begin{abstract} +% cpwuzzle.dtx provides a package to typeset crossword puzzles. +% The leading philosophy is that the puzzle and the solution are +% typeset from the same source. +% +% The package can be used to produce several types of puzzles like +% the classical crossword puzzle, a number puzzle, and fill-in +% puzzles. In addition to the block separated puzzles the thick +% line delimited puzzles are supported as well. +% \end{abstract} +% +% \tableofcontents +% \newpage +% +% \section{About Crossword Puzzles} +% +% Crossword puzzles are can be a an amusing but also a challenging +% hobby. Unfortunately at the time of this writing I am not aware +% of any good package to typeset crossword puzzles with \LaTeX. +% Thus I decided to make one which at least fits my needs. +% +% There are several types of crossword puzzles among. This +% package can only be used to typeset several of them. The basic +% assumption in this package is that puzzles are rectangular +% arrangements of boxes. Some of these boxes are black and others +% are prepared to take single letters. +% Each word in the grid is enclosed in black boxes or the outside. +% +% Optionally there may be rectangular regions left blank inside the +% puzzle. They can be used to place ads or other informative texts +% inside the puzzle. +% +% \subsection{Classical Crossword Puzzles}\label{sec:classical} +% +% \PuzzleUnsolved +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |[1]E|X |* |. +% |[2]A|[3]S|T |* |[4]T|. +% |* |[5]P|A |R |T |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \begin{PuzzleClues}{Across}% +% \Clue{1}{EX}{unit of measure}% +% \Clue{2}{AST}{\(\ast\)}% +% \Clue{5}{PART}{sectioning unit}% +% \end{PuzzleClues}% +% \begin{PuzzleClues}{Down}% +% \Clue{1}{ETA}{\(\eta\)}% +% \Clue{3}{SP}{unit of measure}% +% \Clue{4}{TT}{non-proportional font}% +% \end{PuzzleClues}% +% \end{minipage}\medskip +% +% The ``classical'' type of a crossword puzzle words are marked +% with numbers and each word is accompanied with a clue which +% should help (or confuse) the reader. Those clues are listed after +% the frame of the puzzle. +% +% \subsection{Number Crossword Puzzles}\label{sec:numbered} +% +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |[6]E|[1]X|* |. +% |[5]A|[2]S|[7]T|* |[7]T|. +% |* |[4]P|[5]A|[3]R|[7]T|. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \PuzzleLetters{AEPRSTX}\medskip\par +% \PuzzleNumbers{XSRPAET}% +% \end{minipage}\medskip +% +% The ``number puzzle'' variant contains only numbers instead of +% letters. Different numbers denote different letters. There are no +% clues. The reader is assumed to find a complete list of letters +% by filling appropriate words into the grid. Sometimes a word is +% already entered into the grid to ease the start. +% +% \subsection{Fill-In Crossword Puzzles}\label{sec:fill-in} +% +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |E |X |* |. +% |A |S |T |* |T |. +% |* |P |A |R |T |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \begin{PuzzleWords}{2} +% \Word{EX}% +% \Word{SP}% +% \Word{TT}% +% \end{PuzzleWords}% +% \begin{PuzzleWords}{3} +% \Word{AST}% +% \Word{ETA}% +% \end{PuzzleWords}% +% \begin{PuzzleWords}{4} +% \Word{PART}% +% \end{PuzzleWords}% +% \end{minipage}\medskip +% +% The ``fill-in puzzle'' variant consists of a frame containing +% only black and white boxes. Additionally a list of words is given +% which have to be put into the frame until none is left and the +% frame is completed. +% +% \subsection{Line delimited Crossword Puzzles}\label{sec:line-delimited} +% +% The crossword puzzles we have seen before had the property that +% words are either delimited by the outer border or by a solid +% block. In addition line delimited puzzles are common. In this +% case a thicker line is drawn to indicate the end of a line.\medskip +% +% \noindent +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |[1] c |[2] c |[3][l]e |[4] x |[5] p |. +% |[6] l | o |[][o]t |[7][l]m| u |. +% | o |[][fl]s|[8][l]a | l |[][o]t |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \begin{PuzzleClues}{Across}% +% \Clue{1}{CC}{unit of measure}% +% \Clue{3}{EXP}{math function}% +% \Clue{6}{LOT}{list of tables}% +% \Clue{7}{MU}{$\mu$}% +% \Clue{8}{ALT}{key}% +% \end{PuzzleClues}% +% \begin{PuzzleClues}{Down}% +% \Clue{1}{CLO}{class option}% +% \Clue{2}{COS}{math function}% +% \Clue{3}{ETA}{\(\eta\)}% +% \Clue{4}{XML}{all in angle brackets}% +% \Clue{5}{PUT}{\LaTeX\ place picture element}% +% \end{PuzzleClues}% +% \end{minipage} +% +% In the example above we can see another feature. This feature is +% that two letters are circled. This can be used to indicate +% letters for a solution word of the crossword puzzle. +% +% +% +% \subsection{Solutions} +% +% \PuzzleSolution +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |[1]E|X |* |. +% |[2]A|[3]S|T |* |[4]T|. +% |* |[5]P|A |R |T |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \end{minipage}\medskip +% +% Often it is not only desirable to typeset the unsolved crossword +% puzzle but also the solution. This means that all the letters +% have to be filled in. This should be possible with the same +% source as the questions to avoid typos or redundancies leading to +% additional work. +% +% Several variants of solutions come to mind. Primarily the +% solution should show the letters and suppress any clues. One +% major distinction is also whether or not the numbers of the words +% should be shown in the solution as well.\medskip +% +% \noindent +% \PuzzleSolution[true]% +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |[1]E|X |* |. +% |[2]A|[3]S|T |* |[4]T|. +% |* |[5]P|A |R |T |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \end{minipage}% +% +% Finally there are the lists of letters in numbered puzzles. In +% the solution they will show the letters in them as well.\medskip +% +% \noindent +% \PuzzleSolution[false]% +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{3}% +% |* |* |[6]E|[1]X|* |. +% |[5]A|[2]S|[7]T|* |[7]T|. +% |* |[4]P|[5]A|[3]R|[7]T|. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \PuzzleLetters{AEPRSTX}\medskip\par +% \PuzzleNumbers{XSRPAET}% +% \end{minipage} +% +% +% \section{Input of Crossword Puzzles} +% +% The basic idea behind this package is that a crossword puzzle is +% specified in a separate file. The actual appearance of the puzzle +% is controlled by several options. Thus it should be possible to +% produce the unsolved and the solved puzzle from the same +% source. Before we describe the various options we will have a +% look at the basic environments and macros used to specified a +% crossword puzzle. +% +% \DescribeEnv{Puzzle}% +% This package provides the environment |Puzzle| which typesets the +% frame of a crossword puzzle. This environment takes two +% arguments. These arguments are the number of columns and the +% number of the rows of the puzzle. This means that essentially +% only rectangular puzzles can be typeset. +% +% The example from section~\ref{sec:classical} has been entered as +% follows: +% \begin{verbatim} +% \begin{Puzzle}{5}{3}% +% |* |* |[1]E|X |* |. +% |[2]A|[3]S|T |* |[4]T|. +% |* |[5]P|A |R |T |. +% \end{Puzzle} +% \end{verbatim} +% In this example we can see that inside the |Puzzle| environment +% there is one special character. This is the bar \verb/|/. This +% bar is an active character in \TeX. Thus you can think of it +% like a macro. +% +% The \verb/|/ macro takes three arguments. The first two arguments +% are optional, i.e. enclosed in brackets if present. The first +% optional argument denotes the number for numbered boxes. The +% second optional argument specifies the formatting of the cell. +% +% The third argument is either empty |{}| or it consists of a +% single character. This argument describes the action to be +% performed. +% +% \begin{itemize} +% \item If this argument is a letter then it is simply shown +% in the solution and suppressed in the unsolved crossword puzzle. +% +% \item If this argument is an asterisk |*| then a black box is +% produced. +% +% \item If this argument is a dot |.| then this marks the end of +% the current row. The next box is typeset at the beginning of the +% following row. +% +% \item If this argument is empty |{}| then a white box is +% typeset. This box does not contain a letter, nor does it have a +% frame. This macro can be used to leave room for larger boxed with +% ads. Alternatively this can be used to disable certain boxes to +% make a non-rectangular crossword puzzle. +% \end{itemize} +% +% \begin{verbatim} +% \begin{Puzzle}{5}{5} +% |{} |{} |[1]S|. +% |{} |[2]M|I |[3]D|. +% |[4]T|I |M |E |S |. +% |{} |[5]N|E |G |. +% |{} |{} |Q |. +% \end{Puzzle} +% \end{verbatim} +% \PuzzleUnsolved +% \begin{minipage}{.35\textwidth}% +% \begin{Puzzle}{5}{5}% +% |{} |{} |[1]S|. +% |{} |[2]M|I |[3]D|. +% |[4]T|I |M |E |S |. +% |{} |[5]N|E |G |. +% |{} |{} |Q |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \begin{PuzzleClues}{\textbf{Across: }}% +% \Clue{2}{MID}{\(\mid\)}% +% \Clue{4}{TIMES}{\(\times\)}% +% \Clue{5}{NEG}{\(\neg\)}% +% \end{PuzzleClues}% +% \begin{PuzzleClues}{\textbf{Down: }}% +% \Clue{1}{SIMEQ}{\(\simeq\)}% +% \Clue{2}{MIN}{log-like function}% +% \Clue{3}{DEG}{log-like function}% +% \end{PuzzleClues}% +% \end{minipage}% +% +% Note that white-space is ignored after the arguments but not +% between the bar and the arguments. +% \bigskip +% +% The formatting of the cell is controlled by the second optional +% argument of the \verb/|/ macro. This optional argument may +% contain a list of several characters. Each of these characters is +% interpreted from left to right. The following list describes the +% meaning of the built-in characters.\medskip +% +% \PuzzleUnsolved +% \newenvironment{CellLetter}[1]{\par\noindent +% \begin{minipage}{.25\textwidth} +% \let\PuzzlePre\relax +% \let\PuzzlePost\relax +% \begin{Puzzle}{1}{1}|[8][#1]X +% \end{Puzzle}\tt\quad +% \char`\|[8][#1]X +% \end{minipage}% +% \begin{minipage}{.7\textwidth} +% }{\end{minipage}\smallskip}% +% \begin{CellLetter}{f} +% The letter f produces a simple frame around the cell. This is +% the default if nothing is specified. +% \end{CellLetter}% +% \begin{CellLetter}{.} +% The character . produces no additional rendering it can be used +% to overwrite the default rendering which is to place a frame +% around the cell. +% \end{CellLetter}% +% \begin{CellLetter}{*} +% The character * produces a black box. This is the same effect +% which can be achieved by providing the character * to be filled +% into the cell for the solution. +% \end{CellLetter}% +% \begin{CellLetter}{O} +% The letter O produces an oval as drawn with the \LaTeX\ macro +% \verb/\oval/. +% \end{CellLetter}% +% \begin{CellLetter}{o} +% The letter o produces an oval inside a frame. T is is an +% abbreviation for the two letters fO. +% \end{CellLetter}% +% \begin{CellLetter}{t} +% The letter t produces a frame with a thicker line at the top. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{T} +% The letter T produces a thicker line at the top of the cell. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{b} +% The letter b produces a frame with a thicker line at the bottom. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{B} +% The letter B produces a thicker line at the bottom of the cell. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{l} +% The letter l produces a frame with a thicker line at the left +% side of the cell. The thickness of this line is controlled by +% the macro |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{L} +% The letter L produces a thicker line at the left side of the +% cell. The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{r} +% The letter r produces a frame with a thicker line at the right +% side of the cell. The thickness of this line is controlled by +% the macro |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{R} +% The letter R produces a thicker line at the right side of the +% cell. The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \end{CellLetter}% +% \begin{CellLetter}{/} +% The character / produces a line crossing the cell from lower +% left to upper right. +% \end{CellLetter}% +% \begin{CellLetter}{,} +% The character , produces a line crossing the cell from upper +% left to lower right. +% \end{CellLetter}% +% \begin{CellLetter}{S} +% The character S produces the solution, i.e. the content of the +% cell is typeset. No decorations are placed around. For this +% purpose it should be combined with some other formatting +% characters. +% \end{CellLetter}% +% +% Whenever you try to use an undefined specification for the cell +% frame a warning is printed and the letter is ignored. +% +% \DescribeMacro{\PuzzleDefineCell} +% You can define additional cell renderings of your own. For this +% purpose the macro |\PuzzleDefineCell| is provided. It takes two +% arguments. The first argument contains the key under which the +% rendering should be addressed in the optional second argument of +% the macro \verb/|/. The second argument contains the replacement +% text like in |\newcommand|. This replacement text can make use of +% two arguments. They are addressed with |#1| and |#2|. The first +% one contains the x coordinate of the cell to be rendered. The +% second one its y coordinate. +% +% The following example shows for instance the definition of a new +% cell type addressed by the key + which draws a thick frame around +% the cell. +% \begin{verbatim} +% \PuzzleDefineCell{+}{ +% \PuzzleThicklines +% \put(#1,#2){\framebox(1,1){}} +% } +% \end{verbatim} +% +% +% Finally we show how to define a cell type consisting of a colored +% box. The box itself is drawn with the help of the macro +% |\colorbox|. Thus it is necessary to load the package +% \texttt{color} which defines this macro. +% +% The two invocations show the combination with the f specifier. +% The specifier f is the default and used only if the user does not +% provide the optional argument. Thus we need to provide the f we +% we want to have it additionally.\medskip +% +% \noindent +% \begin{minipage}{.65\textwidth}\small +% \begin{verbatim} +% \definecolor{gray}{gray}{.9} +% \PuzzleDefineCell{c}{{% +% \put(#1,#2){\makebox(1,1){% +% \fboxsep=0pt +% \colorbox{gray}{\makebox(1,1){}}}} +% }} +% \begin{Puzzle}{2}{2} +% |[1][cf]X | {} |. +% |{} |[2][c]X |. +% \end{Puzzle} +% \end{verbatim} +% \end{minipage}\hfill +% \begin{minipage}{.30\textwidth} +% \definecolor{gray}{gray}{.9} +% \PuzzleDefineCell{c}{{% +% \fboxsep=0pt +% \put(#1,#2){\makebox(1,1){\colorbox{gray}{\makebox(1,1){}}}} +% }} +% \begin{Puzzle}{2}{2} +% |[1][cf]X | {} |. +% |{} |[2][c]X |. +% \end{Puzzle} +% \end{minipage} +% +% \DescribeMacro{\DefineColorCell} +% The macro |\DefineColorCell| simplifies this task by +% encapsulating the definition above. It has two arguments. The +% first one is the key character and the second one is th name of +% the color to use for the background.\medskip +% +% \noindent +% \begin{minipage}{.65\textwidth}\small +% \begin{verbatim} +% \definecolor{gray}{gray}{.9} +% \PuzzleDefineColorCell{g}{gray} +% \begin{Puzzle}{2}{2} +% |{} |[1][cf]X |. +% |[2][c]X |{} |. +% \end{Puzzle} +% \end{verbatim} +% \end{minipage}\hfill +% \begin{minipage}{.30\textwidth} +% \definecolor{gray}{gray}{.9} +% \PuzzleDefineColorCell{g}{gray} +% \begin{Puzzle}{2}{2} +% |{} |[1][cf]X |. +% |[2][c]X |{} |. +% \end{Puzzle} +% \end{minipage} +% +% \DescribeMacro{\Frame} +% The macro |\Frame| can be used to typeset ads or other text into +% larger boxes inside the frame of the crossword puzzle. For this +% purpose five arguments are required. The first two arguments are +% used to specify the lower left corner of the frame. The lower +% left corner has the coordinates 0,0 and the numbers increase +% upwards and to the right. +% +% The third argument is the width of the frame and the fourth +% argument is the height of the frame measured in number of boxes. +% Finally, the fifth argument contains the text to be typeset. Per +% default it is typeset in a mini-page of the appropriate width +% centered horizontally and vertically. +% +% \begin{verbatim} +% \begin{Puzzle}{8}{6} +% \Frame{2}{2}{4}{2}{\sf Crossword\\Puzzle} +% |[1]E|* |[2]N |U |L |[3]L |* |[4]V|. +% |[5]T|[6]R|I |A |N |G |[7]L|E |. +% |A |U |{} |{} |{} |{} |[8]C|C |. +% |* |L |{} |{} |{} |{} |E |* |. +% |[9]B|E |T |[10]A|* |[11]L|I |M |. +% |F |* |[12]L|A |B |E |L |* |. +% \end{Puzzle} +% \end{verbatim} +% +% \PuzzleUnsolved\noindent +% \begin{minipage}{.5\textwidth}\PuzzleUnitlength=18pt +% \begin{Puzzle}{8}{6}% +% \Frame{2}{2}{4}{2}{\sf Crossword\\Puzzle}% +% |[1]E|* |[2]N|U|L|[3]L|* |[4]V|. +% |[5]T|[6]R|I|A|N|G|[7]L|E|. +% |A|U|{}|{}|{}|{}|[8]C|C|. +% |* |L|{}|{}|{}|{}|E|* |. +% |[9]B|E|T|[10]A|* |[11]L|I|M|. +% |F|* |[12]L|A|B|E|L|* |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.47\textwidth} +% \begin{PuzzleClues}{\textbf{Across: }}% +% \Clue{2}{NULL}{empty}% +% \Clue{5}{TRIANGLE}{\(\triangle\)}% +% \Clue{8}{CC}{carbon copy (letter.sty)}% +% \Clue{9}{BETA}{\(\beta\)}% +% \Clue{11}{LIM}{limes}% +% \Clue{12}{LABEL}{mark it}% +% \end{PuzzleClues}% +% \begin{PuzzleClues}{\textbf{Down: }}% +% \Clue{1}{ETA}{\(\eta\)}% +% \Clue{2}{NI}{\(\ni\)}% +% \Clue{3}{LG}{logarithm}% +% \Clue{4}{VEC}{\(\vec{}\)}% +% \Clue{6}{RULE}{black rectangle}% +% \Clue{7}{LCEIL}{\(\lceil\)}% +% \Clue{9}{BF}{bold face}% +% \Clue{10}{AA}{\AA}% +% \Clue{11}{LE}{\(\le\)}% +% \end{PuzzleClues}% +% \end{minipage}% +% +% \DescribeEnv{PuzzleClues} +% The clues in the classical crossword puzzle are typeset with the +% use of the environment |PuzzleClues|. This environment takes one +% argument which is typeset before the clues. The environment takes +% roughly the half of the text width and make a mini-page with this +% width. Thus two invocations of this environment are typeset side +% by side. +% +% Alternatively if the solution is typeset then the environment +% |PuzzleClues| has no effect. +% +% \begin{verbatim} +% \begin{PuzzleClues}{\textbf{Across}}% +% \Clue{1}{EX}{unit of measure}% +% \Clue{2}{AST}{\(\ast\)}% +% \Clue{5}{PART}{sectioning unit}% +% \end{PuzzleClues}% +% \begin{PuzzleClues}{\textbf{Down}}% +% \Clue{1}{ETA}{\(\eta\)}% +% \Clue{3}{SP}{unit of measure}% +% \Clue{4}{TT}{nonproportional font}% +% \end{PuzzleClues}% +% \end{verbatim} +% +% \DescribeMacro{Clue} +% The environment |PuzzleClues| defines one local macro. This macro +% is named |\Clue| and takes three arguments. The first argument is +% the number of the word. This should correspond to the number in +% the puzzle frame. The second argument is the word itself. +% Currently this not used at all. Finally the third argument is the +% clue for the word. +% +% If the unsolved puzzle is typeset then the first and the third +% argument are used. Otherwise all arguments are silently absorbed. +% +% \DescribeMacro{\PuzzleLetters} +% The macro |\PuzzleLetters| can be used to typeset the list of +% used letters in numbered crossword puzzles. It has one argument +% which are the used letters (preferably in alphabetical order. +% +% \DescribeMacro{\PuzzleNumbers} +% The macro |\PuzzleNumbers| can be used to generate a numbered +% list of boxes for the numbered crossword puzzles. The user is +% supposed to collect the found letters here. +% +% \DescribeEnv{PuzzleWords} +% The environment |PuzzleWords| can be sued to typeset the list of +% words for a fill-in puzzle. It takes one argument. This is the +% length of the words listed. For each length there should be an +% invocation of this environment. The words in this environment are +% supposed to be ordered alphabetically. +% +% \DescribeMacro{\Word} +% The macro |\Word| is defined inside the environment +% |PuzzleWords|. It takes one argument which is the word itself. +% +% \begin{verbatim} +% \begin{PuzzleWords}{2} +% \Word{EX}% +% \Word{SP}% +% \Word{TT}% +% \end{PuzzleWords}% +% \begin{PuzzleWords}{3} +% \Word{AST}% +% \Word{ETA}% +% \end{PuzzleWords}% +% \begin{PuzzleWords}{4} +% \Word{PART}% +% \end{PuzzleWords}% +% \end{verbatim} +% +% +% \section{Other Grid-based Puzzles} +% +% In addition to the crossword puzzles other puzzles based on a +% grid can also be typeset with this package. The basic principle +% is the same. Just some minor simplifications have been provided. +% +% \subsection{Sudoku} +% +% A Sudoku is a puzzle on a $9\times9$ grid. It is filled with nine +% numbers. Each number occurs only once in each row, each column +% and each of the nine $3\times3$ boxes. Initially some of the +% numbers are shown. The goal is to fill in all missing digits. +% \medskip +% +% \begin{Sudoku} +% | 7|*2| 4| 1| 3| 5| 6|*9| 8|. +% |*3| 8|*1|*9| 7|*6|*5| 4|*2|. +% | 9| 6| 5|*8| 2|*4| 1| 3| 7|. +% | 2|*9| 6| 7| 1| 8| 3|*5| 4|. +% |*5| 1| 8|*2| 4|*3| 9| 7|*6|. +% | 4|*7| 3| 6| 5| 9| 8|*2| 1|. +% | 6| 3| 9|*4| 8|*7| 2| 1| 5|. +% |*8| 4|*2|*5| 9|*1|*7| 6|*3|. +% | 1|*5| 7| 3| 6| 2| 4|*8| 9|. +% \end{Sudoku} +% +% \DescribeEnv{Sudoku} +% The input for a Sudoku is given in a specialized environment. +% Since the size is fixed there is no need to specify a size. We +% separate the cells with a pipe symbol and mark the end of a line +% with a dot. To mark those cells contianing the hints we preceed +% the number with an asterisk. +% +% The Sudoku shown above is typeset from the following source: +% +% \begin{verbatim} +% \begin{Sudoku} +% | 7|*2| 4| 1| 3| 5| 6|*9| 8|. +% |*3| 8|*1|*9| 7|*6|*5| 4|*2|. +% | 9| 6| 5|*8| 2|*4| 1| 3| 7|. +% | 2|*9| 6| 7| 1| 8| 3|*5| 4|. +% |*5| 1| 8|*2| 4|*3| 9| 7|*6|. +% | 4|*7| 3| 6| 5| 9| 8|*2| 1|. +% | 6| 3| 9|*4| 8|*7| 2| 1| 5|. +% |*8| 4|*2|*5| 9|*1|*7| 6|*3|. +% | 1|*5| 7| 3| 6| 2| 4|*8| 9|. +% \end{Sudoku} +% \end{verbatim} +% +% As for crossword puzzles the macro |\PuzzleSolution| can be used +% to switch to solution mode. Then all numbers are shown. The +% parameters to modify the appearance of a puzzle work here as well. \medskip +% +% {\PuzzleSolution\PuzzleUnitlength=14pt\footnotesize\sf +% \begin{Sudoku} +% | 7|*2| 4| 1| 3| 5| 6|*9| 8|. +% |*3| 8|*1|*9| 7|*6|*5| 4|*2|. +% | 9| 6| 5|*8| 2|*4| 1| 3| 7|. +% | 2|*9| 6| 7| 1| 8| 3|*5| 4|. +% |*5| 1| 8|*2| 4|*3| 9| 7|*6|. +% | 4|*7| 3| 6| 5| 9| 8|*2| 1|. +% | 6| 3| 9|*4| 8|*7| 2| 1| 5|. +% |*8| 4|*2|*5| 9|*1|*7| 6|*3|. +% | 1|*5| 7| 3| 6| 2| 4|*8| 9|. +% \end{Sudoku}} +% +% Since the characters in the solution are numbers only we can use +% the following definition to colorize the cells in the solution. +% +% \begin{verbatim} +% \def\PuzzleSolutionContent#1{\fboxsep=0pt +% \def\myColor{}% +% \ifcase#1 +% \def\myColor{white}%0 +% \or\def\myColor{red}%1 +% \or\def\myColor{green}%2 +% \or\def\myColor{yellow}%3 +% \or\def\myColor{orange}%4 +% \or\def\myColor{lime}%5 +% \or\def\myColor{purple}%6 +% \or\def\myColor{violet}%7 +% \or\def\myColor{teal}%8 +% \or\def\myColor{brown}%9 +% \else\def\myColor{white}%* +% \fi +% \colorbox{\myColor}{\makebox(1,1){#1}}} +% \end{verbatim} +% +% With the help of the package \textsf{xcolor} for the predefined +% colors we get the following output: \medskip +% +% {\def\PuzzleSolutionContent#1{\fboxsep=0pt +% \def\myColor{}\ifcase#1 +% \def\myColor{white}\or\def\myColor{red}\or\def\myColor{green}\or\def\myColor{yellow}\or\def\myColor{orange}\or\def\myColor{lime}\or\def\myColor{purple}\or\def\myColor{violet}\or\def\myColor{teal}\or\def\myColor{brown}\else\def\myColor{white}\fi +% \colorbox{\myColor}{\makebox(1,1){#1}}} +% \PuzzleSolution\PuzzleUnitlength=14pt\footnotesize\sf +% \begin{Sudoku} +% | 7|*2| 4| 1| 3| 5| 6|*9| 8|. +% |*3| 8|*1|*9| 7|*6|*5| 4|*2|. +% | 9| 6| 5|*8| 2|*4| 1| 3| 7|. +% | 2|*9| 6| 7| 1| 8| 3|*5| 4|. +% |*5| 1| 8|*2| 4|*3| 9| 7|*6|. +% | 4|*7| 3| 6| 5| 9| 8|*2| 1|. +% | 6| 3| 9|*4| 8|*7| 2| 1| 5|. +% |*8| 4|*2|*5| 9|*1|*7| 6|*3|. +% | 1|*5| 7| 3| 6| 2| 4|*8| 9|. +% \end{Sudoku}} +% +% Note that this definition has to be restricted to a local block +% if you have solutions for other puzzle types in the same +% document. +% +% +% \subsection{Kakuro} +% +% In a Kakuro the cells are filled with digits. Each ``word'' +% consists of different digits; i.e. a number can not be repeated +% in a consecutive horizontal or vertical sequence of numbers. +% +% The hints for the ``words'' are the sums of the digits. +% +% \begin{Kakuro}{6}{9} +% | - |<:13> |<:37> | - |<:41> |<:7> | - |. +% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |. +% |<13:> | 9 |* 7 |<3:20>| 2 | 1 | - |. +% |<11:> | 1 | 2 | 3 | 5 | - | - |. +% | - |<23:> | 6 |* 8 | 9 | - | - |. +% | - |<29:3>| 8 | 9 | 7 | 5 | - |. +% |<11:> | 2 | 9 |<6:> |* 4 | 2 | - |. +% |<5:> |* 1 | 4 |<7:> | 6 | 1 | - |. +% | - | - | - | - | - | - | - |. +% \end{Kakuro} +% +% \DescribeEnv{Kakuro} +% The input for a Kakuro is given in a specialized environment. It +% takes the width and the height as arguments. +% We separate the cells with a pipe symbol and mark the end of a line +% with a dot. To mark those cells contianing the initial digits we +% preceed the digit with an asterisk. +% +% The hints are enteres in angle brackets. They contain the +% horizontal and vertical sums separated by a colon. The sums can +% be empty if none should be typeset. +% +% The Kakuro shown above is typeset from the following source: +% +% \begin{verbatim} +% \begin{Kakuro}{6}{9} +% | - |<:13> |<:37> | - |<:41> |<:7> | - |. +% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |. +% |<13:> | 9 |* 7 |<3:20>| 2 | 1 | - |. +% |<11:> | 1 | 2 | 3 | 5 | - | - |. +% | - |<23:> | 6 |* 8 | 9 | - | - |. +% | - |<29:3>| 8 | 9 | 7 | 5 | - |. +% |<11:> | 2 | 9 |<6:> |* 4 | 2 | - |. +% |<5:> | 1 | 4 |<7:> | 6 | 1 | - |. +% | - | - | - | - | - | - | - |. +% \end{Kakuro} +% \end{verbatim} +% +% As for crossword puzzles the macro |\PuzzleSolution| can be used +% to switch to solution mode. Then all numbers are shown. +% +% \begin{minipage}{.25\textwidth} +% {\PuzzleSolution +% \PuzzleUnitlength=14pt +% \footnotesize\sf +% \begin{Kakuro}{6}{9} +% | - |<:13> |<:37> | - |<:41> |<:7> | - |. +% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |. +% |<13:> | 9 |* 7 |<3:20>| 2 | 1 | - |. +% |<11:> | 1 | 2 | 3 | 5 | - | - |. +% | - |<23:> | 6 |* 8 | 9 | - | - |. +% | - |<29:3>| 8 | 9 | 7 | 5 | - |. +% |<11:> | 2 | 9 |<6:> |* 4 | 2 | - |. +% |<5:> | 1 | 4 |<7:> | 6 | 1 | - |. +% | - | - | - | - | - | - | - |. +% \end{Kakuro}} +% \end{minipage}\hfill +% \begin{minipage}{.7\textwidth}\footnotesize +% \begin{verbatim} +% \PuzzleSolution +% \PuzzleUnitlength=14pt +% \footnotesize\sf +% \begin{Kakuro}{6}{9} +% | - |<:13> |<:37>| - |<:41>|<:7> | - |. +% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |. +% |<13:>| 9 |* 7 |<3:20>| 2 | 1 | - |. +% |<11:>| 1 | 2 | 3 | 5 | - | - |. +% | - |<23:> | 6 |* 8 | 9 | - | - |. +% | - |<29:3>| 8 | 9 | 7 | 5 | - |. +% |<11:>| 2 | 9 |<6:> |* 4 | 2 | - |. +% |<5:> | 1 | 4 |<7:> | 6 | 1 | - |. +% | - | - | - | - | - | - | - |. +% \end{Kakuro} +% \end{verbatim} +% \end{minipage} +% +% +% \section{Parameters and Options} +% +% The package cwpuzzle can be controlled by a rich set of macros. +% In addition some settings can be performed with style options. The +% following style options are recognized: +% \begin{description} +% \item [numbered] +% The solution numbering is turned on. +% \item [nocenter] +% The puzzle is not typeset in a centered paragraph of its own. +% \item [unboxed] +% The clues are not enclosed in mini-pages and centered on the +% page. +% \item [normalsize] +% The puzzle is set in normalsize. This is the default. +% \item [small] +% The puzzle is set in small. The size of the cell and the font +% size of the solution are adjusted accordingly. +% \item [large] +% The puzzle is set in large. The size of the cell and the font +% size of the solution are adjusted accordingly. +% \item [german] +% \item [ngerman] +% The build in texts are switched to german variants. The +% defaults are English. This options is also in effect when given +% to the document class. The style inherits it from there. +% \end{description} +% +% The style options can be passed to the style in the usual way: +% \begin{verbatim} +% \usepackage[nocenter,unboxed,small]{cwpuzzle} +% \end{verbatim} +% +% The fine tuning can be achieved with the help of several macros. +% Those macros are described below. +% +% \DescribeMacro{\PuzzleUnitlength} +% The length |\PuzzleUnitlength| determines the width and height of +% each single box in the frame of a crossword puzzle. The default +% value is |20pt|. +% +% \DescribeMacro{\PuzzleBlackBox} +% The macro |\PuzzleBlackBox| contains the commands to produce the +% black boxes. It has to produce at most of width and height of +% |\PuzzleUnitlength|. Per default it just produces a black +% rectangle of this size. +% +% The following list shows some variants which can be achieved by +% redefining the macro |\PuzzleBlackBox|.\medskip +% +% \noindent +% \unitlength=\PuzzleUnitlength +% \framebox(1,1){\rule{.75\PuzzleUnitlength}{.75\PuzzleUnitlength}} +% \hfill +% \begin{minipage}{.9\textwidth} +% \begin{verbatim} +% \renewcommand{\PuzzleBlackBox}{\rule{.75\PuzzleUnitlength}% +% {.75\PuzzleUnitlength}} +% \end{verbatim} +% \end{minipage} +% +% \noindent +% \framebox(1,1){\framebox(.75,.75){\framebox(.5,.5){}}} +% \hfill +% \begin{minipage}{.9\textwidth} +% \begin{verbatim} +% \renewcommand{\PuzzleBlackBox}{\framebox(.75,.75){% +% \framebox(.5,.5){}}} +% \end{verbatim} +% \end{minipage} +% +% Additional effects can be achieved by using shades of gray (with +% the |graphics| package). +% +% \DescribeMacro{\PuzzleFont} +% The macro |\PuzzleFont| contains the font changing +% command issued before the frame of the crossword puzzle. +% +% \DescribeMacro{\PuzzleNumberFont} +% The macro |\PuzzleNumberFont| contains the font changing +% command issued before a number in the frame of the crossword +% puzzle is typeset. +% +% \DescribeMacro{\PuzzleClueFont} +% The macro |\PuzzleClueFont| contains the font changing +% command issued before the clues are typeset. +% +% \DescribeMacro{\PuzzleWordsText} +% The macro |\PuzzleWordsText| contains the text which is typeset +% at the beginning of the environment |PuzzleWords|. It has one +% argument which contains the length of the words listed. +% +% \DescribeMacro{\PuzzleLettersText} +% The macro |\PuzzleLettersText| contains the text which is typeset +% at the beginning of the macro |\PuzzleLetters|. +% +% \DescribeMacro{\PuzzleSolution} +% The macro |\PuzzleSolution| arranges everything that the +% following puzzles are typeset in the ``solution'' mode, i.e. the +% letters are shown and the clues are suppressed. +% +% This macros has one optional argument which has to be |true| or +% |false|. This argument determines whether or not the numbers +% should also be shown in the solution. The default is |false| +% which means that the numbers are suppressed in the solution. +% +% \DescribeMacro{\PuzzleUnsolved} +% The macro |\PuzzleUnsolved| arranges everything that the +% following puzzles are typeset in the ``unsolved'' mode, i.e. the +% letters are suppressed and the clues are shown. +% +% \DescribeMacro{\PuzzlePutNumber} +% The macro |\PuzzlePutNumber| is a configuration macro which +% typesets the number in a cell. The first argument is the x +% coordinate. The second argument is the y coordinate. The third +% argument is the number to be typeset. The coordinates are integer +% numbers. The coordinate (0,0) is the lower left corner. +% +% \DescribeMacro{\PuzzleHook} +% The macro |\PuzzleHook| is called at the end of the |Puzzle| +% environment. It can be used to place additional graphical +% elements in the puzzle frame. +% +% The following example shows a crossword puzzle which we have seen +% before and the definition for the |\PuzzleHook|.\medskip +% +% \PuzzleUnsolved +% \begin{minipage}{.35\textwidth}% +% \newcommand\PuzzleHook{% +% \put(0,2){\line(1,-1){2}} +% \put(0,3){\line(1,1){2}} +% \put(5,2){\line(-1,-1){2}} +% \put(5,3){\line(-1,1){2}} +% } +% \begin{Puzzle}{5}{5}% +% |{} |{} |[1]S|. +% |{} |[2]M|I |[3]D|. +% |[4]T|I |M |E |S |. +% |{} |[5]N|E |G |. +% |{} |{} |Q |. +% \end{Puzzle}% +% \end{minipage}% +% \begin{minipage}{.6\textwidth} +% \begin{verbatim} +% \newcommand\PuzzleHook{ +% \put(0,2){\line(1,-1){2}} +% \put(0,3){\line(1,1){2}} +% \put(5,2){\line(-1,-1){2}} +% \put(5,3){\line(-1,1){2}} +% } +% \end{verbatim} +% \end{minipage} +% +% \DescribeMacro{\PuzzleLineThickness} +% The macro |\PuzzleLineThickness| contains the width of the line +% used to frame the cells. +% +% \DescribeMacro{\PuzzlePre} +% This macro contains the code to be inserted before a puzzle is +% typeset. It is initialized to begin a new paragraph and center the +% puzzle. +% +% \DescribeMacro{\PuzzlePost} +% This macro contains the code to be inserted after a puzzle is +% typeset. It is initialized to end the paragraph and center the +% puzzle. +% +% \DescribeMacro{\PuzzleCluePre} +% This macro contains the code to be inserted before the clues are +% typeset in normal mode. It is initialized to end the paragraph +% and center the puzzle. +% +% \DescribeMacro{\PuzzleCluePost} +% This macro contains the code to be inserted after the clues are +% typeset in normal mode. It is initialized to end the paragraph +% and center the puzzle. +% +% \DescribeMacro{\PuzzleContent} +% This macro contains the content of a cell during formatting this +% cell. This enables the cell formating macro to access it. +% +% \DescribeMacro{\PuzzleSolutionContent} +% This macro processes the letter in solution mode. It takes one +% argument, the letter. This macro can be redefinied to achieve +% special effects for the solution. +% +% \DescribeMacro{\SudokuLinethickness} +% This macro contains the thickness of the thick lines in a sudoku. +% +% \DescribeMacro{\KakuroNumberFont} +% This macro contains the definition of the font switching macros +% used when typesetting a Kakuro hint. +% +% \DescribeMacro{\KakuroHintTypeKakuroNumberFont} +% This macro contains the cell type used when typesetting a Kakuro +% hint. It can be used to redefine the appearance. +% +% +% +% \section{Further Plans} +% +% \subsection{General} +% +% Maybe I will add a mode for further variants of crossword puzzles +% sometimes. +% +% Maybe I can add support for further languages if someone provides +% the appropriate texts. Contributions are welcome. +% +% +% \subsection{The Related Program} +% +% There is a related program written in Perl/Tk. This program can be +% used to manually construct crossword puzzles and save them in a +% format suitable for this package. +% Other features include the creation of a proper frame and filling +% with words. +% +% Right now I have not prepared a distribution of this program yet +% since this program requires dictionaries which I can not +% distribute legally. +% +% The crossword examples in this documentation have been computed +% with the help of the |cwp| program. +% +% +% \StopEventually{} +% \newpage +% +% +% \section{The Implementation} +% +% The crossword puzzle is basically implemented with the \LaTeX{} +% picture environment. This gives us enough flexibility and +% provides an high enough abstraction such that we do not have to +% fiddle around with to many low level details. +% +% The natural unit in a crossword puzzle is a box which is empty +% or black. Thus the |unitlength| is set to the width (and height) +% of such a box. +% +% +% \subsection{Basic Definitions and Parameters} +% +% First we identify this package. +% +% \begin{macrocode} +\ProvidesPackage{cwpuzzle}[\filedate gene] +% \end{macrocode} +% Next we load the package amssymb beended for the triangles used +% in Kakuros +% \begin{macrocode} +\RequirePackage{amssymb} +% \end{macrocode} +% +% The dimen register |\PuzzleUnitlength| stores the height and +% width of a box of the puzzle. The default is |20pt| which is +% also shown in this documentation. +% \begin{macrocode} +\newdimen\PuzzleUnitlength +\PuzzleUnitlength=20pt +% \end{macrocode} +% +% \begin{macro}{\PuzzleClueFont} +% +% The macro |\PuzzleClueFont| contains font changing +% commands issued before the clues are typeset. +% \begin{macrocode} +\newcommand\PuzzleClueFont{\footnotesize} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleFont} +% +% The macro |\PuzzleFont| contains font changing +% commands issued before the puzzle is typeset. +% \begin{macrocode} +\newcommand\PuzzleFont{\rm\normalsize} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleNumberFont} +% The macro |\PuzzleNumberFont| contains font changing +% commands issued before the numbers in a puzzle are typeset. +% \begin{macrocode} +\newcommand\PuzzleNumberFont{\sf\scriptsize} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleHook} +% Puzzles are typeset with the \LaTeX{} picture environment. At the +% end of this environment the macro |\PuzzleHook| is +% called. The package produces an empty default. Users may want to +% use this place to typeset additional elements on top of the +% puzzle. +% +% The puzzle uses a |\unitlength| of |\PuzzleUnitlength|. Thus it +% is rather easy to address the boxes in the puzzle. +% +% \begin{macrocode} +\let\PuzzleHook=\relax +% \end{macrocode} +% \end{macro} +% +% \subsection{The Frame of the Crossword Puzzle} +% +% To describe the coordinates where the next box should be typeset +% we need two counters for the coordinates. These counters are now +% allocated (even though we could use temporary counters from +% \LaTeX). +% \begin{macrocode} +\newcount\Puzzle@X +\newcount\Puzzle@Y +% \end{macrocode} +% +% \begin{macrocode} +\begingroup +\catcode`\|=13 +\gdef\Puzzle@@solution{ + \let|=\Puzzle@Box@@solution + \let\Frame=\Puzzle@Frame@@solution +} +% \end{macrocode} +% +% \begin{macrocode} +\gdef\Puzzle@@normal{ + \let|=\Puzzle@Box@@normal + \let\Frame=\Puzzle@Frame@@normal +} +\endgroup +% \end{macrocode} +% +% \begin{environment}{Puzzle} +% The environment |Puzzle| typesets the frame of a crossword +% puzzle. It is implemented utilizing a |picture| environment. The +% unitlength is set to the |\PuzzleUnitlength|. Thus the navigation +% is fairly easy. The basic unit is width and height of a single +% box. +% +% The macros which are local to the environment are activated. Thus +% we avoid collisions with other packages where the same macro names +% might be used. +% +% Finally the counter which contain the x and the y coordinate have +% to be initialized. +% +% The last action in the |picture| environment is the expansion of +% the macro |\PuzzleHook|. This can be used to include additional +% material in the |picture| environment. Primarily I have use this +% to include the ads. But now there is the macro |\Frame| for this +% purpose. +% \begin{macrocode} +\newenvironment{Puzzle}[2]{\PuzzlePre + \catcode`\|=13 + \@nameuse{Puzzle@@\Puzzle@TYPE}% + \unitlength=\PuzzleUnitlength + \linethickness{\PuzzleLineThickness}% + \Puzzle@Y=#2 + \begin{picture}(#1,#2) + \Puzzle@Box@@normal. +}{% + \PuzzleHook + \end{picture}\PuzzlePost +} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\PuzzleLineThickness} +% The macro |\PuzzleLineThickness| contains the width of the line +% used to frame the cells. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\newcommand\PuzzleLineThickness{.25pt} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzlePre} +% This macro contains the code to be inserted before a puzzle is +% typeset. It is initialized to begin a new paragraph and center the +% puzzle. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\newcommand\PuzzlePre{% + \par\noindent\mbox{}\hfill +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzlePost} +% This macro contains the code to be inserted after a puzzle is +% typeset. It is initialized to end the paragraph and center the +% puzzle. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\newcommand\PuzzlePost{% + \hfill\null\par\noindent +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Frame@@normal} +% The macro |Puzzle@Frame| is used to place additional +% rectangular regions into the puzzle frame. This frame can contain +% arbitrary text which is typeset in a centered environment. +% +% This macro takes five arguments. The first two arguments are the +% coordinates of the upper left corner of the frame. The +% coordinates are logical coordinates starting from the lower left +% corner of the puzzle. The next two arguments are the width and the +% height of the frame given in the number of boxes covered. Finally +% the fifth argument contains the text which should appear in this +% frame. +% \begin{macrocode} +\newcommand\Puzzle@Frame@@normal[5]{\put(#1,#2){\framebox(#3,#4){% + \begin{minipage}{#3\unitlength}\begin{center} #5 + \end{center}\end{minipage}}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Frame@@solution} +% For the solution the framed ads are simply ignored. +% \begin{macrocode} +\newcommand\Puzzle@Frame@@solution[5]{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleBlackBox} +% The macro |\PuzzleBlackBox| is called to typeset the black boxes. +% It should produce a box of at most width and height of +% |\PuzzleUnitlength|. +% \begin{macrocode} +\newcommand\PuzzleBlackBox{\rule{\PuzzleUnitlength}{\PuzzleUnitlength}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Box@@normal} +% The macro |\Puzzle@Box@@normal| performs all tasks when a box +% should be typeset in ``normal'' mode. The arguments are evaluated +% and the appropriate type of box typeset or other actions performed. +% \changes{1.4}{1996/11/25}{Minor bug fix. Using +% \texttt{\char`\\ifx} +% instead of \texttt{\char`\\if}.} +% \changes{1.5}{2006/08/10}{Reimplemented to cope with two optional +% arguments.} +% \begin{macrocode} +\newcommand\Puzzle@Box@@normal[1][]{% + \def\Puzzle@tmp@{#1}% + \Puzzle@Box@@normal@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Box@@normal@} +% The macro |\Puzzle@Box@@normal@| performs all tasks when a box +% should be typeset in ``normal'' mode. The arguments are evaluated +% and the appropriate type of box typeset or other actions performed. +% \changes{1.5}{2006/08/10}{Extracted from +% \texttt{\char`\\Puzzle@Box@@normal}.} +% \changes{1.7}{2009/06/09}{\texttt{\char`\\PuzzleContent} added to +% transport the letter to the formatting macro.} +% \begin{macrocode} +\newcommand\Puzzle@Box@@normal@[2][f]{% + \def\PuzzleContent{#2}% + \def\Puzzle@tmp{#2}% + \if\Puzzle@tmp. + \Puzzle@X=0 + \advance\Puzzle@Y-1 + \else + \ifx\Puzzle@tmp\@empty + \else + \if\Puzzle@tmp* + \Puzzle@Cell@Loop *#1{}% + \else + \Puzzle@Cell@Loop #1{}% + \fi + \fi + \ifx\@empty\Puzzle@tmp@\else + \PuzzlePutNumber{\Puzzle@X}{\Puzzle@Y}{\Puzzle@tmp@}% + \fi + \advance\Puzzle@X 1 + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzlePutNumber} +% The macro |\PuzzlePutNumber| is a configuration macro which +% typesets the number in a cell. The first argument is the x +% coordinate. The second argument is the y coordinate. The third +% argument is the number to be typeset. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\def\PuzzlePutNumber#1#2#3{% + \put(#1,#2){\makebox(1,.95)[tl]{\PuzzleNumberFont\,#3}}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@Loop} +% The macro |\Puzzle@Cell@Loop| processes its arguments until an +% empty argument is found. For each argument it is tried to invoke +% the corresponding cell drawing macro. +% \changes{1.5}{2006/08/09}{New} +% \begin{macrocode} +\def\Puzzle@Cell@Loop#1{% + \def\Puzzle@tmp{#1}% + \ifx\Puzzle@tmp\@empty + \let\Puzzle@tmp\relax + \else + \expandafter\ifx\csname Puzzle@Cell@@#1\endcsname\relax + \typeout{cwpuzzle: Cell type #1 is undefined. I am ignoring it}% + \else + \csname Puzzle@Cell@@#1\endcsname{\Puzzle@X}{\Puzzle@Y}% + \fi + \let\Puzzle@tmp\Puzzle@Cell@Loop + \fi + \Puzzle@tmp +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Box@@solution} +% The macro |\Puzzle@Box@@solution| performs all tasks when a box +% should be typeset in ``solution'' mode. The arguments are evaluated +% and the appropriate type of box typeset or other actions performed. +% \changes{1.4}{1996/11/25}{Minor bug fix. Using \texttt{\char`\\ifx} instead of \texttt{\char`\\if}.} +% \changes{1.5}{2006/08/10}{Reimplemented to cope with two optional arguments.} +% \begin{macrocode} +\newcommand\Puzzle@Box@@solution[1][]{% + \def\Puzzle@tmp@{#1}% + \Puzzle@Box@@solution@ +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Box@@solution@} +% The macro |\Puzzle@Box@@solution@| performs all tasks when a box +% should be typeset in ``solution'' mode. The arguments are evaluated +% and the appropriate type of box typeset or other actions performed. +% \changes{1.5}{2006/08/10}{Reimplemented to cope with two optional arguments.} +% \changes{1.9}{2014/01/12}{Macro PuzzleSolutionContent introduced as extension point} +% \begin{macrocode} +\newcommand\Puzzle@Box@@solution@[2][f]{% + \def\Puzzle@tmp{#2}% + \if\Puzzle@tmp. + \Puzzle@X=0 + \advance\Puzzle@Y-1 + \else + \ifx\Puzzle@tmp\@empty + \else + \if\Puzzle@tmp* + \Puzzle@Cell@Loop *#1{}% + \else + \Puzzle@Cell@Loop #1{}% + \put(\Puzzle@X,\Puzzle@Y){\PuzzleSolutionContent{#2}}% + \fi + \fi + \def\Puzzle@tmp{#1}% + \ifx\Puzzle@tmp\@empty\else + \ifPuzzle@SolutionNumbered + \PuzzlePutNumber{\Puzzle@X}{\Puzzle@Y}{\Puzzle@tmp@}% + \fi + \fi + \advance\Puzzle@X 1 + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleSolutionContent} +% The macro |\PuzzleSolutionContent| procees the character in +% solution mode. Per default it converts the argument to upper +% caseand sets it in a box of size $1\times1$. +% \changes{1.9}{2014/01/12}{Macro PuzzleSolutionContent introduced as extension point} +% \begin{macrocode} +\def\PuzzleSolutionContent#1{\makebox(1,1){\uppercase{#1}}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Predefined Cell Types} +% In this section a series of frame types are defined. +% +% \begin{macro}{\PuzzleDefineCell} +% The macro |\PuzzleDefineCell| is a user command to define a new +% cell type. The first argument contains the key under which the +% cell type should be addressed. This key should be expandable and +% should result into a single letter. Special effects can be +% achieved with keys constituted of non letters or several +% characters. +% +% The second argument contains the code to be stored for the key +% given. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\newcommand\PuzzleDefineCell[2]{ + \global\@namedef{Puzzle@Cell@@#1}##1##2{#2}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\PuzzleDefineColorCell} +% +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\newcommand\PuzzleDefineColorCell[2]{ + \global\@namedef{Puzzle@Cell@@#1}##1##2{% + \fboxsep=0pt + \put(##1,##2){\makebox(1,1){\colorbox{#2}{\makebox(1,1){}}}} + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleThickine} +% The parameter |\PuzzleThickine| contains the expansion text to +% be inserted. whenever a thick line is required. This means that +% this macro arranges everything that a thick line is drawn. +% Usually it contains an invocation to |\linethickness|. It can +% be redefined to achieve other effects like even thicker lines +% or colored lines. Note that the macro is used inside a group in +% the predefined cell types. +% \begin{macrocode} +\def\PuzzleThickline{\linethickness{2pt}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@T} +% The letter T produces a thicker line at the top of the cell. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{T}{{% + \advance#2 1 + \PuzzleThickline + \put(#1,#2){{\line(1,0){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@t} +% The letter t produces a frame with a thicker line at the top. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{t}{{% + \put(#1,#2){\framebox(1,1){}} + \advance#2 1 + \PuzzleThickline + \put(#1,#2){{\line(1,0){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\Puzzle@Cell@@B} +% The letter B produces a thicker line at the bottom of the cell. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{B}{{% + \PuzzleThickline + \put(#1,#2){{\line(1,0){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@b} +% The letter b produces a frame with a thicker line at the bottom. +% The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{b}{{% + \put(#1,#2){\framebox(1,1){}} + \PuzzleThickline + \put(#1,#2){{\line(1,0){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@l} +% The letter l produces a frame with a thicker line at the left +% side of the cell. The thickness of this line is controlled by +% the macro |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{l}{{% + \put(#1,#2){\framebox(1,1){}} + \PuzzleThickline + \put(#1,#2){{\line(0,1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@L} +% The letter L produces a thicker line at the left side of the +% cell. The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{L}{{% + \PuzzleThickline + \put(#1,#2){{\line(0,1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@r} +% The letter r produces a frame with a thicker line at the right +% side of the cell. The thickness of this line is controlled by +% the macro |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{r}{{% + \put(#1,#2){\framebox(1,1){}} + \advance #1 1 + \PuzzleThickline + \put(#1,#2){{\line(0,1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@R} +% The letter R produces a thicker line at the right side of the +% cell. The thickness of this line is controlled by the macro +% |\PuzzleThickline|. +% \changes{1.5}{2006/08/10}{New} +% \begin{macrocode} +\PuzzleDefineCell{R}{{% + \advance #1 1 + \PuzzleThickline + \put(#1,#2){{\line(0,1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@f} +% The letter f produces a simple frame around the cell. This is +% the default if nothing is specified. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{f}{{% + \put(#1,#2){\framebox(1,1){}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@S} +% The letter S produces the solution without any other formatting +% around it. +% \changes{1.7}{2009/06/09}{New} +% \begin{macrocode} +\PuzzleDefineCell{S}{{% + \put(#1,#2){\makebox(1,1){\expandafter\uppercase{\PuzzleContent}}} +}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\Puzzle@Cell@@.} +% The character . produces no additional rendering it can be used +% to overwrite the default rendering which is to place a frame +% around the cell. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\PuzzleDefineCell{.}{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@O} +% The letter O produces an oval as drawn with the \LaTeX\ macro +% \verb/\oval/. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\PuzzleDefineCell{O}{{% + \put(\the#1.5,\the#2.5){\oval(1,1){}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@o} +% The letter o produces an oval inside a frame. T is is an +% abbreviation for the two letters fO. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{o}{{% + \put(#1,#2){\framebox(1,1){}} + \put(\the#1.5,\the#2.5){\oval(1,1){}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@*} +% The letter * produces a solid black box. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{*}{% + \put(#1,#2){\framebox(1,1){\PuzzleBlackBox}} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@/} +% The character / produces a line crossing the cell from lower +% left to upper right. +% \changes{1.5}{2006/08/08}{New} +% \begin{macrocode} +\PuzzleDefineCell{/}{{% + \put(#1,#2){{\line(1,1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Cell@@,} +% The character , produces a line crossing the cell from upper +% left to lower right. +% \changes{1.5}{2006/08/11}{New} +% \begin{macrocode} +\PuzzleDefineCell{,}{{% + \advance#2 1 + \put(#1,#2){{\line(1,-1){1}}} +}} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Clues} +% +% \begin{macro}{\Puzzle@Clue@@normal} +% The first and the third argument are shown as clue. This macro is +% used for unsolved puzzles. +% \begin{macrocode} +\newcommand\Puzzle@Clue@@normal[3]{\textsf{#1} #3 } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Clue@@solution} +% In solutions clues are simply suppressed. Thus all three +% arguments are discarded. +% \begin{macrocode} +\newcommand\Puzzle@Clue@@solution[3]{} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{Puzzle@Clues@@normal} +% The environment |Puzzle@Clues@@normal| is mapped to |PuzzleClues| +% in ``normal'' mode. It typesets its contents in a mini-page of +% approximately half text width. +% \begin{macrocode} +\newenvironment{Puzzle@Clues@@normal}[1]{% + \let\Clue\Puzzle@Clue@@normal + \PuzzleCluePre + \PuzzleClueFont{#1}% +}{\PuzzleCluePost } +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\PuzzleCluePre} +% The macro |\PuzzleCluePre| contains the code which is inserted +% before the clues are typeset in normal mode. +% \begin{macrocode} +\newcommand\PuzzleCluePre{% + \null\hfill + \begin{minipage}[t]{.45\textwidth}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleCluePost} +% The macro |\PuzzleCluePost| contains the code which is inserted +% after the clues are typeset in normal mode. +% \begin{macrocode} +\newcommand\PuzzleCluePost{ + \end{minipage}\hfill\null +} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{Puzzle@Clues@@solution} +% The environment |Puzzle@Clues@@solution| is mapped to |PuzzleClues| +% in ``solution'' mode. It just suppresses any output. +% \begin{macrocode} +\newenvironment{Puzzle@Clues@@solution}[1]{% + \let\Clue\Puzzle@Clue@@solution +}{} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\PuzzleWordsText} +% The macro |\PuzzleWordsText| is the text typeset at the beginning +% of the environment |PuzzleWords|. It takes one argument which is +% the length of the words listed. +% \begin{macrocode} +\newcommand\PuzzleWordsText[1]{Words of length #1: } +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{Puzzle@Words@@normal} +% The environment |Puzzle@Words@@normal| will be mapped to the +% environment |PuzzleWords| in ``normal'' mode. It just arranges +% that words are typeset after the |\PuzzleWordsText| has shown the +% length of the words. Finally a new paragraph is started. +% \begin{macrocode} +\newenvironment{Puzzle@Words@@normal}[1]{% + \PuzzleWordsText{#1}% + \let\Word\relax +}{\par} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{Puzzle@Words@@solution} +% The environment |Puzzle@Words@@solution| will be mapped to the +% environment |PuzzleWords| in ``solution'' mode. It arranges +% things that the contents is silently ignored. +% \begin{macrocode} +\newenvironment{Puzzle@Words@@solution}[1]{% + \newcommand\Word[1]{}% +}{} +% \end{macrocode} +% \end{environment} +% +% \subsection{Numbers} +% +% \begin{macro}{\PuzzleNumbers} +% The macro |\PuzzleNumbers| will produce a list of boxes with +% numbers for letters. It is intended for numbered crossword puzzles. +% \begin{macrocode} +\newcommand\PuzzleNumbers[1]{\begingroup + \@nameuse{Puzzle@@\Puzzle@TYPE}% + \Puzzle@Y=0 + \Puzzle@X=1 + \unitlength=\PuzzleUnitlength + \Puzzle@Numbers#1.\endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@Numbers} +% The macro |\Puzzle@Numbers| loops through the arguments until it +% finds a dot. For each argument it produces a box, either with the +% numbers or with the letters or both, depending on the current +% settings. +% +% The loop is implemented via recursion. The box is typeset by the +% \verb/|/ macro which takes care of the current settings. For this +% purpose this character has to be made active temporarily. +% \begin{macrocode} +\begingroup +\catcode`\|=13 +\gdef\Puzzle@Numbers#1{% + \if#1. + \let\next\relax + \else + \begin{picture}(1,1) + \xdef\X{\the\Puzzle@X}% + \Puzzle@X=0 + |[\X]{#1}% + \end{picture}% + \let\next\Puzzle@Numbers + \advance\Puzzle@X 1 + \fi + \next +} +\endgroup +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleLettersText} +% The macro |\PuzzleLettersText| contains the text typeset at the +% beginning of the |\PuzzleLetters| environment. +% \begin{macrocode} +\newcommand\PuzzleLettersText{The following letters are used: } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleLetters} +% The macro |\PuzzleLetters| is intended to show the letters used +% in a numbered crossword puzzle. The argument is the (sorted) list +% of characters used. +% \begin{macrocode} +\newcommand\PuzzleLetters[1]{\PuzzleLettersText #1\par} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Puzzle@TYPE} +% The macro |\Puzzle@TYPE| contains the type of the puzzle. It is +% used find the appropriate initialization macro. +% \begin{macrocode} +\newcommand\Puzzle@TYPE{normal} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleSolution} +% The macro |\PuzzleSolution| arranges everything that the +% following puzzles are typeset in the ``solution'' mode, i.e. the +% letters are shown and the clues are suppressed. +% +% This macros has one optional argument which has to be |true| or +% |false|. This argument determines whether or not the numbers +% should also be shown in the solution. The default is |false| +% which means that the numbers are suppressed in the solution. +% \begin{macrocode} +\newcommand\PuzzleSolution[1][false]{% + \@nameuse{Puzzle@SolutionNumbered#1}% + \let\Kakuro@HINT\Kakuro@nohint + \let\PuzzleClues\Puzzle@Clues@@solution + \let\endPuzzleClues\endPuzzle@Clues@@solution + \let\PuzzleWords\Puzzle@Words@@solution + \let\endPuzzleWords\endPuzzle@Words@@solution + \def\Puzzle@TYPE{solution}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PuzzleUnsolved} +% The macro |\PuzzleUnsolved| arranges everything that the +% following puzzles are typeset in the ``unsolved'' mode, i.e. the +% letters are suppressed and the clues are shown. +% \begin{macrocode} +\newcommand\PuzzleUnsolved{% + \let\Kakuro@HINT\Kakuro@hint + \let\PuzzleClues\Puzzle@Clues@@normal + \let\endPuzzleClues\endPuzzle@Clues@@normal + \let\PuzzleWords\Puzzle@Words@@normal + \let\endPuzzleWords\endPuzzle@Words@@normal + \xdef\Puzzle@TYPE{normal}} +% \end{macrocode} +% \end{macro} +% +% The boolean |Puzzle@SolutionNumbered| determines whether or +% not the solution should contain numbers. Initially it is set to +% ``false''. +% +% \begin{macrocode} +\newif\ifPuzzle@SolutionNumbered +\Puzzle@SolutionNumberedfalse +% \end{macrocode} +% +% \subsection{Sudoku} +% +% The challenge for the sudoku is to implement a convenient input syntax. +% +% \begin{environment}{Sudoku} +% The environemnt |Sudoku| is used to typeset the puzzle. +% The implementation defines the begin and end macro separately. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\begingroup +\catcode`\|=13 +\gdef\Sudoku{\begin{Puzzle}{9}{9}% + \let\Puzzle@pipe=|% + \def\PPa{\Puzzle@pipe[][fS]}% + \def|##1{\ifx##1*\let\next\PPa\else\Puzzle@pipe{##1}\let\next\relax\fi\next} +} +\endgroup +% \end{macrocode} +% +% The macro |\endSudoku| contains the code to be expanded at the +% end of the environment. It draws the field with the $3\times3$ +% boxes. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\gdef\endSudoku{% + \multiput(0,0)(1,0)9{\framebox(1,1){}} + \multiput(0,1)(1,0)9{\framebox(1,1){}} + \multiput(0,2)(1,0)9{\framebox(1,1){}} + \multiput(0,3)(1,0)9{\framebox(1,1){}} + \multiput(0,4)(1,0)9{\framebox(1,1){}} + \multiput(0,5)(1,0)9{\framebox(1,1){}} + \multiput(0,6)(1,0)9{\framebox(1,1){}} + \multiput(0,7)(1,0)9{\framebox(1,1){}} + \multiput(0,8)(1,0)9{\framebox(1,1){}} + \linethickness{\SudokuLinethickness}% + \put(0,0){\framebox(9,9){}} + \put(3,0){\framebox(3,9){}} + \put(0,3){\framebox(9,3){}} +\end{Puzzle}} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\SudokuLinethickness} +% The macro |\SudokuLinethickness| contains the thickness od thick +% lines in a Sudoku. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\newcommand\SudokuLinethickness{2pt} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Kakuro} +% +% \begin{macro}{\KakuroNumberFont} +% The macro |\KakuroNumberFont| is used to typeset the hints, i.e. +% the horizontal and vertical sums. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\newcommand\KakuroNumberFont{\sf\tiny} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@cell} +% The macro |\Kakuro@cell| is used to typeset the cells. It +% analyzes the argument and acts accordingly. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\Kakuro@cell#1{% + \ifx#1. \def\next{\Puzzle@pipe.}% + \else\ifx#1< \let\next\Kakuro@HINT + \else\ifx#1* \let\next\Kakuro@always + \else\ifx#1- \let\next\Kakuro@empty + \else\Puzzle@pipe#1 \let\next\relax + \fi\fi\fi\fi + \next +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@always} +% The macro |\Kakuro@always| is used to draw a cell with an inital number. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\Kakuro@always{\Puzzle@pipe[][fS]}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@empty} +% The macro |\Kakuro@empty| is used to drae an empty cell. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\Kakuro@empty{\Puzzle@pipe{}}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@hint} +% The macro |\Kakuro@hint| is used to draw hints. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\Kakuro@hint#1:#2>{% + \def\x{#2}% + \ifx\x\empty\else + \put(\Puzzle@X,\Puzzle@Y){\makebox(1,.8)[r]{\parbox{.95\unitlength}{\raggedright\KakuroNumberFont + $\blacktriangledown$\\#2}}} + \fi + \def\x{#1}% + \ifx\x\empty\else + \put(\Puzzle@X,\Puzzle@Y){\makebox(1,1.2){\parbox{.95\unitlength}{\raggedleft\KakuroNumberFont + #1 $\blacktriangleright$\\\mbox{}}}} + \fi + \Puzzle@pipe[][\KakuroHintType]{ }}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@nohint} +% The macro |\Kakuro@nohint| is used to suppress hints in solution mode. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\Kakuro@nohint#1:#2>{% + \Puzzle@pipe[][,]{ }}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Kakuro@HINT} +% The macro |\Kakuro@HINT| contains the definition to be used to +% typeset hints. This indirection is needed to suppress hints in +% solution mode. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\let\Kakuro@HINT\Kakuro@hint +% \end{macrocode} +% \end{macro} +% +% +% \begin{environment}{Kakuro} +% The environemnt |Kakuro| is used to typeset the puzzle. +% The implementation defines the begin and end macro separately to +% cope with catcode changes. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\begingroup +\catcode`\|=13 +\gdef\Kakuro#1#2{\begin{Puzzle}{#1}{#2}% + \catcode`\|=13 + \let\Puzzle@pipe=| + \let|=\Kakuro@cell +} +\endgroup +% \end{macrocode} +% +% The macro |\endKakuro| contains the code to be expanded at the +% end of the environment. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\endKakuro{\end{Puzzle}} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\KakuroHintType} +% The macro |\KakuroHintType| contains the cell type for +% typesetting hint cells. It can be used to achieve a different +% look and feel. +% \changes{1.8}{2009/09/13}{New} +% \begin{macrocode} +\def\KakuroHintType{,} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Initialization} +% +% Finally we arrange that the default behavior is to typeset an +% unsolved crossword puzzle. +% +% \begin{macrocode} +\PuzzleUnsolved +% \end{macrocode} +% +% Now, that everything is in place we can arrange some package +% options. +% \changes{1.6}{2006/08/12}{Several style options defined} +% \begin{macrocode} +\DeclareOption{numbered}{\Puzzle@SolutionNumberedtrue} +\DeclareOption{nocenter}{\let\PuzzlePre=\relax + \let\PuzzlePost=\relax} +\DeclareOption{unboxed}{\let\PuzzleCluePre=\relax + \let\PuzzleCluePost=\relax} +\DeclareOption{normalsize}{\PuzzleUnitlength=20pt + \def\PuzzleFont{\rm\normalsize}} +\DeclareOption{small}{\PuzzleUnitlength=16pt + \def\PuzzleFont{\rm\small}} +\DeclareOption{large}{\PuzzleUnitlength=24pt + \def\PuzzleFont{\rm\large}} +\DeclareOption{german}{% + \renewcommand\PuzzleWordsText[1]{Worte der L\"ange #1: }% + \renewcommand\PuzzleLettersText{Benutzte Buchstaben: }% +} +\DeclareOption{ngerman}{% + \renewcommand\PuzzleWordsText[1]{Worte der L\"ange #1: }% + \renewcommand\PuzzleLettersText{Benutzte Buchstaben: }% +} +\ProcessOptions\relax +% \end{macrocode} +% +% That's all. +% +% \PrintChanges +% \newpage +% \PrintIndex +% +% \Finale +% +\endinput +% +% Local Variables: +% mode: latex +% TeX-master: t +% End: diff --git a/macros/latex/contrib/gene/crossword/cwpuzzle.ins b/macros/latex/contrib/gene/crossword/cwpuzzle.ins new file mode 100644 index 0000000000..31d4c39b54 --- /dev/null +++ b/macros/latex/contrib/gene/crossword/cwpuzzle.ins @@ -0,0 +1,43 @@ +%%------------------------------------------------------------------ +%% Driver file to extract the dtx style and package file. +%% +%% Copyright (C) 1995-2014 Gerd Neugebauer +%% +%% Author: Gerd Neugebauer +%% Im Lerchelshl 5 +%% 64521 Gro-Gerau +%% Mail: gene@gerd-neugebauer.de +%% +%% cwpuzzle.ins is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY. No author or distributor accepts +%% responsibility to anyone for the consequences of using it or for +%% whether it serves any particular purpose or works at all, unless +%% he says so in writing. +%% +%% Everyone is granted permission to copy, modify and redistribute +%% cwpuzzle.ins, provided this copyright notice is preserved and +%% any modifications are indicated. +%% +%%------------------------------------------------------------------ +%% +%% Run this file through TeX or LaTeX to extract the files. +%% You need the docstrip package as distributed with LaTeX2e. +%% It is also availlable as seperate package from any CTAN site. +%% +%%------------------------------------------------------------------ +\def\batchfile{cwpuzzle.ins} +\input docstrip.tex +\keepsilent +\generateFile{cwpuzzle.sty}{t}{\from{cwpuzzle.dtx}{}} +\Msg{****************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by (La)TeX:} +\Msg{*} +\Msg{* \space\space cwpuzzle.sty} +\Msg{*} +\Msg{* To produce the documentation run cwpuzzle.dtx through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{****************************************************************} +\endinput diff --git a/macros/latex/contrib/gene/crossword/cwpuzzle.pdf b/macros/latex/contrib/gene/crossword/cwpuzzle.pdf Binary files differnew file mode 100644 index 0000000000..5c53aff07f --- /dev/null +++ b/macros/latex/contrib/gene/crossword/cwpuzzle.pdf diff --git a/macros/latex/contrib/gene/eqname/eqname.sty b/macros/latex/contrib/gene/eqname/eqname.sty new file mode 100644 index 0000000000..2f51958e7a --- /dev/null +++ b/macros/latex/contrib/gene/eqname/eqname.sty @@ -0,0 +1,37 @@ +%%% LaTeX document style option eqname.sty +%%% Gerd Neugebauer 4/92 +%%% gene (at) gerd-neugebauer (dot) de +%%% +%%% Copyright 1992, 1994, 2010 Gerd Neugebauer +%%% You may freely use, modify and/or distribute this file. +%%% +%%% This style option allows named equations as follows +%%% +%%% 1 + 1 = 2 (17) +%%% 1 + 2 = 3 (bingo) +%%% 1 + 3 = 4 (18) +%%% +%%% This can be produced by +%%% +%%% \begin{eqnarray} +%%% 1+1=2 \label{e1}\\ +%%% 1+2=3 \eqname{bingo}\label{e2}\\ +%%% 1+3=4 \label{e3} +%%% \end{eqnarray} +%%% +%%% Note: The \label has to go after the \eqname command. +%%% +%%% Bugs & Problems: +%%% This style option does not work with leqno.sty +%%% +%%%---------------------------------------------------------------------------- + +\newif\if@eqname +\def\@eqname{} +\def\@eqnnum{{\reset@font\rm + (\if@eqname\@eqname% + \addtocounter{equation}{-1}% + \global\let\@currentlabel=\theequation% + \global\@eqnamefalse% + \else\theequation\fi)}} +\def\eqname#1{\xdef\@eqname{#1}\global\@eqnametrue\gdef\@currentlabel{#1}} diff --git a/macros/latex/contrib/gene/limap/Makefile b/macros/latex/contrib/gene/limap/Makefile new file mode 100644 index 0000000000..f555b371fa --- /dev/null +++ b/macros/latex/contrib/gene/limap/Makefile @@ -0,0 +1,71 @@ +#****************************************************************************** +#* This file is part of limap. +#* +#* Copyright (C) 1999-2016 Gerd Neugebauer +#* +#* limap may be distributed under the terms of the LaTeX Project +#* Public License version 1.3c, as described in lppl.txt. +#* +#*============================================================================= + +LATEX = latex +LUALATEX = lualatex +MAKEINDEX = makeindex + +DISTFILES = README.md \ + limap.dtx \ + limap.ins \ + Makefile \ + lppl.txt \ + samples/boxed-toc.ltx \ + samples/hyper.ltx \ + samples/nolines.ltx \ + samples/sample.ltx \ + limap.pdf \ + samples/boxed-toc.pdf \ + samples/hyper.pdf \ + samples/nolines.pdf \ + samples/sample.pdf + +all: limap.cls limap.pdf + +cls sty limap.cls limap.sty: limap.dtx limap.ins + ${RM} limap.cls limap.sty + ${LATEX} limap.ins + +doc pdf limap.pdf: limap.sty limap.dtx + ${LUALATEX} limap.dtx + ${MAKEINDEX} -s gind.ist limap + ${MAKEINDEX} -s gglo.ist -o limap.gls limap.glo + ${LUALATEX} limap.dtx + +limap.dvi: limap.sty limap.dtx + ${LATEX} limap.dtx + ${MAKEINDEX} -s gind.ist limap + ${MAKEINDEX} -s gglo.ist -o limap.gls limap.glo + ${LATEX} limap.dtx + +#------------------------------------------------------------------------------ + +%.pdf: %.ltx limap.cls + @${LUALATEX} $< + @${LUALATEX} $< + @mv $(notdir ${<:.ltx=.pdf}) ${<:.ltx=.pdf} + @rm -f $(notdir ${<:.ltx=.aux}) $(notdir ${<:.ltx=.log}) $(notdir ${<:.ltx=.out}) + +#------------------------------------------------------------------------------ + +dist: distclean limap.zip + +zip limap.zip: $(DISTFILES) + (cd ..; zip limap/limap.zip $(addprefix limap/,$(DISTFILES))) + +#------------------------------------------------------------------------------ + +clean: + ${RM} *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *.out *~ *.dvi *.pdf samples/*.pdf + +distclean: clean + ${RM} limap.cls limap.sty limap*.zip + +#------------------------------------------------------------------------------ diff --git a/macros/latex/contrib/gene/limap/README.md b/macros/latex/contrib/gene/limap/README.md new file mode 100644 index 0000000000..2fb3530a7d --- /dev/null +++ b/macros/latex/contrib/gene/limap/README.md @@ -0,0 +1,82 @@ + +# _limap_: A package for typesetting Information Maps + +The Information Mapping® method provides a methodology for structuring +and presenting information. It claims to be useful for readers who are +more concerned about finding the right information than reading the +document as a whole. Thus short, highly structured, and context free +pieces of information are used. + +_limap_ provides a LaTeX style and a LaTeX class. The style contains +definitions to typeset maps and blocks according to the Information +Mapping® method. The class provides all definitions to typeset a whole +document. + + +## Samples + +A few sample files are provided which contain dummy documents typeset +with limap. They are contained in the sub-directory _samples_. You can +have a look at the documentation of _limap_ itself to see another +example. + + +## Installation + +Most probably _limap_ is already included in your TeX distribution. +Thus consult the documentation of your TeX distribution first to +install or update this package. + +You can install the package manually. Apply the following steps: + +- Run LaTeX on `limap.ins` + +``` + latex limap.ins +``` + +- Move the files `limap.cls` and `limap.sty` into a directory read by + LaTeX. + +- Run LaTeX and makeindex on `limap.dtx` to produce the documentation + +``` + latex limap.dtx + makeindex -s gind.ist limap + makeindex -s gglo.ist -o limap.gls limap.glo + latex limap.dtx +``` + + +## CTAN Download + +_limap_ can be obtained from the CTAN archives: + +* https://www.ctan.org/tex-archive/macros/latex/contrib/gene/limap + +or via the _limap_ home page + +* http://www.gerd-neugebauer.de/software/TeX/limap + +or via the source repository at Sourceforge for the most recent +development version + +* https://sourceforge.net/p/gene-tex-lib/svn/HEAD/tree/limap + + +## Licenses + +The sources and derived files of limap are distributed under the LaTeX +Project Public License version 1.3c. + +The samples in the directory _samples_ are in the Public Domian + (Creative Commons CC0 1.0 Universal)) + +The documentation is distributed under the Creative Commons +Attributation-Share Alike 4.0 License (CC BY-SA 4.0). + +---------------------------------------------------------------------- +Enjoy it! + +[Gerd Neugebauer](mailto:gene@gerd-neugebauer.de) + diff --git a/macros/latex/contrib/gene/limap/limap.dtx b/macros/latex/contrib/gene/limap/limap.dtx new file mode 100644 index 0000000000..1a3ea7bb9d --- /dev/null +++ b/macros/latex/contrib/gene/limap/limap.dtx @@ -0,0 +1,2380 @@ +%%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\iffalse +%% Purpose: +%% A package for typesetting Information Maps. +%% +%% Documentation: +%% The documentation can be generated from the original file +%% limap.dtx with the doc class/package. LaTeX the file limap.tex +%% to get the full documentation in pdf format. +%% +%% Author: Gerd Neugebauer +%% Im Lerchelsb\"ohl 5 +%% 64521 Gro\ss-Gerau (Germany) +%% Mail: gene@gerd-neugebauer.de +%% +%% Copyright (C) 1999-2017 Gerd Neugebauer +%% +%% limap.dtx may be distributed under the terms of the LaTeX Project +%% Public License version 1.3c, as described in lppl.txt. +%% +%% This class is still under development and may be replaced with a +%% new version which provides an enhanced functionality. +%% +%\fi +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \title{\texttt{limap}: A \LaTeX\ Package and Class for Typesetting Information Maps} +% \author{Gerd Neugebauer\\\normalsize +% Net: \texttt{\href{mailto:gene@gerd-neugebauer.de}{gene@gerd-neugebauer.de}}} +% \hypersetup{ +% pdftitle = {limap}, +% pdfsubject = {A LaTeX Package for Typesetting Information Maps}, +% pdfauthor = {Gerd Neugebauer}, +% } +% +% \date{This file documents \filename\ version \fileversion\ as of +% \filedate.\\ Documentation date: \docdate} +% +% \maketitle +% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \changes{1.0}{2000/03/01}{First public release.} +% \changes{2.0}{2016/04/16}{Fix in |MapTableofContents|: Trailing percent made unnecessary} +% \changes{2.0}{2016/04/16}{Extensions integrated into the package. +% Documentation improved.} +% \changes{2.0}{2016/04/14}{Renamed |MapTOCemph| to |MapTOCheadfont|.} +% \changes{2.0}{2016/04/15}{Renamed |MapTitleSize| to |MapTitleFont|.} +% \changes{2.0}{2016/04/16}{Renamed |MapTitlefraction| to |MapTitleFraction|.} +% \changes{2.0}{2016/04/16}{Environment |MapTabular| added} +% \changes{2.0}{2016/04/16}{Renamed |MapTextfraction| to |MapTextFraction|.} +% \changes{2.0}{2016/04/16}{Parameter |MapBlockLabelFont| introduced.} +% \changes{2.0}{2016/04/16}{Parameter |MapBlockLabelFont| introduced.} +% \changes{2.0}{2016/04/17}{Renamed |MapTitleContinuedSize| to |MapTitleContinuedFont|.} +% \changes{2.0}{2016/05/22}{TOC Re-engineered to allow +% interaction with hyperref.} +% \changes{2.0}{2016/05/22}{Option |nolines| added.} +% \changes{2.1}{2016/05/24}{|WideBlock| fixed and samples added.} +% \changes{2.1}{2016/05/26}{|MapTabularFraction| added.} +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \DoNotIndex{\ ,\",\',\.,\[,\\,\],\^,\`,\~,\@,\@author,\@auxout} +% \DoNotIndex{\@currentlabel,\@currenvir,\@date} +% \DoNotIndex{\@dottedtocline,\@gobble,\@gobbletwo,\@highpenalty} +% \DoNotIndex{\@ifnextchar,\@ifstar,\@ifundefined} +% \DoNotIndex{\@namedef,\@nameuse,\@pnumwidth,\@startsection,\@starttoc} +% \DoNotIndex{\@tempdima,\@title,\@thefnmark,\@undefined} +% \DoNotIndex{\@ixpt,\@vpt,\@vipt,\@viipt,\@viiipt} +% \DoNotIndex{\@xpt,\@xipt,\@xiipt,\@xivpt,\@xvii,\@xxpt,\@xxvpt} +% \DoNotIndex{\AA,\AE,\CodelineIndex,\CurrentOption} +% \DoNotIndex{\DescribeEnv,\DescribeMacro,\DeclareOption,\DeleteShortVerb,\DocInput} +% \DoNotIndex{\EnableCrossrefs,\H,\InputIfFileExists} +% \DoNotIndex{\L,\LARGE,\LaTeX,\Large} +% \DoNotIndex{\LoadClass,\NeedsTeXFormat,\O,\OE,\OptionNotUsed} +% \DoNotIndex{\PackageError,\PackageWarning,\PassOptionsToClass} +% \DoNotIndex{\ProcessOptions,\ProvidesClass,\PrintDescribeEnv,\PrintDescribeMacro} +% \DoNotIndex{\PrintChanges,\PrintIndex} +% \DoNotIndex{\ProvidesPackage,\R,\RecordChanges,\RequirePackage,\TeX} +% \DoNotIndex{\SpecialEnvIndex,\SpecialUsageIndex} +% \DoNotIndex{\aa,\addcontentsline,\addpenalty,\addtolength,\advance} +% \DoNotIndex{\addvspace,\ae,\ast,\arabic} +% \DoNotIndex{\b,\baselineskip,\begin,\begingroup,\bfseries,\bgroup} +% \DoNotIndex{\bigskip,\bottomrule,\box,\bullet} +% \DoNotIndex{\c,\cal,\catcode,\centering,\chapter,\chardef,\circ} +% \DoNotIndex{\cfoot,\clearpage,\closein,\closeout} +% \DoNotIndex{\clubpenalty,\color,\csname} +% \DoNotIndex{\d,\def,\dimen,\diamond,\divide,\documentclass,\dots,\dp} +% \DoNotIndex{\definecolor} +% \DoNotIndex{\edef,\egroup,\else,\em,\emph,\empty,\end,\endcsname} +% \DoNotIndex{\endgroup,\endinput,\endlist} +% \DoNotIndex{\expandafter,\fbox,\fi,\footnotesize,\footskip,\framebox} +% \DoNotIndex{\frenchspacing,\futurelet,\gdef,\global,\gobble} +% \DoNotIndex{\hangafter,\hangindent,\hbox,\headheight,\headsep,\hfil} +% \DoNotIndex{\hfill,\hrule,\hskip,\hspace,\hss,\ht,\huge,\hypersetup} +% \DoNotIndex{\ifcat,\ifeof} +% \DoNotIndex{\ifdim,\ifnum,\iftrue,\ifx,\ignorespaces,\immediate,\index} +% \DoNotIndex{\input,\it} +% \DoNotIndex{\itemindent,\itemsep,\jobname,\kern,\l,\labelsep,\labelwidth} +% \DoNotIndex{\large,\leavevmode,\leftmark,\leftskip,\let,\lhead,\list} +% \DoNotIndex{\llap,\long,\lower} +% \DoNotIndex{\makeatletter,\makeatother} +% \DoNotIndex{\m@th,\makebox,\magstep,\makeindex,\markboth,\mbox,\medskip} +% \DoNotIndex{\marginpar,\midrule,\multicolumn} +% \DoNotIndex{\newblock,\newcommand,\newcount,\newenvironment,\newfont} +% \DoNotIndex{\newif,\newlength,\newline,\newpage,\newread,\newwrite} +% \DoNotIndex{\nobreak,\noindent,\normalsize,\null} +% \DoNotIndex{\o,\oddsidemargin,\oe,\openin,\openout,\or} +% \DoNotIndex{\pagestyle,\par,\paragraph,\parbox} +% \DoNotIndex{\parfillskip,\parindent,\parsep,\parskip,\part,\partopsep} +% \DoNotIndex{\penalty,\providecommand,\quad} +% \DoNotIndex{\raggedbottom,\raggedright,\raise,\raisebox,\refstepcounter} +% \DoNotIndex{\relax,\renewcommand,\renewenvironment,\rhead} +% \DoNotIndex{\rightskip,\rm,\rule} +% \DoNotIndex{\sbox,\sc,\section,\setcounter,\setlength,\settowidth} +% \DoNotIndex{\sf,\sfcode,\sl} +% \DoNotIndex{\sloppy,\small,\space,\ss,\string} +% \DoNotIndex{\setsansfont,\setmonofont,\setmainfont} +% \DoNotIndex{\subparagraph,\subsubparagraph} +% \DoNotIndex{\subsection,\subsubsection,\symbol} +% \DoNotIndex{\t,\tenex,\textheight,\textit,\textsf,\textstyle,\textwidth} +% \DoNotIndex{\textrm,\the,\thepage,\thispagestyle,\textregistered} +% \DoNotIndex{\topmargin,\toprule,\topsep,\tt,\typeout} +% \DoNotIndex{\u,\unitlength,\usecounter,\usepackage,\usetikzlibrary} +% \DoNotIndex{\v,\varepsilon,\vbox} +% \DoNotIndex{\vfill,\vsize,\voffset,\vskip,\vspace,\vss} +% \DoNotIndex{\wd,\widowpenalty,\write,\xdef,\z@,\(,\)} +% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \CheckSum{813} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \begin{Abstract} +% The Information Mapping\R method provides a methodology for +% structuring and presenting information. It claims to be useful +% for readers who are more concerned about finding the right +% information than reading the document as a whole. Thus short, +% highly structured, and context free pieces of information are +% used. +% +% \texttt{limap} provides a \LaTeX{} package and a \LaTeX{} +% class. The package contains definitions to typeset maps and +% blocks according to the Information Mapping\R method. The class +% provides all definitions to typeset a whole document. +% \end{Abstract} +% +% \newpage +% \begin{Map}{} +% \vspace*{-6ex}% +% \Block{Copyright}% +% Copyright \textcopyright\ 1999–2016 +% \href{http://www.gerd-neugebauer.de}{Gerd Neugebauer} +% +% \Block{Licenses}% +% The source files of |limap| and the derived files +% \begin{itemize}\itemsep=0pt +% \item |limap.dtx| +% \item |limap.ins| +% \item |README.md| +% \item |Makefile| +% \item |limap.sty| +% \item |limap.cls| +% \item |limap.pdf| +% \end{itemize} +% may be distributed under the terms of the \LaTeX\ Project +% Public License version 1.3c, as described in the file +% |lppl.txt|. +% +% The documentation can be used under the +% \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative +% Commons Attributation-Share Alike 4.0 License} (CC BY-SA 4.0). +% +% The files in the |samples| directory are distributed unter +% \href{http://creativecommons/zero/1.0}{Creative Commons CC0 +% 1.0 Universal}. +% +% \Block{Net}% +% The sources of |limap| are hosted on Sourceforge as part of the +% project \texttt{gene-tex-lib}. The sources can be found under +% the URL +% \url{https://sourceforge.net/p/gene-tex-lib/svn/HEAD/tree/limap/}. +% +% A bundled distribution can be obtained via CTAN under the +% package URL +% \url{https://www.ctan.org/pkg/limap} or from the package's home +% page under \url{http://www.gerd-neugebauer.de/sowftware/TeX/limap}. +% +% \Block{Contact}% +% The author can be contacted under the following coordinates: +% +% \begin{minipage}{.6\linewidth}\parindent=2em +% Gerd Neugebauer \medskip\par +% Im Lerchelsb\"ohl 5 \par +% 64521 Gro\ss-Gerau \par +% Germany \medskip\par +% \href{mailto:gene@gerd-neugebauer.de}{gene@gerd-neugebauer.de} +% \end{minipage} +% \end{Map} +% \newpage +% \tableofcontents +% \newpage +% +% +% \begin{Map}{Motivation} +% +% \Block{Methodology}% +% The information mapping\R method provides a methodology to +% structure information in a special way. The aim is to help a +% reader who uses the document to search for relevant information +% instead of consuming it from start to end. The information +% mapping method also claims to raise the productivity of +% writers. +% +% \Block{No tutorial}% +% This document does not include an introduction to the +% information mapping method itself. The reader is referred to +% other documents. Maybe an accompanying document will be +% distributed along with this package. +% +% Unfortunately the methodology – or the name – is protected by +% a trademark. Thus the teaching of the methodology is restricted +% to licensed institutions. +% +% \Block{Principles}% +% \begin{center} +% \begin{tikzpicture}[mindmap,concept color=blue!16]\bfseries\scriptsize +% \node [concept,ball color=blue!8] {Information Mapping\R} +% child[grow=150,concept color=blue!20!black] {% +% node[concept,ball color=blue!20!black] {\color{white}Principles} +% child[grow=30,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Chunking}} +% child[grow=80,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Relevance}} +% child[grow=130,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Labelling}} +% child[grow=180,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Consistency}} +% child[grow=230,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Accessible details}} +% child[grow=280,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Integrated graphics}} +% }; +% \end{tikzpicture} +% \end{center} +% +% \Block{Information Type}% +% +% \begin{center} +% \begin{tikzpicture}[mindmap,concept color=blue!48]\bfseries\scriptsize +% \node [concept,ball color=blue!8] {Information Mapping\R} +% child[grow=-30,concept color=blue!20!black] {% +% node[concept,ball color=blue!20!black] {\color{white}Infor-mation Type} +% child[grow=100,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Procedure}} +% child[grow=50,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Process}} +% child[grow=0,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Principle}} +% child[grow=-50,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Concept}} +% child[grow=-110,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Structure}} +% child[grow=-160,concept color=blue!48] {% +% node[concept,ball color=blue!48] {Fact}} +% }; +% \end{tikzpicture} +% \end{center} +% +% \Block{Problems of restructuring}% +% You as \LaTeX\ user may have encountered the problem when +% restructuring a document: The sections know exactly the level +% they belong to. If you introduce a new section and put another +% section into it you have to change all sectioning commands to +% reflect the new level of the section and their subsections. +% +% The macros of |limap| abstract away the level of the document +% structuring. Any structuring unit is a “Block”. It may contain +% text or other blocks. Such blocks are the replacement or the +% sectioning commands. When you restructure your document you +% simply shift the block and anything it contains to the new +% place and you are done. +% +% The same mechanism can help you to include the same material in +% several documents – at different sectioning levels! +% +% \Block{Structure and constituents}% +% The general approach focuses very much on the structure of +% the document. The following diagram illustrates the terminology +% used within this documentation. +% +% \begin{center}\small +% \tikzstyle{class}=[rectangle, +% text centered, +% minimum width=6em, +% minimum height=3em, +% draw=black!60!red, +% drop shadow, +% top color=yellow!92!red!10!white, +% bottom color=yellow!92!red!40!white] +% \tikzstyle{arrow}=[draw=black!60!red, thick] +% \begin{tikzpicture} +% \path (3.75,6) node(doc) [class]{\bfseries Document} +% (3.75,4) node(map) [class]{\bfseries Map} +% (3.75,2) node(block) [class]{\bfseries Block} +% (0,0) node(text) [class]{\bfseries Text} +% (2.5,0) node(table) [class]{\bfseries Table} +% (5,0) node(image) [class]{\bfseries Image} +% (7.5,0) node(figure) [class]{\bfseries Diagram}; +% \draw[arrow,very thick,->] (doc) -- (map); +% \node[left] at ($(doc)!.6!(map)$) {\scriptsize 1..*}; +% \draw[arrow,very thick,->] (map) -- (block); +% \node[left] at ($(map)!.6!(block)$) {\scriptsize 1..9}; +% \draw[arrow,very thick,->] (map) -- +(1.5,0) -- +(1.5,1) -- +(.75,1) -- (map); +% \draw (4.75,4.75) node {\scriptsize 0..*}; +% \draw[arrow,very thick,->] (block) -- (text); +% \node[left] at ($(block)!.6!(text)$) {\scriptsize 0..*}; +% \draw[arrow,very thick,->] (block) -- (table); +% \node[left] at ($(block)!.6!(table)$) {\scriptsize 0..1}; +% \draw[arrow,very thick,->] (block) -- (image); +% \node[right] at ($(block)!.6!(image)$) {\scriptsize 0..1}; +% \draw[arrow,very thick,->] (block) -- (figure); +% \node[right] at ($(block)!.6!(figure)$) {\scriptsize 0..1}; +% \end{tikzpicture} +% \end{center} +% +% \Block{Class or package}% +% To support the information mapping\R method several \LaTeX{} +% macros and environments are provided which allow you to enter a +% logical description of the relevant concepts. Those macros are +% provided in the package and class file. It is up to you to +% choose one of them. +% +% \Block{Interoperabilty with other classes and packages}% +% The main part of the user interface is inherited from \LaTeX. +% The major differences are the sectioning commands which are +% made obsolete in parts by the information mapping\R method. +% Thus most packages can be used to typeset contents of a block. +% \end{Map} +% +% \begin{Map}{Getting Started} +% +% \Block{Introduction}% +% If you are starting to use |limap| you should be vaguely +% familiar with the underlying methodology. This documentation +% does not provide an introduction. +% +% When you start using this class or package you should say +% “Good bye” to the classical document structuring macros in +% the \LaTeX\ standard classes. +% +% \Block{Class or package}% +% First of all you should decide whether to use the |limap| class +% or the |limap| package. The class is meant for a complete document. +% The package allows to combine |limap| with arbitrary other +% document classes. +% +% \Block{Contents}% +% In the maps contained herein you will find an introduction on +% the use of the |limap| macros and environments. They are +% accompanied by illustrating sample code. +% \MapTableOfContents +% +% \begin{Map}{Using the Document Class} +% +% \Block{Using the document class}% +% This package provides both a class file as well as a package. +% The package contains the definitions of maps, blocks, and +% others. They can be used together with any base class. This +% is illustrated in the following preamble: +% \begin{verbatim} +% \documentclass{book} +% \usepackage{limap} +% \begin{document} \end{verbatim} +% +% \Block{Suppressing the block lines}% +% This class option |nolines| can be used to suppress the line +% above and below block. This is illustrated in the following +% preamble: +% \begin{verbatim} +% \documentclass[nolines]{limap} +% \begin{document} \end{verbatim} +% +% \Block{Other options}% +% Any option not processed by |limap.cls| is passed to the +% underlying document class used. Thus it is possible to +% customize the underlying class any further. +% +% \Block{Several types of options}% +% In the maps contained herein you will find the supported +% options for the document class |limap|. +% \MapTableOfContents +% +% \begin{Map}{Document Class Options for Language Selection} +% +% \Block{Introduction}% +% The document class |limap| inserts some words. Thus it has to +% know the language it is supposed to use. Thus the language +% has to be specified as one document class option. +% \begin{verbatim} +% \documentclass[german]{limap} +% \begin{document} \end{verbatim} +% +% \Block{Supported languages}% +% First, we describe the settings influencing the language +% specific settings. They do not make provisions to use the +% appropriate hyphenation patterns. They just arrange things +% such that the internally used texts are displayed in the +% chosen language. +% +% \begin{MapTabular}{@{\tt }lp{.75\linewidth}}\toprule +% \rm Option & Description\\\midrule +% austrian & Activate the language specific text +% fragments for the Austrian language (in fact +% German with one minor modification).\\ +% english & Activate the language specific text fragments +% for the English language.\\ +% french & Activate the language specific text fragments +% for the French language.\\ +% german & Activate the language specific text fragments +% for the German language.\\ +% USenglish & Activate the language specific text +% fragments for the American +% English.\\\bottomrule +% \end{MapTabular} +% +% \Block{Default language}% +% The default language is |english|. It is used if no language +% is set. +% +% \Block{Beware of hyphenation}% +% Note that the hyphenation patterns are not loaded +% automatically. You have to load the hyphenation patterns, +% for instance with the +% \href{https://www.ctan.org/pkg/babel}{babel} package. +% +% This behavior has been chosen to allow you to select the +% language package of your choice. Also you can pass in +% additional options to this package more easily. +% \end{Map} +% +% \begin{Map}{Document Class Options for Variant Selection} +% +% \Block{Introduction}% +% The document class |limap| is based on another document +% class. Thus you can use the well-known macros and +% environments defined there and take advantage of the +% extensions provided by |limap|. +% +% \begin{verbatim} +% \documentclass{limap} +% \begin{document} \end{verbatim} +% \Block{Variants}% +% The class has two additional options to determine the base +% class to be used. The first option is the variant. It can take +% the following values: +% +% \begin{MapTabular}{@{\tt }ll}\toprule +% \rm Option & Description\\\midrule +% base & Use the base set of classes. This is the default.\\ +% koma & Use the set of classes from +% \href{https://www.ctan.org/pkg/koma-script}{koma-script}.\\\bottomrule +% \end{MapTabular} +% +% \Block{Default variant}% +% If no document class option is used then |base| is the +% default variant. +% \end{Map} +% +% \begin{Map}{Document Class Options for Base Class Selection} +% +% \Block{Introduction}% +% The document class |limap| follows the logic introduced in +% the \LaTeX\ standard document classes. The type of the base +% document class can be given as argument to the |limap| class. +% +% \begin{verbatim} +% \documentclass[book]{limap} +% \begin{document} \end{verbatim} +% +% +% \Block{Class type}% +% The second option is the class type. It determines which kind of +% document to typeset. It can take the following values: +% +% \begin{MapTabular}{@{\tt }ll}\toprule +% \rm Option & Description\\\midrule +% book & Typeset a book type document.\\ +% report & Typeset a report type document.\\ +% article & Typeset an article type document.\\ +% letter & Typeset a letter type document.\\\bottomrule +% \end{MapTabular} +% +% \Block{Mapping of variant and type}% +% The following table shows which base classes are loaded according +% to the given values: +% +% \begin{MapTabular}{@{\tt }lcc}\toprule +% \rm Type /variant & \emph{base} & \emph{koma} \\\midrule +% book & book & scrbook \\ +% report & report & scrreprt \\ +% article & article & scrartcl \\ +% letter & letter & scrlettr \\\bottomrule +% \end{MapTabular} +% +% \Block{Default type}% +% The default type is |report|. It is used if no type is set. +% \end{Map} +% \end{Map} +% +% \begin{Map}{Using the Package} +% \Block{Introduction}% +% The package |limap| can be used together with most document +% classes. An exception are classes for slides like the +% \href{https://www.ctan.org/pkg/beamer}{beamer} class. +% +% As usual it is declared in the document preamble. +% +% \begin{verbatim} +% \documentclass{report} +% \usepackage{limap} +% \begin{document} \end{verbatim} +% \Block{Content}% +% The following additional information is available. +% \MapTableOfContents +% +% \begin{Map}{Package Options for Language Selection} +% +% \Block{Introduction}% +% The package |limap| inserts some words. Thus it has to +% know the language it is supposed to use. Thus the language +% has to be specified as package option. +% \begin{verbatim} +% \usepackage[german]{limap} +% \begin{document} \end{verbatim} +% +% \Block{Inheritance of document class options}% +% Alternatively the language selecting option can be specified +% as document class option. Thus several packages can share the +% same setting. +% \begin{verbatim} +% \documentclass[german]{scrbook} +% \documentclass{limap} +% \begin{document} \end{verbatim} +% +% \Block{Supported languages}% +% Here we describe the settings influencing the language +% specific settings. They do not make provisions to use the +% appropriate hyphenation patterns. They just arrange things +% such that the internally used texts are displayed in the +% chosen language. +% +% \begin{MapTabular}{@{\tt }lp{.75\linewidth}}\toprule +% \rm Option & Description\\\midrule +% austrian & Activate the language specific text +% fragments for the Austrian language (in fact +% German with one minor modification).\\ +% english & Activate the language specific text fragments +% for the English language.\\ +% french & Activate the language specific text fragments +% for the French language.\\ +% german & Activate the language specific text fragments +% for the German language.\\ +% USenglish & Activate the language specific text +% fragments for the American English.\\\bottomrule +% \end{MapTabular} +% +% \Block{Default language}% +% The default language is |english|. It is used if no language +% is set. +% +% \Block{Beware of hyphenation}% +% Note that the hyphenation patterns are not loaded +% automatically. You have to load the hyphenation patterns, +% for instance with the +% \href{https://www.ctan.org/pkg/babel}{babel} package. +% +% This behavior has been chosen to allow you to select the +% language package of your choice. Also you can pass in +% additional options to this package more easily. +% \end{Map} +% \end{Map} +% \end{Map} +% +% \begin{Map}{The Block}\label{map:block} +% +% \Block{Meaning}% +% A “block” is the essential building units of the |limap| +% package. You can think of it as paragraph with a title. +% +% \Block{Appearance}% +% The blocks are usually typeset with the block label on the left +% side and the contents to its right. They are surrounded by +% white-space and a thin line above and below. +% +% \DescribeMacro{\Block} +% The macro |\Block| can be used to typeset an block. It +% takes one argument which is the block label. +% +% This is a shorthand for denoting a block. The end mark can be +% omitted if you use the macro instead of the environment. +% Nevertheless this is depreciated. +% +% \Block{Example}% +% The following sample illustrates how to enter a block. +% \begin{verbatim} +% \Block{Block Label} +% And now comes the block text. It can consist of one or more +% classical paragraphs, or tables, or pictures, or something +% else. \end{verbatim} +% +% \Block{Just in a map}% +% Note that the macro |\Block| can be used inside a map only. If +% you try to use it outside the scope of a map you will get an +% error. +% +% \Block{More on blocks}% +% Several more aspects of blocks are covered in the following +% maps. +% \MapTableOfContents +% +% \begin{Map}{Configuring Blocks} +% +% \DescribeMacro{\MapBlockLabelFont} +% The macro |\MapBlockLabelFont| determines the font changing +% command to be used for typesetting the block label. The +% default is empty. +% +% \Block{Colored block labels}% +% The macro |\MapBlockLabelFont| can for instance be used to achieve +% colored block labels. For this purpose we can include the package +% |xcolor| in the preamble and select for instance a named color +% for the rule. +% This is illustrated in the following example. +% \begin{verbatim} +% \usepackage[svgnames]{xcolor} +% \renewcommand\MapBlockLabelFont{\color{Navy}} \end{verbatim} +% \DescribeMacro{\MapParskip} +% The macro |\MapParskip| determines the vertical distance of the +% text from the separating rules. The default is \MapParskip. +% \begin{verbatim} +% \renewcommand\MapParskip{.25ex} \end{verbatim} +% +% \DescribeMacro{\MapTitleFraction} +% The macro |\MapTitleFraction| determines the part of the page +% width devoted to the block label area. It is a fraction in the +% range from 0 to 1. The default value of |\MapTitleFraction| is +% 0\MapTitleFraction. +% \begin{verbatim} +% \renewcommand\MapTitleFraction{.25} \end{verbatim} +% +% \DescribeMacro{\MapTextFraction} +% This macro determines the part of the page width devoted to the +% text area. It is a fraction in the range from 0 to 1. The +% default value of |\MapTextFraction| is 0\MapTextFraction. +% +% |\MapTitleFraction| and |\MapTextFraction| should add up to +% something less or equal to 1. Otherwise you will get some +% “overfull hbox” messages. +% \begin{verbatim} +% \renewcommand\MapTextFraction{.8} \end{verbatim} +% \vspace*{-\MapParskip} +% \end{Map} +% +% \begin{Map}{Configuring the Rules of Blocks} +% +% \Block{Motivation}% +% Blocks are usually surrounded by horizontal rules. The +% appearance of these rules can be influenced by some macros. +% +% \DescribeMacro{\MapRuleWidth} The macro |\MapRuleWidth| +% determines the width of the rules drawn between blocks. It is +% defined as a macro containig a length. The default is +% \MapRuleWidth. +% +% \begin{verbatim} +% \setlength\MapRuleWidth{1mm} \end{verbatim} +% +% \Block{Suppress visible rules}% +% For some people the rules are distracting since they emphasize +% the structure too much. In such situations the rule width might +% be reduced. In the extreme case it can even be set to 0pt to +% suppress the lines at all as in the following example: +% +% \begin{verbatim} +% \renewcommand\MapRuleWidth{0pt} \end{verbatim} +% +% \DescribeMacro{\MapRuleStart} +% The macro |\MapRuleStart| is inserted before rules around +% blocks. It can be used to inject some code before the rule is +% typeset. Initially it is empty. +% +% \Block{Colored rules}% +% The macro |\MapRuleStart| can for instance be used to achieve +% colored rules. For this purpose we can include the package +% |xcolor| in the preamble and select a named color for the rule. +% This is illustrated in the following example. +% \begin{verbatim} +% \usepackage[svgnames]{xcolor} +% \renewcommand\MapRuleStart{\color{Silver}} \end{verbatim} +% \vspace*{-3ex} +% \end{Map} +% +% \begin{Map}{A Wide Block} +% +% \Block{Motivation}% +% Sometimes it is necessary to extend the content of a block to +% the whole width of the page. This can be the case for +% illustrations or large tables. +% +% \DescribeMacro{\WideBlock} +% The macro |\WideBlock| can be used to typeset a piece of +% information on the whole page width. It is normally used after an +% initiating block containing the title of the whole construction. +% +% The macro |\WideBlock| takes one argument which contains the +% material to span the whole page width. +% +% \Block{Example}% +% The following sample illustrates how to enter a wide block. +% \begin{verbatim} +% \Block{Block Label} +% And now comes the block text. +% \WideBlock{\includegraphics{images/overview.svg}} \end{verbatim} +% +% \Block{Block Label} +% And now comes the wide block produced with the help of +% Ti\textit{kZ} and its decoration with random steps. +% +% \vspace*{-\MapParskip} +% \WideBlock{\centering +% \begin{tikzpicture} +% \node [draw=black!50!white, +% ball color=yellow!85!red!12!white,draw,thick, +% minimum height=20mm, minimum width=147mm, +% decorate, decoration={random steps, +% segment length=5pt,amplitude=4pt}] +% {\it A very, very, very, very, very, very, very, very, very, very, very, very, very +% wide block content}; +% \end{tikzpicture}}\\ +% \vspace*{-\MapParskip} +% \end{Map} +% \end{Map} +% +% \begin{Map}{The Map}\label{map:map} +% +% \Block{Structuring documents}% +% The maps are the structuring units of the |limap| package. Maps +% may recursively contain maps and other material. The other +% material is usually named a block. This recursive structure is +% illustrated in the following figure. +% +% \newcount\picX +% \newcount\picY +% \newcount\picW +% \picX=0 +% \picY=0 +% \picW=20 +% \long\def\picMap(#1)#2{% +% \put(\the\picX,\the\picY){\framebox(\the\picW,#1)[tl]{Map}} +% \begingroup\advance\picW-2 +% \advance\picY1 \advance\picX1 +% #2 +% \endgroup +% \advance\picY#1 \advance\picY2 +% }% +% \def\picBlock{% +% \put(\the\picX,\the\picY){\makebox(\the\picW,3)[tl]{\tiny Block}} +% \put(\the\picX,\the\picY){\line(1,0){\the\picW}} +% \begingroup \advance\picX6 +% \advance\picY1 +% \advance\picW-6 +% \multiput(\the\picX,\the\picY)(0,.5){5}{\line(1,0){\the\picW}} +% \endgroup +% \advance\picY4 +% \put(\the\picX,\the\picY){\line(1,0){\the\picW}} +% }% +% \begin{center}\unitlength=1mm +% \begin{picture}(20,72)\sf\scriptsize +% \picMap(71){ +% \picMap(21){ +% \picMap(16){ +% \picBlock +% \picBlock +% \picBlock +% } +% } +% \picMap(16){ +% \picBlock +% \picBlock +% \picBlock +% } +% \picMap(16){ +% \picBlock +% \picBlock +% \picBlock +% } +% \picBlock +% \picBlock +% } +% \end{picture} +% \end{center} +% +% \DescribeEnv{Map} +% The environment |Map| can be used to typeset a map. It +% takes a single argument which contains the map title. The map +% title is typeset above the map and is repeated on each +% continuation page. +% +% \Block{Example}% +% +% \begin{verbatim} +% \begin{Map}{Map Title} +% \Block{Block Label} +% And now comes the block text. It can consist of +% one or more classical paragraphs, or tables, or +% pictures, or something else. +% \end{Map} \end{verbatim} +% +% \Block{To at most 12~cascaded Maps} +% There is a technical restriction in the current implementation +% of Maps. This restriction does not allow more than 12 cascaded +% Maps, i.e. Maps in Maps \ldots in Maps. +% +% According to the good old 7$\pm$2 rule a full populated +% document of this level would contain 282\,429\,536\,481 Maps. I +% think it should take some time until this limit is reached. +% +% \Block{More on maps}% +% Some more aspects are covered in the following pages. +% \MapTableOfContents +% +% \begin{Map}{Referencing Maps} +% +% \Block{Referencing maps}% +% Maps can be referenced in the usual \LaTeX\ way. For this +% purpose you place a macro invocation of |\label| right behind +% the beginning of the |Map|. +% +% Then you can add references somewhere in the document with +% |\ref| and |\pageref|. For backward references two \LaTeX\ runs +% are required. +% +% \Block{Example}% +% \begin{verbatim} +% \begin{Map}{Map Title}\label{my.label} +% \Block{Block Label} +% As said on page~\pageref{my.label}... \end{verbatim} +% \Block{Caveat emptor}% +% |limap| automatically labels any map with a label of the form +% \texttt{Map|@|}\textsl{n} where \textsl{n} is a +% sequence number. Thus avoid to use such labels yourself. +% \end{Map} +% +% \begin{Map}{Configuring Maps} +% +% \DescribeMacro{\MapFont} +% The macro |\MapFont| determines the font changing command to be +% used when starting a new map. +% \begin{verbatim} +% \renewcommand\MapFont{\tt} \end{verbatim} +% +% \DescribeMacro{\MapTitleFont} +% The macro |\MapTitleFont| determines the font changing command to +% be used when typesetting the title of a map. The default is |\Large|. +% \begin{verbatim} +% \renewcommand\MapTitleFont{\huge\bfseries} \end{verbatim} +% +% \DescribeMacro{\MapContinued} +% The macro |\MapContinued| contains the text appearing at the end +% of map which are continued on the next page. It is initiated +% when the class or package is loaded. It can overwritten +% afterwards – for instance in the preamble. +% \begin{verbatim} +% \renewcommand\MapContinued{} \end{verbatim} +% +% \DescribeMacro{\MapContinuing} +% The macro |\MapContinuing| contains the text appearing at the +% beginning of map which are continued from the previous page. It +% is typeset after the map title. It is initiated +% when the class or package is loaded. It can overwritten +% afterwards – for instance in the preamble. +% \begin{verbatim} +% \renewcommand\MapContinuing{} \end{verbatim} +% +% \DescribeMacro{\MapTitleContinuedFont} +% This macro determines the font changing command to be used for +% typesetting the additional text after titles on followup pages of +% multi-page maps. +% +% The default value is |\small|. +% \begin{verbatim} +% \renewcommand\MapTitleContinuedFont{\normalsize} \end{verbatim} +% +% \DescribeMacro{\MapNewpage} +% The macro |\MapNewpage| is expanded whenever a new page is +% required between maps. Thus it can be used to suppress the +% newpages by |\let|ing it to |\relax|. Note that this is not in +% the spirit of the Information Mapping\R method. +% +% \DescribeMacro{\MapTOC} +% The macro |\MapTOC| is expanded to generate the entry in the +% table of contents. It can be redefined to allow another +% behavior. +% \end{Map} +% \end{Map} +% +% \begin{Map}{The Table of Contents} +% +% \Block{Everything is local}% +% The concept of the underlying methodology is that everything +% should be addressed relative to the current location. We see +% this when dealing with maps (see page~\pageref{map:map}). The +% same principle is applied to the table of contents. +% +% \Block{Direct children are included}% +% The table of contents includes all maps contained in the map in +% which it appears. This means the immediate children of the map +% are shown. +% +% \Block{Block context required}% +% The table of contents is typeset inside a block (see +% page~\pageref{map:block}). +% +% \DescribeMacro{\MapTableOfContents} +% The macro |\MapTableOfContents| can be used to typeset the table +% of contents for a map. This table of contents includes all +% sub-maps of the map it is contained in – not recursively but +% only one level deeper. +% +% The macro |\MapTableOfContents| does not take any argument. +% +% \Block{Example}% +% \begin{verbatim} +% \Block{Contents} +% And some wise words about the table of contents. +% \MapTableOfContents \end{verbatim} +% +% \DescribeMacro{\MapTableOfContentsStyle} +% The macro |\MapTableOfContentsStyle| can be used to determine +% the style of the |\MapTableOfContents| The default style is an +% open layout utilizing the package +% \href{https://www.ctan.org/pkg/booktabs}{booktabs}. +% +% The macro |\MapTableOfContentsStyle| takes one argument. This +% argument may have one of the following values: +% +% \begin{MapTabular}{ll}\toprule +% Argument & Meaning \\\midrule +% open & an open style for the TOC\\\hline +% boxed & a boxed style for the TOC\\\bottomrule +% \end{MapTabular}% +% \vspace*{-5ex} +% \begin{Map}{Blocks in the Table of Contents} +% +% \Block{Motivation}% +% Sometimes it can be desirable to add the blocks to the global +% table of contents. Here we will see how this can be achieved. +% +% \DescribeMacro{\MapBlockStartHook} +% The macro |\MapBlockStartHook| is expanded at the beginning of +% each block it if is defined. It takes a single argument which +% is the title of the block. +% +% \DescribeMacro{\MapBlockTOC} +% The macro |\MapBlockTOC| is a macro which adds one line to the +% table of contents. It takes one argument which is the text to +% be added. +% +% \Block{Example}% +% Put the following code in the preamble to get the blocks into +% the table of contents. +% \begin{verbatim} +% \let\MapBlockStartHook\MapBlockTOC \end{verbatim} +% +% %\vspace*{-5ex} +% \end{Map} +% \end{Map} +% \begin{Map}{Tables} +% +% \Block{Introduction}% +% Tables play an important role as part of maps. Usually they are +% included into a block and preceded by some useful introduction. +% +% \Block{Combination with booktabs}% +% The document class |limap| and the package |limap| +% automatically include the package +% \href{https://www.ctan.org/pkg/booktabs}{booktabs}. This +% package contains some support for typesetting proper tables. +% You should have a look at the documentation of |booktabs| and +% follow the recommendations given there. +% +% |booktabs| is automatically loaded by |limap| upon start-up. +% +% \DescribeEnv{MapTabular} +% The environment |MapTabular| provides a convenient way to +% include a table into a block. It produces a |tabular*| +% environment and sets the width to the width of the text column +% of the block. +% +% \Block{Example}% +% \begin{verbatim} +% \Block{Table block} +% Sheding some insight on the following table. +% +% \begin{MapTabular}{lll}\toprule +% a & b & \\\midrule +% x & y & Z\\\hline +% X & Y & Z\\\bottomrule +% \end{MapTabular} \end{verbatim} +% \DescribeMacro{\MapTabularFraction} +% The tabular is always centered in the text column of the block. The +% macro |\MapTabularFraction| contains a factor for the line +% width occupied by the tabular. This value is used to determine +% the width of the tabular. The default value for the macro +% |\MapTabularFraction| is 0\MapTabularFraction. +% \begin{verbatim} +% \renewcommand\MapTabularFraction{.7} \end{verbatim} +% \vspace*{-4ex} +% \end{Map} +% +% \begin{Map}{Configuration} +% +% \Block{Introduction}% +% |limap| is designed with a set of extension points. Those are +% mainly definition which can be overwritten to achieve a certain +% effect. +% +% \Block{Configuration in the preamble}% +% Any configuration change performed in the preamble of a +% document is global. It lasts until oberwritten within the +% document. +% +% \Block{Configuration in the document}% +% The configuration parameters can be overwritten in the document +% just before they are needed. This is not recommended since it +% makes it harder to achieve consistency. +% +% \Block{External configuration}% +% The confiration can be externalised. For this purpose a special +% file |limap.cfg| is loaded with the class or package in case it +% exists. This file can contain configuration options for +% |limap|. Thus it is possible to share the same appearance +% among different documents. +% +% \Block{Contents}% +% The following maps contain the various aspects of the +% configuration of |limap|. +% \MapTableOfContents +% +% \begin{Map}{The Configuration File limap.cfg} +% +% \Block{Default configuration file}% +% When the class or package is loaded as a last action a +% configuration file is loaded if it can be found. The name of +% the configuration file is \texttt{limap.cfg}. This file can +% contain re-definitions of the several macros to adjust the +% behavior of |limap| on a per directory, per user or per +% installation base. +% +% \Block{Note}% +% Some settings are activated before the configuration file is +% loaded. Thus some settings may not have any effect at all. +% \end{Map} +% +% \begin{Map}{Changing or Adding Language Specific Settings} +% +% \Block{Overview}% +% Several strings are used automatically by the current class or +% package. Default values for several languages are hardwired in +% the implementation. Nevertheless it is possible to change those +% language specific settings. +% +% If you create settings for a new language it is highly +% recommended to contact the author to integrate them into the +% default distribution. +% +% The following macros can be redefined in the preamble after the +% package or class has been loaded to reset the language specific +% text. +% +% \DescribeMacro{\MapTOCname} +% The macro |\MapTOCname| contains the text of the heading in table +% of contents of maps for the column of map titles. It is initiated +% when the class or package is loaded. It can overwritten +% afterwards – for instance in the preamble. +% \begin{verbatim} +% \renewcommand\MapTOCname{Issue} \end{verbatim} +% +% \DescribeMacro{\MapTOCpage} +% The macro |\MapTOCpage| contains the text of the heading in table +% of contents of maps for the column of page numbers. It is initiated +% when the class or package is loaded. It can overwritten +% afterwards – for instance in the preamble. +% \begin{verbatim} +% \renewcommand\MapTOCname{Reference} \end{verbatim} +% +% \Block{Providing a new language}% +% If you want to provide a new language \textit{lang} you can +% define the macro |\LIMAP@SelectLanguage@|\textit{lang} which +% redefines the macros given above. This definition has to be +% present before the package is loaded. +% +% Note that the macro name contains the @ character. Thus the +% definition should be made in a package of its own. +% \end{Map} +% \end{Map} +% +% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \StopEventually{} +% \newpage +% \if@undefined\environment +% \newenvironment{environment}[1]{}{} +% \fi +% +% \begin{Map}{The Implementation} +% \Block{Overview}% +% This part of the document describes the implementation. Usually +% it is not meant for the casual user. Nevertheless it might be +% fruitful for those searching for inspiration or for tricks when +% using this class or package. +% +% \Block{Contents}% +% \MapTableOfContents +% +% \begin{Map}{The Version Information} +% +% \Block{Purpose}% +% The version information is included for printing it on the +% documentation and at start-up when the class or package is +% loaded. It has to preceed the documentation driver to properly +% include this information into the printed manual. +% +% \Block{}% +% \begin{macro}{\filename} +% |\filename| is the name of the dtx file containing this class +% and package. +% \begin{macrocode} +\def\filename{limap.dtx} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\fileversion} +% |\fileversion| is the version number of the |dtx| file. It is +% used as a version number for the class and package. +% \begin{macrocode} +\def\fileversion{2.2} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\filedate} +% |\filedate| is the change date of the |dtx| file. It is used +% as a version date and documentation date. +% \begin{macrocode} +\def\filedate{2016/05/29} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\docversion} +% |\docversion| is the version number of the documentation. It +% is identical to the version number of the |dtx| file. +% \begin{macrocode} +\let\docversion=\fileversion +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\docdate} +% |\docdate| is the change date of the documentation. It is +% identical to the change date of the |dtx| file. +% \begin{macrocode} +\let\docdate=\filedate +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{The Documentation Driver} +% \Block{Purpose}% +% The documentation driver is necessary to provide a self +% documenting |dtx| file. With this construction the dtx file can +% be run through \LaTeX\ to produce the documentation. +% +% The driver section contains a complete \LaTeX\ document which +% loads the |dtx| file. The special class |ltxdoc| is used and +% some arrangements are made for this purpose. +% +% \Block{Driver code}% +% The driver code is not exported by the installer. +% +% \begin{macrocode} +%<*driver> +\documentclass[a4paper]{ltxdoc} +\RequirePackage{textcomp} +\usepackage{limap} +\let\LimapFilename\filename +\let\LimapFileversion\fileversion +\let\LimapFiledate\filedate +\let\LimapDocdate\docdate +% \end{macrocode} +% \Block{Page Layout}% +% \begin{macrocode} +\oddsidemargin=10pt +\evensidemargin=10pt +\textwidth=430pt +\textheight=650pt +\voffset=-12mm +% \end{macrocode} +% \Block{Headings}% +% \begin{macrocode} +\usepackage{fancyhdr} +\addtolength{\headheight}{2ex}% +\pagestyle{fancy}% +\cfoot{} +\rhead{\small\sf\thepage} +\lhead{\textit{\footnotesize limap} – Package and Class} +% \end{macrocode} +% \Block{Links and such}% +% \begin{macrocode} +\usepackage{hyperref} +% \end{macrocode} +% \Block{Fonts}% +% \begin{macrocode} +\usepackage{fontspec} +\setmainfont{TeX Gyre Heros} +\setsansfont{TeX Gyre Heros}%[Scale=MatchLowercase] +\setmonofont{Inconsolata}%[Scale=MatchLowercase] +% \end{macrocode} +% \Block{Coloring}% +% \begin{macrocode} +\usepackage[svgnames]{xcolor} +\renewcommand\MapTitleFont{\Large\bfseries\color{Navy}} +\renewcommand\MapBlockLabelFont{\bfseries\color{Navy}} +\definecolor{linkColor}{rgb}{.66,.2,.2} +\hypersetup{colorlinks, + citecolor=linkColor, + filecolor=linkColor, + linkcolor=linkColor, + urlcolor=linkColor} +\renewcommand\MapRuleStart{\color{Navy}} +\renewcommand\MapRuleWidth{1pt} +% \end{macrocode} +% \Block{Graphics}% +% \begin{macrocode} +\usepackage{tikz} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{shadows} +\usetikzlibrary{mindmap} +\usetikzlibrary{calc} +% \end{macrocode} +% \Block{Saving version}% +% \begin{macrocode} +\let\filename\LimapFilename +\let\fileversion\LimapFileversion +\let\filedate\LimapFiledate +\let\docdate\LimapDocdate +% \end{macrocode} +% \Block{Adapting doc.sty}% +% \begin{macrocode} +\def\theCodelineNo{\color{DarkGreen}\rmfamily\scriptsize\arabic{CodelineNo}}% +\makeatletter +\renewcommand\DescribeMacro{\catcode`\\=12\Describe@@Macro} +\def\Describe@@Macro#1{\Block{\PrintDescribeMacro{#1}}% + \SpecialUsageIndex{#1}\@esphack\ignorespaces} +\renewcommand\DescribeEnv{\catcode`\\=12\Describe@@Env} +\def\Describe@@Env#1{\Block{\PrintDescribeEnv{#1}}% + \SpecialEnvIndex{#1}\@esphack\ignorespaces} +\makeatother +\let\maketitle\MakeTitle +% \end{macrocode} +% \Block{Some additions}% +% \begin{macrocode} +\newcommand\R{\(^{\textrm{\footnotesize\textregistered}}\) } +\let\marginpar\Block +\InputIfFileExists{limap.dcf}{}{} +\RecordChanges +\EnableCrossrefs +\CodelineIndex +% \end{macrocode} +% \Block{The content}% +% Now everything is prepared. Let the show begin\ldots +% \begin{macrocode} +\begin{document} +\DeleteShortVerb{|} +\DocInput{\filename} +%\newpage +%\PrintChanges +\newpage +\setcounter{IndexColumns}{2} +\PrintIndex +\end{document} +%</driver> +% \end{macrocode} +% \end{Map} +% +% +% \begin{Map}{The \TeX\ Code} +% +% \Block{Overview}% +% The rest of the document describes the implementation. Usually +% it is not meant for the casual user. Nevertheless it might be +% fruitful for those searching for inspiration or for tricks when +% using this class or package. +% +% \Block{Contents}% +% \MapTableOfContents +% +% \begin{Map}{The Package and Class Declarations} +% +% \Block{Preliminaries}% +% First of all we request a descent version of \LaTeX\ to be +% used. I don't think it does have to be too new. +% +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +% \end{macrocode} +% +% \Block{Package identification}% +% When the package is generated, the package identification is +% included. +% \begin{macrocode} +%<*package> +\ProvidesPackage{limap}[\filedate\space Gerd Neugebauer] +%</package> +% \end{macrocode} +% +% \Block{Class identification}% +% When the class is generated, the class identification is +% included. +% \begin{macrocode} +%<*class> +\ProvidesClass{limap}[\filedate\space Gerd Neugebauer] +%</class> +% \end{macrocode} +% \end{Map} +% +% \begin{Map}{Language Specific Macros} +% +% \Block{Introduction}% +% This section contains internal macros used to implement the +% functionality. New languages can be easily be added. For this +% purpose only a new macro has to be defined and a package/class +% option for the convenience of the user. +% +% Consider you want to add a new language “latin” then you have +% to provide the command |\LIMAP@SelectLanguage@latin|. This +% macro should simply redefine the macros containing strings of +% the language specific texts. Examples for other languages are +% provided in this section. +% +% To enable the language settings for “latin” the macro +% |\LIMAP@Language| has to be defined to contain the value +% “latin”. Usually this is accomplished by providing a +% convenient option to the package or class. +% +% \Block{}% +% \begin{macro}{\defineLimapLanguage} +% Provide the definitions for a language. The different texts +% to be used are stored in a macro which defines the target +% macros when expanded. +% \begin{macrocode} +\def\defineLimapLanguage#1#2#3#4#5{% + \expandafter\def\csname LIMAP@SelectLanguage@#1\endcsname{% + \def\MapContinued{#2}% + \def\MapContinuing{#3}% + \def\MapTOCname{#4}% + \def\MapTOCpage{#5}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \Block{Definitions for the language “austrian“}% +% \begin{macrocode} +\defineLimapLanguage{austrian}% + { Fortsetzung}{Fortsetzung\dots}% + {Titel}{Seite} +% \end{macrocode} +% +% \Block{Definitions for the language “german“}% +% \begin{macrocode} +\defineLimapLanguage{german}% + { Fortsetzung}{Fortsetzung\dots}% + {Titel}{Seite} +% \end{macrocode} +% +% \Block{Definitions for the language “english“}% +% \begin{macrocode} +\defineLimapLanguage{english}% + { Continued}{Continuing\dots}% + {Title}{Page} +% \end{macrocode} +% +% \Block{Definitions for the language “USenglish“}% +% \begin{macrocode} +\defineLimapLanguage{USenglish}% + { Continued}{Continuing\dots}% + {Title}{Page} +% \end{macrocode} +% +% \Block{Definitions for the language “french“}% +% \begin{macrocode} +\defineLimapLanguage{french}% + { continuation}{continuation\dots}% + {Intitulé}{Page} +% \end{macrocode} +% +% \Block{}% +% \begin{macro}{\LIMAP@Language} +% The macro |\LIMAP@Language| determines the language to be +% used for several small text fragments to be inserted at +% certain places. It is redefined by package/class options and +% evaluated at the end to activate the selected settings. +% \begin{macrocode} +\providecommand\LIMAP@Language{english} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macrocode} +\DeclareOption{austrian}{\renewcommand\LIMAP@Language{austrian}} +\DeclareOption{german}{\renewcommand\LIMAP@Language{german}} +\DeclareOption{french}{\renewcommand\LIMAP@Language{french}} +\DeclareOption{english}{\renewcommand\LIMAP@Language{english}} +\DeclareOption{USenglish}{\renewcommand\LIMAP@Language{USenglish}} +% \end{macrocode} +% +% \Block{}% +% \begin{macro}{\ifLIMAP@strict} +% The boolean |\ifLIMAP@strict| determines if the lower +% sectioning macros should be disabled in the class. +% \begin{macrocode} +\newif\ifLIMAP@strict \LIMAP@stricttrue +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macrocode} +\DeclareOption{nonstrict}{\LIMAP@strictfalse} +% \end{macrocode} +% +% \Block{}% +% \begin{macrocode} +\DeclareOption{nolines}{\def\MapRuleWidth{0pt}\ignorespaces} +% \end{macrocode} +% +% \begin{Map}{Determining the Appropriate Base Class} +% +% \Block{}% +% \begin{macrocode} +%<*class> +% \end{macrocode} +% +% \begin{macro}{\LIMAP@ClassType} +% The macro |\LIMAP@ClassType| determines the type of the class +% to be used. Usually it can take the values |book|, |report|, +% |article|, and |letter| (for completeness). This macro is +% redefined when the options of the class are evaluated. +% Finally this macro helps to select the appropriate base +% class. +% \begin{macrocode} +\providecommand\LIMAP@ClassType{report} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macrocode} +\DeclareOption{book}{\renewcommand\LIMAP@ClassType{book}} +\DeclareOption{report}{\renewcommand\LIMAP@ClassType{report}} +\DeclareOption{article}{\renewcommand\LIMAP@ClassType{article}} +\DeclareOption{letter}{\renewcommand\LIMAP@ClassType{letter}} +% \end{macrocode} +% +% \Block{}% +% \begin{macro}{\LIMAP@Variant} +% The macro |\LIMAP@Variant| determines the variant of the +% class to be used. Usually it can take the values |base| and +% |koma|. This macro is redefined when the options of the class +% are evaluated. Finally this macro helps to select the +% appropriate base class. +% \begin{macrocode} +\providecommand\LIMAP@Variant{base} +% \end{macrocode} +% \end{macro} +% +% \Block{Options for selecting the variant}% +% \begin{macrocode} +\DeclareOption{koma}{\renewcommand\LIMAP@Variant{koma}} +\DeclareOption{base}{\renewcommand\LIMAP@Variant{base}} +% \end{macrocode} +% +% \Block{Mapping to document class}% +% Define a mapping between the variant and class type to the class +% name to be used. +% \begin{macrocode} +\newcommand\LIMAP@Class@base@article{article} +\newcommand\LIMAP@Class@base@report{report} +\newcommand\LIMAP@Class@base@book{book} +\newcommand\LIMAP@Class@base@letter{letter} +\newcommand\LIMAP@Class@koma@article{scrartcl} +\newcommand\LIMAP@Class@koma@report{scrreprt} +\newcommand\LIMAP@Class@koma@book{scrbook} +\newcommand\LIMAP@Class@koma@letter{scrlettr} +%</class> +% \end{macrocode} +% +% \Block{Pass on the unknown options}% +% \begin{macrocode} +%<*class> +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{% + \csname LIMAP@Class@\LIMAP@Variant @\LIMAP@ClassType\endcsname}% + } +%</class> +% \end{macrocode} +% +% Thus the class specific options are completed. +% +% Now we can process all options. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% \Block{}% +% \begin{macrocode} +%<*class> +% \end{macrocode} +% The requested class is loaded and the options remaining are +% processed. +% \begin{macrocode} +\LoadClass{\csname + LIMAP@Class@\LIMAP@Variant @\LIMAP@ClassType\endcsname} +%</class> +% \end{macrocode} +% \end{Map} +% +% \begin{Map}{Loading Required Packages} +% +% \Block{longtable for breakable tables}% +% The package +% \href{https://www.ctan.org/pkg/longtable}{longtable} is used +% internally to implement a part of the required functionality. +% Thus we need to ensure that it is loaded. +% \begin{macrocode} +\RequirePackage{longtable} +% \end{macrocode} +% \Block{etoolbox}% +% \begin{macrocode} +\RequirePackage{etoolbox} +% \end{macrocode} +% +% \Block{booktabs for nice tables}% +% The package \href{https://www.ctan.org/pkg/booktabs}{booktabs} +% is used internally to implement a part of the required +% functionality. Thus we need to ensure that it is loaded. +% \begin{macrocode} +\RequirePackage{booktabs} +% \end{macrocode} +% +% \Block{fancyhdr for head and foot lines}% +% +% \begin{macrocode} +%<*class> +\RequirePackage{fancyhdr} +\addtolength{\headheight}{2ex}% +\pagestyle{fancy}% +\cfoot{} +\rhead{\small\thepage} +\lhead{\textit{\footnotesize\@title}} +\def\@title{} +%</class> +% \end{macrocode} +% +% \Block{No vertical adjustment of pages}% +% Since the blocks are not supposed to line up at the end of the +% page we declare |\raggedbottom|. +% \begin{macrocode} +\raggedbottom +% \end{macrocode} +% \end{Map} +% \end{Map} +% +% \begin{Map}{Layout Parameters} +% +% \Block{Overview}% +% The layout can be influenced by a large number of parameters. +% Thus the design decisions have been made transparent (to a +% certain degree at least). These options are not meant to be +% changed except when a new layout is being designed and +% implemented. +% +% \Block{}% +% \begin{macro}{\MapRuleWidth} +% The macro |\MapRuleWidth| determines the width of the rules +% drawn between blocks. +% \begin{macrocode} +\providecommand\MapRuleWidth{.25pt} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapRuleStart} +% The macro |\MapRuleStart| is inserted before the rules +% drawn between blocks. +% \begin{macrocode} +\newcommand\MapRuleStart{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapContinued} +% This macro determines the text to be used in the title of +% continued maps. This macro is reset when the language +% specific initializations are performed. +% \begin{macrocode} +\newcommand\MapContinued{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapContinuing} +% The macro |\MapContinuing| determines the text to be used at +% the bottom of the map which is continued. This macro is reset +% when the language specific initializations are performed. +% \begin{macrocode} +\newcommand\MapContinuing{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapContinuingFormat} +% This macro determines the format of the bottom line on +% continued maps. I.e. it includes the text as well as font +% changing commands. The text is passed to this command as +% argument 1. +% \begin{macrocode} +\newcommand\MapContinuingFormat[1]{\textit{\footnotesize #1}} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapContinuedFormat} +% This macro determines the format of the bottom line on +% continued maps. I.e. it includes the text passed to it as +% argument 1 as well as font changing commands. +% \begin{macrocode} +\newcommand\MapContinuedFormat[1]{, {\MapTitleContinuedFont #1}} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapFont} +% The macro |\MapFont| determines the font changing command to +% be used when starting a new map. +% \begin{macrocode} +\let\MapFont\textsf +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTitleFont} +% The macro |\MapTitleFont| determines the size changing +% command to be used when typesetting the title of a map. +% \begin{macrocode} +\let\MapTitleFont\Large +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTitleContinuedFont} +% This macro determines the font changing command to be used +% for typesetting the additional text after titles on followup +% pages of multipage maps. +% \begin{macrocode} +\let\MapTitleContinuedFont\small +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapBlockLabelFont} +% This macro determines the font changing command to be used +% for typesetting the block label. +% \begin{macrocode} +\def\MapBlockLabelFont{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapParskip} +% The macro |\MapParskip| determines the distance of the text +% from the separating rules. +% \begin{macrocode} +\newcommand\MapParskip{2ex} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTitleFraction} +% The macro |\MapTitleFraction| determines the part of the page +% width devoted to the title area. It is a fraction in the +% range from 0 to 1. +% \begin{macrocode} +\newcommand\MapTitleFraction{.2} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTextFraction} +% This macro determines the part of the page width devoted to +% the text area. It is a fraction in the range from 0 to 1. +% |\MapTitleFraction| and |\MapTextFraction| should add up to +% something less or equal to 1. Otherwise you will get some +% “overfull hbox” messages. +% \begin{macrocode} +\newcommand\MapTextFraction{.75} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Adaptable Macros} +% +% \Block{Overview}% +% +% \begin{macro}{\MapNewpage} +% The macro |\MapNewpage| is expanded whenever a new page is +% required between maps. Thus it can be used to suppress the +% newpages by |\let|ing it to |\relax|. +% \begin{macrocode} +\let\MapNewpage\newpage +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTOC} +% The macro |\MapTOC| is expanded to generate the entry in the +% table of contents. It can be redefined to allow another +% behavior. +% \begin{macrocode} +\newcommand\MapTOC[1]{% + \refstepcounter{\@nameuse{Map@TOC@name\the\Map@level}}% + \addcontentsline{toc}{\@nameuse{Map@TOC@name\the\Map@level}}{#1}% +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapBlockTOC} +% The macro |\MapBlockTOC| can be used to add an entry for a +% block to the table of contents. +% \changes{2.2}{2017/07/20}{new} +% \begin{macrocode} +\newcommand\MapBlockTOC[1]{% + \begingroup\count0=\Map@level \advance\count0 1% + \addcontentsline{toc}{\@nameuse{Map@TOC@name\the\count0}}{#1}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTOCname} +% The macro |\MapTOCname| contains the heading for the section +% title in contents blocks. This macro is reset when the +% language specific initializations are performed. +% \begin{macrocode} +\newcommand\MapTOCname{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTOCpage} +% The macro |\MapTOCpage| contains the heading for the page +% number in contents blocks. This macro is reset when the +% language specific initializations are performed. +% \begin{macrocode} +\newcommand\MapTOCpage{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTOCheadfont} +% The macro |\MapTOCheadfont| contains the font switching +% command for typesetting the head line of map table of +% contents. +% \begin{macrocode} +\newcommand\MapTOCheadfont{\scriptsize\emph} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Internal Macros, Lengths, and Counters} +% +% \Block{}% +% This section contains internal macros used to implement the +% functionality. +% +% \Block{}% +% \begin{macro}{\Map@length} +% The length register |\Map@length| is allocated to store the +% width of the space between the columns of a block. +% \begin{macrocode} +\newlength{\Map@length} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@level} +% The macro |\Map@level| determines the level of inclusion of +% maps. It is used to determine the appearance in the table of +% contents. +% \begin{macrocode} +\newcount\Map@level +\Map@level=0 +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@blockcount} +% The macro |\Map@blockcount| is used to count the blocks per +% map to issue a package warning if required. +% \begin{macrocode} +\newcount\Map@blockcount +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\LT@final@warn} +% The macro |\LT@final@warn| is defined in |longtable|. It is +% redefined to show |limap| are originator. +% \begin{macrocode} +\def\LT@final@warn{% + \AtEndDocument{% + \PackageWarning{limap}% + {Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}% + \global\let\LT@final@warn\relax} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Typesetting a Map} +% +% \Block{}% +% \begin{environment}{Map} +% The environment |Map|determines the appearance of a map. It is +% implemented as a |longtable| environment which takes care for +% the page breaks and inserts material at the end of the page +% and the beginning of the new page upon page break. +% \end{environment} +% \begin{macrocode} +\def\Map#1{% +% \end{macrocode} +% First the messages of |longtable| are modified to show this +% package name instead. +% \begin{macrocode} + \def\LT@err{\PackageError{limap}}% + \def\LT@warn{\PackageWarning{limap}}% +% \end{macrocode} +% \Block{}% +% The map local macro |\Block| is +% activated. The counter for blocks is reset. +% \begin{macrocode} + \let\Block\Map@Block + \let\endBlock\Map@endBlock + \Map@blockcount=0 +% \end{macrocode} +% \Block{}% +% The number of the map in the internal counting is set by +% incrementing the old value. +% \begin{macrocode} + \global\advance\Map@no1 +% \end{macrocode} +% \Block{}% +% +% \begin{macrocode} + \ifx\Map@UP\empty\else + \immediate\write\@auxout + {\string\expandafter\string\xdef\string\csname\space + Map@parts@\Map@UP\string\endcsname{\string\csname\space + Map@parts@\Map@UP\string\endcsname\the\Map@no:}}% + \fi +% \end{macrocode} +% \Block{}% +% +% \begin{macrocode} + \edef\Map@UP{\the\Map@no}% + \ifnum\Map@level>0 + \xdef\Map@@up{\Map@UP}% Just to save the value across blocks. + \endgroup + \Map@end + \begingroup + \edef\Map@UP{\Map@@up}% + \def\@currenvir{Map}% + \fi + \edef\Map@this{\the\Map@no}% +% \end{macrocode} +% \Block{}% +% The entries for future use of sub-maps are written to the |aux| file. +% \begin{macrocode} + \immediate\write\@auxout + {\string\global\string\@namedef{Map@parts@\the\Map@no}{}}% +% \end{macrocode} +% \Block{}% +% +% \begin{macrocode} + \global\advance\Map@level1 + \def\Map@TITLE{#1}% + \Map@start + } +% \end{macrocode} +% \Block{}% +% +% \begin{macrocode} +\def\endMap{% + \Map@end + \global\advance\Map@level-1 + \ignorespaces +} +% \end{macrocode} +% +% \Block{}% +% \begin{macro}{\ifMap@open@} +% The conditional |\ifMap@open@| is used to record the opening +% and closing of the |longtable| environment, since can not be +% used inside itself. Thus it can be closed before a new +% instance is opened. +% \begin{macrocode} +\newif\ifMap@open@ +\Map@open@false +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@TOC@name} +% The macros |\Map@TOC@name|\dots provide a mapping between a +% number and a sectioning unit. This mapping is used when the +% entry in the table of contents is generated. +% \begin{macrocode} +\@namedef{Map@TOC@name0}{chapter} +\@namedef{Map@TOC@name1}{section} +\@namedef{Map@TOC@name2}{subsection} +\@namedef{Map@TOC@name3}{subsubsection} +\@namedef{Map@TOC@name4}{paragraph} +\@namedef{Map@TOC@name5}{subparagraph} +\@namedef{Map@TOC@name6}{subsubparagraph} +\@namedef{Map@TOC@name7}{subsubparagraph} +\@namedef{Map@TOC@name8}{subsubparagraph} +\@namedef{Map@TOC@name9}{subsubparagraph} +\@namedef{Map@TOC@name10}{subsubparagraph} +\@namedef{Map@TOC@name11}{subsubparagraph} +\@namedef{Map@TOC@name12}{subsubparagraph} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@start} +% The macro |\Map@start| is used to initiate the use of a map. +% It takes no arguments. The map title is passed in via the +% macro |\Map@TITLE|. +% +% It uses the |longtable| environment to perform the page +% breaking and marking of continued pages. +% \begin{macrocode} +\newcommand\Map@start{% + \advance\Map@counter1 + \setlength{\Map@length}{\textwidth}% + \addtolength{\Map@length}{-\MapTitleFraction\textwidth}% + \addtolength{\Map@length}{-\MapTextFraction\textwidth}% + \ifx\Map@TITLE\empty\else + \MapTOC{\Map@TITLE}% + \fi + \longtable + {@{}p{\MapTitleFraction\textwidth}@{\hspace{\Map@length}} + p{\MapTextFraction\textwidth}@{}}% + \multicolumn{2}{@{}p{\textwidth}@{}}{% + \MapFont{\MapTitleFont\rule{0pt}{3ex}% + \Map@TITLE}} + \endfirsthead + \multicolumn{2}{@{}p{\textwidth}@{}}{% + \MapFont{\MapTitleFont\rule{0pt}{3ex}% + \Map@TITLE\MapContinuedFormat{\MapContinued}}}% + \endhead + \\ + &\MapRuleStart + \rule{\MapTextFraction\textwidth}{\MapRuleWidth}\newline + \mbox{}\hfill + \raisebox{3pt}{\MapContinuingFormat{\MapContinuing}} + \endfoot + &\MapRuleStart + \rule{\MapTextFraction\textwidth}{\MapRuleWidth}% + \vspace{\MapParskip} + \endlastfoot + \xdef\@currentlabel{\Map@TITLE}% + \label{Map@\the\Map@no}% + \global\Map@open@true +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@end} +% The macro |\Map@end| is expanded when the end of the end of +% the |longtable| environment might be needed. The boolean +% |\ifMap@open@| determines whether such an environment is +% really open. +% \begin{macrocode} +\newcommand\Map@end{% + \ifMap@open@\vspace*{1.5ex} + \global\Map@open@false + \endlongtable + \MapNewpage + \fi + \iftrue + \ifnum\Map@blockcount>9 + \PackageWarning{limap}% + {*** The current map contains too much blocks: + \the\Map@blockcount}% + \else\ifnum\Map@blockcount>7 + \PackageWarning{limap}% + {--- The current map contains \the\Map@blockcount blocks.}% + \fi\fi + \fi +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@UP} +% The macro |\Map@UP| contains the number of the parent map or +% the empty string. +% \begin{macrocode} +\newcommand\Map@UP{} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@no} +% The counter |\Map@no| contains the sequence number for all +% maps. This value is used internally to reference single maps. +% \begin{macrocode} +\newcount\Map@no +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@counter} +% The counter |\Map@counter| contains the number of a map in +% the context of the containing map . +% \begin{macrocode} +\newcount\Map@counter +\Map@counter=0 +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@parts@} +% The macro |\Map@parts@| is used to store the parts of the +% top-level maps. This is the initialization of a feature +% otherwise used in the aux file. +% \begin{macrocode} +\@namedef{Map@parts@}{} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Typesetting a Block} +% +% \Block{}% +% Blocks are the basic building unit of maps. Here the Block is +% defined in all it's beauty. +% +% \begin{environment}{Map@Block} +% This macro is used to typeset a block inside a Map. To avoid +% abuse outside of a map it is activated within a Map only. +% \changes{2.2}{2017/07/20}{|MapBlockStartHook| added.} +% \begin{macrocode} +\newenvironment{Map@Block}[1]{\par + \vspace*{-\parskip}\vspace*{-1ex}% + \\\null\par + \vspace*{\MapParskip}% + \raggedright\hspace{0pt}\MapFont{\MapBlockLabelFont{#1}}% + \gdef\@currentlabel{#1}% + &\parskip=\MapParskip + {\MapRuleStart + \rule{\MapTextFraction\textwidth}{\MapRuleWidth}}\par + \ifx\@undefined\MapBlockStartHook\else + \MapBlockStartHook{#1}% + \fi +% \end{macrocode} +% +% The final action is empty. Thus the block can be used as a simple +% macro as well. +% \begin{macrocode} +}{% +} +% \end{macrocode} +% \end{environment} +% +% \Block{}% +% \begin{macro}{\Block} +% The macro |\Block| issues an error when used outside of a Map +% environment. +% \begin{macrocode} +\newcommand\Block[1]{\PackageWarning{limap}{The sectioning command + `Block' has been encountered outside the scope of a Map + environment.}} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\WideBlock} +% The macro |\WideBlock| takes one argument which is added to +% the current block where the whole width of the table is used. +% \begin{macrocode} +\newcommand\WideBlock{\\\multicolumn2{@{}l@{}}} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Typesetting a Table of Contents} +% +% +% \Block{}% +% \begin{macrocode} +\newif\if@Map@toc@sep@ +% \end{macrocode} +% +% \Block{}% +% \begin{macro}{\MapTableOfContents@open} +% The macro |\MapTableOfContents@open| produces the table of +% contents for the current map. It produces a tabular +% containing the titles and pages of all maps directly +% contained in the current map. It utilizes a tabular +% environment and booktabs. +% \begin{macrocode} +\def\MapTableOfContents@open{% + \centering + \begin{tabular}{p{.6\textwidth}r}\toprule + \MapTOCheadfont{\MapTOCname}& + \MapTOCheadfont{\MapTOCpage}\\\midrule + \ifcsdef{Map@parts@\the\Map@no}{ + \edef\Map@tmp@{\csname Map@parts@\the\Map@no\endcsname:}% + \expandafter\Map@toc@loop\Map@tmp@ + \\\bottomrule + }{} + \end{tabular} +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTableOfContents@boxed} +% The macro |MapTableOfContents@boxed| produces the table of +% contents for the current map. It produces a tabular +% containing the titles and pages of all maps directly +% contained in the current map. It utilizes a tabular +% environment and booktabs. +% \begin{macrocode} +\def\MapTableOfContents@boxed{% + \centering + \begin{tabular}{|p{.6\textwidth}|r|}\hline + \MapTOCheadfont{\MapTOCname}& + \MapTOCheadfont{\MapTOCpage}\\\hline + \ifcsdef{Map@parts@\the\Map@no}{ + \edef\Map@tmp@{\csname Map@parts@\the\Map@no\endcsname:}% + \expandafter\Map@toc@loop\Map@tmp@ + \\\hline + }{} + \end{tabular} +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTableOfContentsStyle} +% The macro |MapTableOfContentsStyle| determines the style of +% the TOCs. It can take the values |open| or |boxed|. +% \begin{macrocode} +\newcommand\MapTableOfContentsStyle{open} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\MapTableOfContents} +% The macro |MapTableOfContents| produces the table of +% contents for the current map. It produces a tabular +% containing the titles and pages of all maps directly +% contained in the current map. +% \begin{macrocode} +\newcommand\MapTableOfContents{\par + \global\@Map@toc@sep@false + \csname MapTableOfContents@\MapTableOfContentsStyle\endcsname + \vspace*{-1.5\parskip}\par\ignorespaces +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{macro}{\Map@toc@loop} +% The macro |\Map@toc@loop| is a recursive solution to loop +% through all elements of a list of children. The argment is +% expected to be a colon separated list of numbers. The end is +% marked by two colons in row. +% +% Each number is a reference to a map. The respective line in +% the toc table is produced. +% \begin{macrocode} +\def\Map@toc@loop#1:{% + \def\Map@tmp@{#1}% + \ifx\Map@tmp@\empty + \global\let\Map@next@=\relax + \else + \if@Map@toc@sep@ + \gdef\Map@next@{\\ + \ref{Map@#1}&\pageref{Map@#1}% + \Map@toc@loop}% + \else + \gdef\Map@next@{% + \ref{Map@#1}&\pageref{Map@#1}% + \Map@toc@loop}% + \global\@Map@toc@sep@true + \fi + \fi + \Map@next@ +} +% \end{macrocode} +% \end{macro} +% \end{Map} +% +% \begin{Map}{Typesetting a Table} +% +% \Block{}% +% \begin{macro}{\MapTabularFraction} +% The macro |\MapTabularFraction| contains a factor for the line +% width. This is used to determine the width of the table. The +% tabular is centered in the text column. +% \begin{macrocode} +\newcommand\MapTabularFraction{.95} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{environment}{MapTabular} +% The environment |MapTabular| produces the |tabular| environment +% with the width of the text column. +% \begin{macrocode} +\newenvironment{MapTabular}{% + \begin{center} + \begin{tabular*}{\MapTabularFraction\linewidth}% +}{% + \end{tabular*} + \end{center}\ignorespaces +} +% \end{macrocode} +% \end{environment} +% \end{Map} +% +% \begin{Map}{Typesetting the Title Page} +% +% \Block{}% +% \begin{macro}{\MakeTitle} +% The macro |\MakeTitle| can be used as a replacement for the +% |\maketitle| macro. +% \begin{macrocode} +\newcommand\MakeTitle{\thispagestyle{empty} + \rule{0pt}{.25\textheight}\par + \mbox{}\hfill + \begin{minipage}{\MapTextFraction\textwidth} + \raggedright + \rule{\textwidth}{2pt}\par + \vspace*{2.5\MapParskip}% + \sf{\huge \@title\par}% + \vspace*{2.5\MapParskip}% + \rule{\textwidth}{2pt}\par + \vspace*{2.5\MapParskip}% + \MapFont{\large \@author} \par + \vspace*{2.5\MapParskip}% + \MapFont{\footnotesize \@date} + \vspace*{\MapParskip}% + \end{minipage}% + \vspace*{-22ex}% + \par +} +% \end{macrocode} +% \end{macro} +% +% \Block{}% +% \begin{environment}{Abstract} +% This macro is used to typeset the abstract. +% \begin{macrocode} +\newenvironment{Abstract}{\vfill + \par + \mbox{}\hfill + \begin{minipage}{\MapTextFraction\textwidth}\parskip=1ex + \rule{\textwidth}{1pt}\medskip\par +% \end{macrocode} +% +% \begin{macrocode} +}{\par\rule{\textwidth}{1pt} + \end{minipage}% + \par +} +% \end{macrocode} +% \end{environment} +% +% \Block{Use maketitle and abstract}% +% The new |\maketitle| macro is activated for the class. +% +% \begin{macrocode} +%<*class> +\let\maketitle\MakeTitle +\let\abstract\Abstract +\let\endabstract\endAbstract +%</class> +% \end{macrocode} +% \end{Map} +% +% \begin{Map}{Final Actions} +% +% \Block{Local configuration}% +% Load the configuration file at the end if it can be found. +% \begin{macrocode} +\InputIfFileExists{limap.cfg}{}{} +% \end{macrocode} +% +% \Block{}% +% Finally we have to activate the proper settings for the chosen +% language. +% \begin{macrocode} +\csname LIMAP@SelectLanguage@\LIMAP@Language\endcsname +% \end{macrocode} +% +% \begin{macrocode} +\ifLIMAP@strict + \def\chapter{\PackageWarning{limap}{The sectioning command + `chapter' is not available.}} +% \def\section{\PackageWarning{limap}{The sectioning command +% `section' is not available.}} + \def\subsection{\PackageWarning{limap}{The sectioning command + `subsection' is not available.}} + \def\subsubsection{\PackageWarning{limap}{The sectioning command + `subsubsection' is not available.}} + \def\paragraph{\PackageWarning{limap}{The sectioning command + `paragraph' is not available.}} + \def\subparagraph{\PackageWarning{limap}{The sectioning command + `subparagraph' is not available.}} + \def\subsubparagraph{\PackageWarning{limap}{The sectioning command + `subsubparagraph' is not available.}} +\fi +% \end{macrocode} +% +% \Block{Finale}% +% That's all for this time. +% \end{Map} +% \end{Map} +% \end{Map} +% +% \Finale +% +\endinput +% +% Local Variables: +% mode: latex +% TeX-master: "limap.dtx" +% End: diff --git a/macros/latex/contrib/gene/limap/limap.ins b/macros/latex/contrib/gene/limap/limap.ins new file mode 100644 index 0000000000..32fbafd1b9 --- /dev/null +++ b/macros/latex/contrib/gene/limap/limap.ins @@ -0,0 +1,41 @@ +%%------------------------------------------------------------------ +%% Driver file to extract the dtx style and class files. +%% +%% Copyright (C) 1999-2016 Gerd Neugebauer +%% +%% limap.ins may be distributed under the terms of the LaTeX Project +%% Public License version 1.3c, as described in lppl.txt. +%% +%%------------------------------------------------------------------ +%% +%% Run this file through TeX or LaTeX to extract the files. +%% You need the docstrip package as distributed with LaTeX2e. +%% It is also available as seperate package from any CTAN site. +%% +%%------------------------------------------------------------------ + +\input docstrip.tex +\keepsilent +\askonceonly + +\generate{\file{limap.sty}{\from{limap.dtx}{package}} + \file{limap.cls}{\from{limap.dtx}{class}} + } + +\ifToplevel{ +\Msg{****************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by LaTeX:} +\Msg{*} +\Msg{* \space\space limap.cls limap.sty} +\Msg{*} +\Msg{* To produce the documentation run limap.dtx through LaTeX,} +\Msg{* makeindex, and LaTeX again.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{****************************************************************} +} + +\endbatchfile +\endinput diff --git a/macros/latex/contrib/gene/limap/limap.pdf b/macros/latex/contrib/gene/limap/limap.pdf Binary files differnew file mode 100644 index 0000000000..4e7b072510 --- /dev/null +++ b/macros/latex/contrib/gene/limap/limap.pdf diff --git a/macros/latex/contrib/gene/limap/lppl.txt b/macros/latex/contrib/gene/limap/lppl.txt new file mode 100644 index 0000000000..2244313901 --- /dev/null +++ b/macros/latex/contrib/gene/limap/lppl.txt @@ -0,0 +1,416 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may 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 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. + diff --git a/macros/latex/contrib/gene/limap/samples/boxed-toc.ltx b/macros/latex/contrib/gene/limap/samples/boxed-toc.ltx new file mode 100644 index 0000000000..ca2faf72e9 --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/boxed-toc.ltx @@ -0,0 +1,88 @@ +% This file is in the Public Domian (Creative Commons CC0 1.0 +% Universal)) +\documentclass[11pt,a4paper,german]{limap} +\renewcommand\MapTableOfContentsStyle{boxed} +\begin{document} +\author{S.O. Meone} +\title{Something About Nothing} +\maketitle +\newpage + +\begin{Map}{Lorem ipsum} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \MapTableOfContents + +\begin{Map}{Lorem ipsum dolor sit} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + \begin{tabular}{lll}\toprule + aaaa & bbbb & cccc \\\midrule + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\bottomrule + \end{tabular} +\end{Map} + +\begin{Map}{Lorem ipsum dolor} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +\end{Map} +\end{Map} + +\end{document} diff --git a/macros/latex/contrib/gene/limap/samples/boxed-toc.pdf b/macros/latex/contrib/gene/limap/samples/boxed-toc.pdf Binary files differnew file mode 100644 index 0000000000..600265b0b0 --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/boxed-toc.pdf diff --git a/macros/latex/contrib/gene/limap/samples/hyper.ltx b/macros/latex/contrib/gene/limap/samples/hyper.ltx new file mode 100644 index 0000000000..abfca30e5d --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/hyper.ltx @@ -0,0 +1,96 @@ +% This file is in the Public Domian (Creative Commons CC0 1.0 +% Universal)) +\documentclass[11pt,a4paper,german]{limap} + +\usepackage{hyperref} +\usepackage[svgnames]{xcolor} +\hypersetup{colorlinks, + citecolor=Navy, + filecolor=Navy, + linkcolor=Navy, + urlcolor=Navy} + +\begin{document} +\author{S.O. Meone} +\title{Something About Nothing} +\maketitle +\newpage + +\begin{Map}{Lorem ipsum} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \MapTableOfContents + +\begin{Map}{Lorem ipsum dolor sit} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + \begin{tabular}{lll}\toprule + aaaa & bbbb & cccc \\\midrule + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\bottomrule + \end{tabular} +\end{Map} + +\begin{Map}{Lorem ipsum dolor} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +\end{Map} +\end{Map} + +\end{document} diff --git a/macros/latex/contrib/gene/limap/samples/hyper.pdf b/macros/latex/contrib/gene/limap/samples/hyper.pdf Binary files differnew file mode 100644 index 0000000000..13726137aa --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/hyper.pdf diff --git a/macros/latex/contrib/gene/limap/samples/nolines.ltx b/macros/latex/contrib/gene/limap/samples/nolines.ltx new file mode 100644 index 0000000000..e7d732fcc8 --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/nolines.ltx @@ -0,0 +1,88 @@ +% This file is in the Public Domian (Creative Commons CC0 1.0 +% Universal)) +\documentclass[11pt,a4paper,german,nolines]{limap} + +\begin{document} +\author{S.O. Meone} +\title{Something About Nothing} +\maketitle +\newpage + +\begin{Map}{Lorem ipsum} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \MapTableOfContents + +\begin{Map}{Lorem ipsum dolor sit} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + \begin{tabular}{lll}\toprule + aaaa & bbbb & cccc \\\midrule + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\bottomrule + \end{tabular} +\end{Map} + +\begin{Map}{Lorem ipsum dolor} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +\end{Map} +\end{Map} + +\end{document} diff --git a/macros/latex/contrib/gene/limap/samples/nolines.pdf b/macros/latex/contrib/gene/limap/samples/nolines.pdf Binary files differnew file mode 100644 index 0000000000..f8838cf03a --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/nolines.pdf diff --git a/macros/latex/contrib/gene/limap/samples/sample.ltx b/macros/latex/contrib/gene/limap/samples/sample.ltx new file mode 100644 index 0000000000..3c792944c3 --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/sample.ltx @@ -0,0 +1,88 @@ +% This file is in the Public Domian (Creative Commons CC0 1.0 +% Universal)) +\documentclass[11pt,a4paper,german]{limap} + +\begin{document} +\author{S.O. Meone} +\title{Something About Nothing} +\maketitle +\newpage + +\begin{Map}{Lorem ipsum} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \MapTableOfContents + +\begin{Map}{Lorem ipsum dolor sit} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. + + \Block{Lorem ipsum dolor sit amet} + \begin{tabular}{lll}\toprule + aaaa & bbbb & cccc \\\midrule + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\hline + aaaa & bbbb & cccc \\\bottomrule + \end{tabular} +\end{Map} + +\begin{Map}{Lorem ipsum dolor} + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. + + \Block{Lorem ipsum dolor sit amet} + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +\end{Map} +\end{Map} + +\end{document} diff --git a/macros/latex/contrib/gene/limap/samples/sample.pdf b/macros/latex/contrib/gene/limap/samples/sample.pdf Binary files differnew file mode 100644 index 0000000000..2fd683f40b --- /dev/null +++ b/macros/latex/contrib/gene/limap/samples/sample.pdf diff --git a/macros/latex/contrib/gene/logic/gn-logic14.pdf b/macros/latex/contrib/gene/logic/gn-logic14.pdf Binary files differnew file mode 100644 index 0000000000..cbca95f1c1 --- /dev/null +++ b/macros/latex/contrib/gene/logic/gn-logic14.pdf diff --git a/macros/latex/contrib/gene/logic/gn-logic14.sty b/macros/latex/contrib/gene/logic/gn-logic14.sty new file mode 100644 index 0000000000..ae023304c5 --- /dev/null +++ b/macros/latex/contrib/gene/logic/gn-logic14.sty @@ -0,0 +1,119 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\typeout{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% + Logic Formula Environments and Macros. Version 1.4 gene 5/95 +% +% Purpose: +% Style option for LaTeX2e and LaTeX 2.09 to typeset formulas. +% +% Documentation: see seperate LaTeX document `gn-logic14.tex' +% +% Author: Gerd Neugebauer +% \"Odenburger Str. 16 +% 64295 Darmstadt (Germany) +% Mail: gerd@imn.th-leipzig.de +% +% Copyright (C) 1995 Gerd Neugebauer +% +% gn-logic.sty is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY. No author or distributor +% accepts responsibility to anyone for the consequences of using it +% or for whether it serves any particular purpose or works at all, +% unless he says so in writing. +% +% Everyone is granted permission to copy, modify and redistribute +% gn-logic.sty, provided this copyright notice is preserved and any +% modifications are indicated. +% +% +% This style is still under development and may be replaced with a new +% version which provides an enhanced functionality. +% Any comments are welcome but don't expect ANY help from my side. +% +} + +%%%---------------------------------------------------------------------------- +%%% Several useful abbrevations +%%% +\def\AND { \,\wedge\, } +\def\OR { \,\vee\, } +\def\XOR { \,\stackrel{.}{\vee}\, } +\def\IMPLIES { \,\rightarrow\, } +\def\IMPL { \,\rightarrow\, } +\def\IF { \,\leftarrow\, } +\def\IFF { \,\leftrightarrow\, } +\def\IFFdef { \,\stackrel{\rm def}{\longleftrightarrow}\, } + +\def\ANDdots { \,\wedge\!\ldots\!\wedge\, } +\def\ORdots { \,\vee\!\ldots\!\vee\, } + +\def\is { \!\setminus\! } +\def\Forall#1{ \forall #1\ } +\def\Exists#1{ \exists #1\ } + +\def\bbOne{\ifmmode\mathrm{1\!l}\else\mbox{\(\mathrm{1\!l}\)}\fi} +\def\bbB{\ifmmode\mathrm{I\!B}\else\mbox{\(\mathrm{I\!B}\)}\fi} +\def\bbD{\ifmmode\mathrm{I\!D}\else\mbox{\(\mathrm{I\!D}\)}\fi} +\def\bbE{\ifmmode\mathrm{I\!E}\else\mbox{\(\mathrm{I\!E}\)}\fi} +\def\bbF{\ifmmode\mathrm{I\!F}\else\mbox{\(\mathrm{I\!F}\)}\fi} +\def\bbH{\ifmmode\mathrm{I\!H}\else\mbox{\(\mathrm{I\!H}\)}\fi} +\def\bbI{\ifmmode\mathrm{I\!I}\else\mbox{\(\mathrm{I\!I}\)}\fi} +\def\bbJ{\ifmmode\mathrm{J\!\!J}\else\mbox{\(\mathrm{J\!\!J}\)}\fi} +\def\bbK{\ifmmode\mathrm{I\!K}\else\mbox{\(\mathrm{I\!K}\)}\fi} +\def\bbL{\ifmmode\mathrm{I\!L}\else\mbox{\(\mathrm{I\!L}\)}\fi} +\def\bbN{\ifmmode\mathrm{I\!N}\else\mbox{\(\mathrm{I\!N}\)}\fi} +\def\bbM{\ifmmode\mathrm{I\!M}\else\mbox{\(\mathrm{I\!M}\)}\fi} +\def\bbP{\ifmmode\mathrm{I\!P}\else\mbox{\(\mathrm{I\!P}\)}\fi} +\def\bbR{\ifmmode\mathrm{I\!R}\else\mbox{\(\mathrm{I\!R}\)}\fi} +\def\bbZ{\ifmmode\mathsf{Z\;\!\!\!\!Z}\else\mbox{\(\mathsf{Z\;\!\!\!\!Z}\)}\fi} +\let\N=\Nat +\let\Nat=\bbN +\let\Real=\bbR +\let\Int=\bbZ +%\def\Int{\mbox{\sf Z\hspace{-0.45em}Z}} +\def\bbC{\mbox{\rm\hspace{0.2em}\rule[.1ex]{.05em}{1.37ex}\hspace{-0.27em}C}} +\def\bbG{\mbox{\rm\hspace{0.2em}\rule[.1ex]{.05em}{1.37ex}\hspace{-0.27em}G}} +\def\bbO{\mbox{\rm\hspace{0.2em}\rule[.1ex]{.05em}{1.37ex}\hspace{-0.27em}O}} +\def\bbQ{\mbox{\rm\hspace{0.2em}\rule[.1ex]{.05em}{1.37ex}\hspace{-0.27em}Q}} +\let\Complex=\bbC +\let\Rat=\bbQ +%%%---------------------------------------------------------------------------- +%%% The formula environment +%%% + +\newlength\FormulaIndent \FormulaIndent=3em + +\def\Formula{\@ifnextchar[{\@Formula}{\@Formula[]}} + +\def\@FormLabel[#1]{\end{array}\\\label{#1}&&\begin{array}{l} } + +\def\@Formula[#1]{\begingroup\setlength{\arraycolsep}{0pt}% + \def\Form{\@ifnextchar[{\@FormLabel}{\end{array}\\&&\begin{array}{l} }}% + \def\={\\\hspace*{\FormulaIndent}}% + \def\>##1{\\\hspace*{\FormulaIndent}\hspace*{##1\FormulaIndent}}% + \penalty-500\eqnarray\ifx\@empty#1\else\label{#1}\fi&&\begin{array}{l} } + +\def\endFormula{\end{array}\endeqnarray\endgroup} + + +%%%---------------------------------------------------------------------------- +%%% The NewTheorem environment +%%% + +\def\TheoremTitle#1{{\small #1}} +\def\TheoremName#1{{\small\bf (#1)}} + +\def\NewTheorem#1{ + \expandafter\gdef\csname #1\endcsname{\csname THM#1\endcsname\@@theorem} + \expandafter\gdef\csname end#1\endcsname{\csname endTHM#1\endcsname} + \@ifnextchar[{\New@Theorem#1}{\expandafter\newtheorem{THM#1}}} + +\def\New@Theorem#1[{\expandafter\newtheorem{THM#1}[THM} + +\def\@@theorem{% +\@ifnextchar[{\@@theorem@title}{\@ifnextchar({\@@theorem@label}{\@ifnextchar<{\@@theorem@name}{\ \nobreak\\\nobreak}}}} + +\def\@@theorem@label(#1){\label{#1}\@@theorem} +\def\@@theorem@title[#1]{\ \TheoremTitle{#1}\@@theorem} +\def\@@theorem@name<#1>{\ \TheoremName{#1}\@@theorem} + diff --git a/macros/latex/contrib/gene/logic/gn-logic14.tex b/macros/latex/contrib/gene/logic/gn-logic14.tex new file mode 100644 index 0000000000..1ad9ff0e15 --- /dev/null +++ b/macros/latex/contrib/gene/logic/gn-logic14.tex @@ -0,0 +1,394 @@ +%*****************************************************************************/ +%* */ +%* Version: 1.00 Date: 21/04/92 File: gn-logic14.tex */ +%* Last Version: File: */ +%* Changes: */ +%* 30/12/90 First version of documentation. */ +%* 21/04/92 new properties */ +%* */ +%* Title: */ +%* Author: Gerd Neugebauer */ +%* */ +%* Usage: latex gn-logic14.tex */ +%* */ +%*****************************************************************************/ + +\documentstyle[11pt,dina4,gn-logic14]{article} + +\setlength{\unitlength}{1pt} + + +\begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newlength{\Width} \Width=\textwidth \advance\Width by -1.5em \divide\Width by 2 + +\section{The {\tt gn-logic} style option} +Description of Version 1.4 (5/95) by Gerd Neugebauer \bigskip + +The {\tt gn-logic} style option provides a facility to typeset logical +formulas of a certain kind. This style option provides an environment like +\verb|eqnarray|, an extended {\tt newtheorem} environment and several macros. + + + +\subsection{Mathematical Symbols} + +The following marcos provide better usage of the junctors and quantifiers. +Especially the spacing is improved. + + +\noindent\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}*{4}{l}} +\multicolumn{1}{c}{\small Symbol} + & \multicolumn{1}{c}{\small Macro} + & \multicolumn{2}{c}{\small Example} \\ + & & & \\ +$\AND$ & \verb|\AND| & \verb$A\AND B$ & $A\AND B$ \\ +$\OR$ & \verb|\OR| & \verb$A\OR B$ & $A\OR B$ \\ +$\XOR$ & \verb|\XOR| & \verb$A\XOR B$ & $A\XOR B$ \\ +$\IMPLIES$ & \verb|\IMPLIES| & \verb$A\IMPLIES B$ & $A\IMPLIES B$ \\ +$\IMPL$ & \verb|\IMPL| & \verb$A\IMPL B$ & $A\IMPL B$ \\ +$\IF$ & \verb|\IF| & \verb$A\IF B$ & $A\IF B$ \\ +$\IFF$ & \verb|\IFF| & \verb$A\IFF B$ & $A\IFF B$ \\ +$\IFFdef$ & \verb|\IFFdef| & \verb$A\IFFdef B$ & $A\IFFdef B$ \\ +$\ANDdots$ & \verb|\ANDdots| & \verb$A_1\ANDdots A_n$ & $A_1\ANDdots A_n$ \\ +$\ORdots$ & \verb|\ORdots| & \verb$A_1\ORdots A_n$ & $A_1\ORdots A_n$ \\ +$\is$ & \verb|\is| & \verb$x\is y$ & $x\is y$ \\ +$\Nat$ & \verb|\Nat| & \verb$n\in\Nat$ & $n\in\Nat$ \\ +$\Forall$ & \verb|\Forall| & \verb$\Forall x P(x)$ & $\Forall x P(x)$ \\ +$\Exists$ & \verb|\Exists| & \verb$\Exists y P(x)$ & $\Exists y P(x)$ \\ +\end{tabular*} + + +\newcommand{\bs}{{\tt\char"5C}} +\newcommand{\mac}[1]{The {\tt\char92 #1} Macro} +\newcommand{\macs}[2]{The {\tt\char92 #1} and the {\tt\char92 #2} Macros} +\newenvironment{compare}% +{\noindent\begin{center}% + \begin{tabular}{@{}l@{\hspace*{1.5em}produces\hspace*{1.5em}}l@{}}}% +{\end{tabular}\end{center}} + +\subsubsection*{\mac{AND}} +This macro can be used for the logical conjunction. In addition to the +\verb|\wedge| macro it adds more space and the formulas tend to be better +readable. Compare + +\begin{compare} +\verb$x=1\AND y=x$ & $x=1\AND y=x$ \\ +\verb$x=1\wedge y=x$ & $x=1\wedge y=x$ \\ +\verb$x=1\land y=x$ & $x=1\land y=x$ +\end{compare} + +\subsubsection*{\mac{OR}} +This macro can be used for the logical disjunction. In addition to the +\verb|\vee| macro it adds more space. Compare + +\begin{compare} +\verb$x=1\OR y=x$ & $x=1\OR y=x$ \\ +\verb$x=1\vee y=x$ & $x=1\vee y=x$ \\ +\verb$x=1\lor y=x$ & $x=1\lor y=x$ +\end{compare} + + +\subsubsection*{\mac{XOR}} +This macro can be used for the exclusive disjunction. It has no common +counterpart. The spacing is like in in all junctor macros. + +\begin{compare} +\verb$x=1\XOR y=x$ & $x=1\XOR y=x$ +\end{compare} + + +\subsubsection*{\macs{IMPL}{IMPLIES}} +These macros can be used for the logical implication. In addition to the +\verb|\rightarrow| macro it adds more space. Compare + +\begin{compare} +\verb$x=1\IMPL y=x$ & $x=1\IMPL y=x$ \\ +\verb$x=1\IMPLIES y=x$ & $x=1\IMPLIES y=x$ \\ +\verb$x=1\rightarrow y=x$ & $x=1\rightarrow y=x$ +\end{compare} + + +\subsubsection*{\mac{IF}} + This macro can be used for the logical implication written in reverse order. +In addition to the \verb|\leftarrow| macro it adds more space. Compare + +\begin{compare} +\verb$x=1\IF y=x$ & $x=1\IF y=x$ \\ +\verb$x=1\lefttarrow y=x$ & $x=1\leftarrow y=x$ +\end{compare} + +\subsubsection*{\mac{IFF}} + This macro can be used for the logical equivalence. +In addition to the \verb|\leftrightarrow| macro it adds more space. Compare + +\begin{compare} +\verb$x=1\IFF y=x$ & $x=1\IFF y=x$ \\ +\verb$x=1\leftrighttarrow y=x$ & $x=1\leftrightarrow y=x$ +\end{compare} + +\subsubsection*{\mac{IFFdef}} + Like above but with a small ``def'' above the arrow. + +\begin{compare} +\verb$x=1\IFFdef y=x$ & $x=1\IFFdef y=x$ +\end{compare} + +\subsubsection*{\mac{is}} + This macro is for typesetting unifiers. In this case the predefined +\verb|\setminus| produces to much space. + +\begin{compare} +\verb$\{y\setminus x, z\setminus 4\}$ & $\{y\setminus x, z\setminus 4\}$ \\ +\verb$\{y\is x, z\is 4\}$ & $\{y\is x, z\is 4\}$ \\ +\verb$\{y\backslash x, z\backslash 4P}$ & $\{y\backslash x, z\backslash 4\}$ +\end{compare} + +\ifx\AmSTeX\undefined +\def\AmSTeX{$\cal A$\kern-.1667em\lower.5ex\hbox + {$\cal M$}\kern-.125em$\cal S$-\kern-.1em\TeX} +\fi + +\subsubsection*{The Number Macros} +This are macros for those who have no access to the \AmSTeX{} fonts. It makes +the symbols for the natural numbers, integers, rationals, reals and complex +numbers. The usual magnification commands apply to it aswell. + + +\def\BB#1{\csname bb#1\endcsname} +\def\Line#1{\LINE{#1}\(\BB{#1}_{\BB{#1}}\)} +\def\LINE#1{{\tt \char92bb#1}&% + {\tiny\BB{#1}}&% + {\scriptsize\BB{#1}}&% + {\footnotesize\BB{#1}}&% + {\small\BB{#1}}&% + {\normalsize\BB{#1}}&% + {\large\BB{#1}}&% + {\Large\BB{#1}}&% + {\LARGE\BB{#1}}&% + {\huge\BB{#1}}&% + {\Huge\BB{#1}}&% + } +\begin{center} + \begin{tabular}{c|cccccccccc|c} + &\multicolumn{10}{|c|}{{\tt \char92tiny \hfill...\hfill\char92normalsize \hfill...\hfill\char92Huge}}&\verb|X_X| + \\\hline + \Line B\\ + \verb|\Complex|\Line C\\ + \Line D\\ + \Line E\\ + \Line F\\ + \Line G\\ + \Line H\\ + \Line I\\ + \Line J\\ + \Line K\\ + \Line L\\ + \Line M\\ + \verb|\Nat| \Line N\\ + \Line O\\ + \Line P\\ + \verb|\Rat| \Line Q\\ + \verb|\Real| \Line R\\ + \verb|\Int| \Line Z\\ + \Line{One} + \end{tabular} +\end{center} + +Unfortunately the macros \verb|\bbC|, \verb|\bbG|, \verb|\bbO|, and +\verb|\bbQ| do not scale properly when used in subscripts or superscripts of +formulae. The following examples shows how the sizing can be achieved manually + +\noindent\begin{compare} +\verb$\bbQ_{\mbox{\scriptsize \bbQ}}$ & $\bbQ_{\mbox{\scriptsize \bbQ}}$ +\end{compare} + + + +\subsubsection*{\macs{Forall}{Exists}} + The general problem with quantifies is that after the quantified variable the +following formula is not automatically seperated with a small space. This can +be overcome by the following macros. + +The \verb|\Forall| and the \verb|\Exists| macros take one argument. They +typeset the respective quantifier followed by the argument (i.e.\ the variable) +and finally a small space. As usual the argument has to be enclosed in braces +if it consists of more than one character. Otherwise the braces can be omitted. +This allows a elegant notation of short quantified formulas. + +\noindent\begin{compare} +\verb$\Forall x P(x)$ & $\Forall x P(x)$\\ +\verb$\Forall{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$% +&$\Forall{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$\\ +\verb$\Exists x P(x)$ & $\Exists x P(x)$\\ +\verb$\Exists{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$% +& $\Exists{x_1,\ldots,x_n}P(x_1,\ldots,x_n)$ +\end{compare} + + + +\subsection{The {\tt Formula} Environment} + +This environment allows to typeset logical formulas. The main problem with the +\verb|eqnarray| environment was the numbering. In multiline formulas my +intention was to have the number in the middle of the formula. Inside this +environment several macros are valid. + +\begin{description} + \item[{\tt\bs begin\{Formula\}[{\em label}] \bs end\{Formula\}}] \ \\ + Start the list of formulas. Optionally a label can be given. This label + is used to reference the first formula. + \item[{\tt\bs =}] \ \\ + Start a new line. + \item[{\tt\bs >}{\em level}] \ \\ + Start a new line and indent to the given {\em level}. This indentation + is done in quantities of \verb|\FormulaIndent| which can be set with + the \verb|\setlength| command. The default value is {\tt 3em}. + \item[{\tt\bs Form[{\em label}]}] \ \\ + Start a new formula. Optionally a {\em label} can be given. This {\em + label} can be used to reference to the formula (see \verb|\ref|). +\end{description} + +Now lets have a look at some examples. First, we see a single two-line formula. +Note that the number at the right side is centered between the two lines. +\medskip + +\noindent +\begin{minipage}{\Width} +\small\begin{verbatim} +\begin{Formula} + P(X) \IMPL +\= Q(X) \IFF R_1(X) \OR R_2(X) +\end{Formula} +\end{verbatim} +\end{minipage} +\hfill +\begin{minipage}{\Width} +\begin{Formula} + P(X) \IMPL +\= Q(X) \IFF R_1(X) \OR R_2(X) +\end{Formula} +\end{minipage}\medskip + +Next we will see an example of several formulas. The first formula is split to +three lines and the third line is indented to level 1. Remark: \verb|\=| is in +reality an abbrevation for \verb|\>0|. +\medskip + +\noindent +\begin{minipage}{\Width} +\small\begin{verbatim} +\begin{Formula}[form:1] + P(X) \IMPL +\= Q(X) \IFF R_1(X) +\>1 \OR R_2(X) +\Form[form:2] + S(X) \IMPL +\= \neg Q(X) \IFF R_1(X) \OR R_2(X) +\end{Formula} +\end{verbatim} +\end{minipage} +\hfill +\begin{minipage}{\Width} +\begin{Formula}[form:1] + P(X) \IMPL +\= Q(X) \IFF R_1(X) +\>1 \OR R_2(X) +\Form[form:2] + S(X) \IMPL +\= \neg Q(X) \IFF R_1(X) \OR R_2(X) +\end{Formula} +\end{minipage}\medskip + + +\subsection{The {\tt NewTheorem} Environment} + +My experience with the {\tt newtheorem} environment was that I had a certain +scheme to use it. First, every theorem got a label. Thus, every {\em theorem} +was followed by a {\tt label} command. Optionally a {\em theorem} may have a +name. This name is typeset right after the number. The body of the {\em + theorem} allways started in the next line. This let to the definition of an +extended {\tt NewTheorem} environment. The arguments are the same as those of +the {\tt newtheorem} environment. But the environment defined by this extended +command take two optional arguments. The first optional argument is a label to +be assigned to the {\em theorem}. This argument has to be enclosed in +parentheses. The second type of optional argument has to be enclosed in +brakets. It is typeset in \verb|\small| after the title text. The third +optional argument is enclosed in \verb|<>|. It is typeset in \verb|\small\bf| +and surrounded by parentheses. +\medskip + +\noindent\begin{minipage}{\Width} +\small\begin{verbatim} + +\NewTheorem{guess}{Conjecture} + +\begin{guess}[Fermat](thm:fermat) + There do not exist integers $n>2$, + $x$, $y$, and $z$ such that + $x^n+y^n=z^n$. +\end{guess} +\end{verbatim} +\end{minipage} +\hfill +\begin{minipage}{\Width} +\NewTheorem{guess}{Conjecture} + +\begin{guess}[Fermat](thm:fermat) + There do not exist integers $n>2$, + $x$, $y$, and $z$ such that + $x^n+y^n=z^n$. +\end{guess} +\end{minipage} +\medskip + +The commands used to typeset some of the optional argument can be customized +in the following way. The macros \verb|\TheoremTitle| and \verb|\TheoremName| +are used to typeset their argument in \verb|\small| and \verb|\small\bf| and +enclosed in parentheses respectively. This macros can be redefined using +\verb|\renewcommand| as shown in the following example: +\medskip + +\noindent\begin{minipage}{\Width} +\footnotesize\begin{verbatim} +\NewTheorem{theorem}{Theorem} +\renewcommand{\TheoremTitle}[1]{{\sf [#1]}} +\renewcommand{\TheoremName}[1]{{\small(#1)}} +\begin{theorem}[Fermat]<conjecture>(thm:f2) + There do not exist integers ... +\end{theorem} +\end{verbatim} +\end{minipage} +\hfill +\begin{minipage}{\Width} +\NewTheorem{theorem}{Theorem} +\renewcommand{\TheoremTitle}[1]{{\sf #1}} +\renewcommand{\TheoremName}[1]{{\small(#1)}} +\begin{theorem}[Fermat]<conjecture>(thm:f2) + There do not exist integers $n>2$, + $x$, $y$, and $z$ such that + $x^n+y^n=z^n$. +\end{theorem} +\end{minipage} + +\end{document} + + + +\newcommand{\ENTRY}[1]{{#1 \Nat}& {#1 \Int}& {#1 \Rat}&{#1 \Real}& {#1 \Complex}} + +\begin{center} +\begin{tabular}{l|ccccc} +&\verb|\Nat|&\verb|\Int|&\verb|\Rat|&\verb|\Real|&\verb|\Complex|\\ +&&\\\hline&&\\ +\verb$\tiny$ & \ENTRY{\tiny} \\ +\verb$\scriptsize$ & \ENTRY{\scriptsize} \\ +\verb$\footnotesize$ & \ENTRY{\footnotesize} \\ +\verb$\small$ & \ENTRY{\small} \\ +\verb$\normalsize$ & \ENTRY{\normalsize} \\ +\verb$\large$ & \ENTRY{\large} \\ +\verb$\Large$ & \ENTRY{\Large} \\ +\verb$\LARGE$ & \ENTRY{\LARGE} \\ +\verb$\huge$ & \ENTRY{\huge} \\ +\verb$\Huge$ & \ENTRY{\Huge} +\end{tabular}\end{center} diff --git a/macros/latex/contrib/gene/pl/Makefile b/macros/latex/contrib/gene/pl/Makefile new file mode 100644 index 0000000000..61a5b3354b --- /dev/null +++ b/macros/latex/contrib/gene/pl/Makefile @@ -0,0 +1,59 @@ +#****************************************************************************** +#* $Id: Makefile,v 3.0 1994/11/07 11:24:24 gerd Exp gerd $ +#****************************************************************************** +#* Author: Gerd Neugebauer +#*============================================================================= + +INSTALLDIR = /usr/local/lib/texmf/tex/inputs + +#============================================================================= + +LATEX = latex +MAKEINDEX = makeindex -s gind.ist +RM = /bin/rm + +#============================================================================= + +DISTFILES = README pl.doc pl.ins pl.tex pl.cfg sample.pl Makefile + +all: pl.sty pl.dvi + + +pl.sty: pl.dtx pl.ins + $(LATEX) pl.ins + +pcode.sty: pl.dtx pl.ins + $(LATEX) pl.ins + +pl.dvi: pl.dtx pl.tex pl.cfg sample.pl + $(LATEX) pl.tex + $(MAKEINDEX) pl + $(LATEX) pl.tex + +#============================================================================= + +clean: + $(RM) -f *.log *.dvi *.bak *~ #* + +distclean: + $(RM) -f pl.sty pl*.gz pl*.zip *.log *.dvi *.bak *~ #* + +install: pl.sty + cp pl.sty $(INSTALLDIR) + +#============================================================================= + +ci: + ci -l $(DISTFILES) + +VERSION = `grep '^\\\\def\\\\fileversion{.*}' pl.doc | sed -e 's/.*{//' -e 's/[} ]//' -e 's/\\./_/'` + +dist: + @echo Packing version $(VERSION) + @mkdir pl_$(VERSION); cp $(DISTFILES) pl_$(VERSION) + @zip pl_$(VERSION).zip pl_$(VERSION)/* + @tar -cvf - pl_$(VERSION) | gzip > pl_$(VERSION).tar.gz + @$(RM) -rf pl_$(VERSION) + +#============================================================================= + diff --git a/macros/latex/contrib/gene/pl/README b/macros/latex/contrib/gene/pl/README new file mode 100644 index 0000000000..5a293eb0e4 --- /dev/null +++ b/macros/latex/contrib/gene/pl/README @@ -0,0 +1,84 @@ + + Literate Programming for Prolog with LaTeX. + + Gerd Neugebauer + FB Informatik, Universitt Koblenz-Landau + gerd@informatik.uni-koblenz.de + + +This file describes the installation procedure of the style options pl +and pcode. The documentation will be produced during this process. + +Files +===== + +The distribution of pl.sty contains at least the following files: + +README This file. +pl.doc The documented style file. +pl.ins The docstrip program to produce pl.sty. +pl.tex The driver file to produce the documentation. +pl.cfg The documentation configuration file. +sample.pl A sample Prolog file. +Makefile A makefile for UN*X (or whoever can use it) + + + +Prerequisites +============= + +(1) You need to have installed LaTeX. + LaTeX 2.09 is ok. + +(2) You need the style option doc.sty and the file docstrip.tex on + your TeX search path. (To put them in the current directory should + also work) + You need a version distributed with LaTeX2e --- even if you still + use LaTeX 2.09. + +(3) You need multicol.sty. At least a file named multicol.sty should + be on your TeX search path if you use LaTeX 2.09. + +(4) You should have the program makeindex to generate the index for the full + documentation. + + +Installation +============ + +(1) If you have a working make (e.g. on UNIX) you can just type + + make + + This performs the following steps which can also be started + manually: + + (1.1) Run LaTeX on the file pl.ins like in + + latex pl.ins + + This should produce the files pl.sty and pcode.sty + (and as a side effect the file pl.log) + + (1.2) Run LaTeX on the file pl.tex like in + + latex pl.tex + + This will produce the documentation file pl.dvi + +(2) Place the file pl.sty and maybe pcode.sty in a place where TeX + searches for it. + +(3) Print the documentation pl.dvi and READ it! + + +PROBLEMS +======== + +* If you do not get your hands on the appropriate version of + docstrip then you can just rename pl.doc into pl.sty. This + should work even if the startup time might be slightly higher. + +* If you get an error during the processing of pl.tex, most + likely your version of doc.sty or multicol.sty is out of date. + diff --git a/macros/latex/contrib/gene/pl/pl.cfg b/macros/latex/contrib/gene/pl/pl.cfg new file mode 100644 index 0000000000..ecbbb551c5 --- /dev/null +++ b/macros/latex/contrib/gene/pl/pl.cfg @@ -0,0 +1,12 @@ + +% The following macro forces the generation of the description part of the +% documentation only. If it is deactivated (with a leading %) the whole +% description including the implementation is enabled. + +%\OnlyDescription + +% The following instruction forces the use of A4 size paper +% (even in LaTeX2.09). +% You need to have the style option dina4 for this to work. + +\usepackage{dina4} diff --git a/macros/latex/contrib/gene/pl/pl.dtx b/macros/latex/contrib/gene/pl/pl.dtx new file mode 100644 index 0000000000..a0960f3a53 --- /dev/null +++ b/macros/latex/contrib/gene/pl/pl.dtx @@ -0,0 +1,1188 @@ +% ^^A -*-LaTeX-*- +%\iffalse +%<*pl> +%\fi +\def\filename{pl.doc} +\def\fileversion{3.0} +\def\filedate{1996/05/30} +\def\docversion{2.5} +\def\docdate{1995/11/28} +%\iffalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\typeout{%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% + Prolog Documentation in LaTeX. Version \fileversion\@spaces gene \filedate +%% +%% Purpose: +%% Style option for LaTeX to provide routines to document Prolog programs. +%% +%% Documentation: see seperate LaTeX document `pl.tex' +%% +%% Author: Gerd Neugebauer +%% Mainzer Str. 8 +%% 56321 Rhens (Germany) +%% Mail: gerd@informatik.uni-koblenz.de +%% +%% Copyright (C) 1995-1996 Gerd Neugebauer +%% +%% pl.doc is distributed in the hope that it will be useful, but WITHOUT +%% ANY WARRANTY. No author or distributor accepts responsibility to +%% anyone for the consequences of using it or for whether it serves any +%% particular purpose or works at all, unless he says so in writing. +%% +%% Everyone is granted permission to copy, modify and redistribute pl.doc, +%% provided this copyright notice is preserved and any modifications are +%% indicated. +%% +%% +%% This style is still under development and may be replaced with a new +%% version which provides an enhanced functionality. Any comments are +%% welcome but don't expect ANY help from my side. +%% +} +%\fi +% +% \title{Literate Programming:\\Prolog Documentation with \LaTeX} +% \author{Gerd Neugebauer\\ +% Mainzer Str. 8\\ +% 56321 Rhens (Germany)\\ +% Net: {\tt gerd@informatik.uni-koblenz.de}} +% +% \date{{\footnotesize This document describes pl version \fileversion\ +% as of \filedate.}} +% +% \maketitle +% +% ^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \DoNotIndex{\@ifnextchar,\box,\dimen,\divide,\newif,\noindent,\normalsize} +% \DoNotIndex{\obeyspaces,\other,\raggedright,\relax,\rule} +% \DoNotIndex{\sf,\smallskip,\textwidth,\tiny,\wd,\endgraf} +% \DoNotIndex{\empty,\fbox,\fboxrule,\fboxsep} +% \DoNotIndex{\ifdim,\medskip,\multiply,\message} +% \DoNotIndex{\par,\parbox,\parshape} +% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty} +% \DoNotIndex{\@flushglue,\@gobble,\@input} +% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle} +% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa} +% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue} +% \DoNotIndex{\@thanks,\@thefnmark,\@topnum} +% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin} +% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces} +% \DoNotIndex{\|,\~,\ ,\ProvidesPackage} +% \DoNotIndex{\advance,\aftergroup,\begingroup,\bgroup} +% \DoNotIndex{\mathcal,\csname,\def,\documentclass,\documentstyle} +% \DoNotIndex{\dospecials,\edef,\egroup} +% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist} +% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global} +% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn} +% \DoNotIndex{\ifcase} +% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item} +% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower} +% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing} +% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc} +% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut} +% \DoNotIndex{\strutbox} +% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt} +% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@} +% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim} +% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary} +% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle} +% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode} +% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip} +% \DoNotIndex{\nopagebreak} +% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle} +% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb} +% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar} +% \DoNotIndex{\[,\{,\},\]} +% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode} +% \DoNotIndex{\baselineskip,\begin,\tw@} +% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother} +% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined} +% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc} +% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar} +% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode} +% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf} +% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse} +% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault} +% \DoNotIndex{\bfdefault} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \CheckSum{468} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \setcounter{IndexColumns}{2} +% \def\PredicateIndex#1{} +% \MakeShortVerb{"} +% +% ^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \section*{Introduction} +% +% +% Inspired by the idea behind the web system I felt the need to have a +% system to write documented Prolog programs. But instead of having to +% transform the common source into program or documentation the central +% idea was to develop a method to have one common source which can be +% interpreted by a Prolog\footnote{C-Prolog, Quintus-Prolog, or ECLiPSe +% at that time.} system aswell as by \LaTeX. To achive this goal the +% \LaTeX\ commands are hidden from Prolog by enclosing them into comments. +% +% The C-Prolog allows two kinds of comments. The first kind starts with a +% "%" and ends at the end of the line. This is also a comment for +% \LaTeX. +% The other Prolog comment starts with "/*" and ends with "*/". +% This seemed to be the right way to hide the \LaTeX\ documentation +% commands from the Prolog interpreter. +% +% The only problem was to define a starting sequence to open the first +% comment. This sequence must be an executable Prolog command as well as +% a valid \LaTeX{} command. The first approach was to modify both --- the +% Prolog program and the \LaTeX\ style --- to find a common statement. The +% pre 2.0 versions of the pl style option took this decision. One +% problem came up when the author tried to incorporate the module system +% of Prolog. This system requires that the first command in a module is +% the declaration of the module name possibly together with the list of +% predicates to be exported. This restriction led to the approach taken +% in version 2.0 and later. In modules nearly no change has to be made. +% The module declaration is defined as a valid \LaTeX\ macro. +% +% +% \section{The \LaTeX\ Documentation Driver File} +% +% The \LaTeX\ main file ties together the whole documentation. This file +% should contain the "\documentclass" command together with the +% appropriate "\usepackage" or the "\documentsyle" command with the style +% option "pl".\smallskip +% +% \noindent +% \unitlength=\textwidth\advance\unitlength-65mm +% \begin{minipage}{\unitlength} +% \indent The only special command required in this file is the +% command "\PrologInput". This command inserts the Prolog file +% given as argument at the current position. The formatting directives +% described below are activated. +% +% The command "\PrologInput" may occur several times in this main +% file. it may be mixed with simple input or include +% commands. "\PrologInput" can be used nested, as long as the +% other requirements described in this document are fulfilled. +% \end{minipage} +% \hfill +% \begin{minipage}{58mm} +% {\small% +% "\documentclass[...]{...}"\\ +% "\usepackage{pl}"\\ +% "\begin{document}"\\ +% "..."\\ +% "\PrologInput{file1.pl}"\\ +% "\PrologInput{file2.pl}"\\ +% "..."\\ +% "\PrologInput{filen.pl}"\\ +% "..."\\ +% "\end{document}"} +% \end{minipage}\smallskip +% +% +% The commands meant for the Prolog files can also be used in a plain +% \LaTeX{} context. Nevertheless those commands have been developed +% with the application of documenting Prolog in mind. The contents of +% the Prolog files and the additional macros provided by pl will +% be described in the next sections. +% +% +% +% \section{The Prolog Files} +% +% \subsection{Starting Modules} +% +% Prolog files can come in two variants: either it is a Prolog module or +% a plain Prolog file. Modules are distinguished from files by a specific +% first Prolog statement. This module declaration can have the +% form\footnote{e.g. in Quintus-Prolog} +% +% {\it ":- module(" Name"," Exports ")."} +% +% Alternatively it may have the form +% +% {\it ":- module_interface(" Name ")."} +% +% These module declarations have to be the first Prolog instructions in +% the file. +% +% In addition to those Prolog instructions we need to use the rule +% that the terminating point (.) of the module declaration is +% followed immediately by \verb*+ /*+. Note the single space which is +% neccesary for the Prolog parser to work properly. +% +% Thus a Prolog module documented with pl starts e.g. with +% +% {\it ":- module\_interface(" Name "). /*"} +% +% Before this line there should be only Prolog comments starting with +% "%". These comments are also ignored by \TeX. Thus they do +% neither appear in the documentation nor are the evaluated by Prolog. +% +% +% \subsection{Starting Plain Files} +% +% Plain Prolog files are those files not starting with a module +% declaration. For technical reasons plain files can not start with code +% directly but requires a C-style comment at the beginning. The contents +% of this comment is typeset by \LaTeX. +% +% In generale this restriction seems to be too hard. It is always a good +% idea to start a file with some general remarks and comments. +% +% +% +% \subsection{Ending Prolog Files} +% +% The Prolog file should end with +% +% "\EndProlog*/" +% +% From the Prolog point of view the file consists now of the declaration +% of a module (or a dummy predicate). The rest is purely comment. From the +% \LaTeX\ point of view it contains two macros and nothing in +% between. Thus everything in between will be interpreted as \LaTeX\ input +% only. +% +% \subsection{Prolog Code} +% +% To include additional Prolog statements in this file enclose them in +% +% "\PL*/" +% +% "/*PL" +% +% This forces the Prolog system to interpret the code and the \LaTeX\ +% system to typeset it in a verbatim like environment. +% +% The Prolog code may contain every characters except the string +% "/*PL". For some reasons which are opaque to me spaces at the +% binning of a line of Prolog code are ignored. To force proper +% indentation you should use {\sc tab} characters at the beginning of the +% line. +% +% +% \subsection*{Options for the Code Layout} +% +% The options are implemented as macros. To change them use +% "\renewcommand". +% +% \begin{description} +% \item [\tt \char92 PrologModule]\ \\ +% Macro to typeset the module definition. In general this may be a +% sectioning command producing an appropriate title. It takes two +% arguments --- the two arguments of the "module" declaration. +% +% The default is "\section{{\tt #1}}" +% \item [\tt \char92 PrologFile]\ \\ +% Same as above but for non module files. +% +% The default is "\section{{\tt #1}}" +% \item [\tt \char92 PrologFont]\ \\ +% Macro to select the font used for printing the listing part. This +% should be a non-pro\-portional font. The default is +% "\small\tt". +% +% \item [\tt \char92 PrologListFont]\ \\ +% Macro to select the font used for printing the export list. The +% default is "\small\tt". +% +% \item [\tt \char92 PrologListIndent]\ \\ +% Macro to select the indentation of the export list. This should be a +% length. The default is "2em". +% +% \item [\tt \char92 PrologRuleWidth]\ \\ +% Macro to select the width of the rule to seperate Prolog code from +% text. This should be a length. The default is "0pt". +% +% \item [\tt \char92 PrologNumberFont]\ \\ +% Font to be used when typesetting line numbers. +% \end{description} +% +% The following flags can be set by simply including the commands in +% the \LaTeX{} part of the document. Since they are mainly of a +% global nature the preamble of the driver file would be a good place +% for them. +% +% \begin{description} +% \item [\tt \char92 PrologNumberLinestrue]\ \\ +% Turn on line numbering. +% \item [\tt \char92 PrologNumberLinesfalse]\ \\ +% Turn off line numbering. +% +% \item [\tt \char92 PrologDialect\char251{\em Dialect}\char253]\ \\ +% Declare the dialect of the used Prolog. This is mainly important to +% make the syntax of the modules known to pl. {\em Dialect}\/ can +% take one of the following values: {\tt eclipse}, {\tt quintus}, {\tt +% sixtus}, {\tt cprolog}, {\tt swiprolog}, {\tt sbprolog}, or {\tt +% binprolog}. +% \end{description} +% +% \section{Predicate Templates} +% +% Predicate templates provide a nice way to typeset a predicate head with +% some additional information. A usual predicate is characterized by the +% name/arity, arguments and the file it can be found in. Two boxes are +% used to contain this information. The right one contains the file name +% and the left one contains the predicate description. The box for the +% file name has a default width which will be enlarged if the file name +% doesn't fit into it. The predicate description if surrounded by a frame +% and formatted in the following way. If the predicate desciption fits in +% one line then it is typeset in one line. Otherwise the second and +% following lines are indented. This indentation tries to align beneath +% the first argument. If the predicate name is very long this might not be +% desirable. Thus the indentation has a maximal value which will not be +% exceeded. +% +% The \LaTeX\ part of the file contains the following template +% +% "\Predicate pred/1(arg)." +% +% Note that the ")." have {\em no}\/ space in between. +% +% \subsection*{Options} +% +% The options are implemented as macros. To change them use +% "\renewcommand". +% +% \begin{description} +% \item [\tt \char92 PredicateFont]\ \\ +% Macro containing the font changeing command for the predicate +% description. The default is "\normalsize\tt". +% +% \item [\tt \char92 PredicateSkip]\ \\ +% Macro containing the spacing before and after the predicate +% description. The default is "\smallskip". +% +% \item [\tt \char92 PredicateIndent]\ \\ +% Macro containing the maximal length of the indentation of the +% predicate description. The default is "2em". If this value +% is very large then the arguments are always aligned beneath the +% first one. +% +% \item [\tt \char92 PredicateFileFont]\ \\ +% Macro containing the font changeing command for the file name. The +% default is "\small\sf". +% +% \item [\tt \char92 PredicateFileWidth]\ \\ +% Macro containing the minimal width of the box containing the file +% name. The default is "5em". If this value is "0pt" then +% only the file name determines the width of the box. +% +% \item [\tt \char92 PredicateFileExtension]\ \\ +% Macro containing the extension of the prolog file. This text is +% typeset right after the file name stored in "\PrologFILE". The +% default is empty. +% \end{description} +% +% \begin{figure}[t] +% {\dimen255=\textwidth\advance\dimen255 by-1mm\divide\dimen255 150 +% \setlength{\unitlength}{\dimen255} +% \begin{picture}(150,52) +% \linethickness{.1pt} +% \put( 0, 0){\line(0,1){8}} +% \put( 0, 8){\line(1,0){150}} +% \put(150, 0){\line(0,1){8}} +% \put( 0, 0){\makebox(150,8){\bf Succeding Text}} +% \put( 75,12){\vector(0,1){4}} +% \put( 75,12){\vector(0,-1){4}} +% \put( 77,12){\makebox(0,0)[l]{\scriptsize\tt \char92 PredicateSkip \char92 par }} +% {\thicklines\put( 0,16){\framebox(110,20){\bf Predicate Description}}} +% \put(130,25){\framebox(20,4){\bf File}} +% \put(150,35){\makebox(0,0)[r]{\parbox[r]{60mm}{\raggedleft\scriptsize\tt +% \char92 PredicateFileFont\\% +% \char92 PrologFile\\% +% \char92 PredicateFileExtension}}} +% \put(1,17){% +% \begin{picture}(0,0) +% \put( 10, 2){\vector(1,0){10}} +% \put( 10, 2){\vector(-1,0){10}} +% \put( -1,-3){\makebox(0,0)[l]{\scriptsize\tt\char92 PredicateIndent}} +% \put( 20, 0){\line(1,0){87}} +% \put( 20, 0){\line(0,1){12}} +% \put( 0,12){\line(0,1){ 6}} +% \put( 0,12){\line(1,0){20}} +% \put( 0,18){\line(1,0){107}} +% \put(107, 0){\line(0,1){18}} +% \put( 2,16){\makebox(0,0)[l]{\scriptsize\tt \char92 PredicateFont}} +% \end{picture}} +% \put(130,18){\vector(1,0){20}} +% \put(130,18){\vector(-1,0){20}} +% \put(130,16){\makebox(0,0){\scriptsize\tt \char92 PredicateFileIndent}} +% +% \put(112,24){\vector(1,0){2}} +% \put(112,24){\vector(-1,0){2}} +% \put(112,22){\makebox(0,0)[l]{\scriptsize\tt \char92 PredicateFileSep}} +% +% \put( 0,44){\line(0,1){8}} +% \put( 0,44){\line(1,0){150}} +% \put(150,44){\line(0,1){8}} +% \put( 0,44){\makebox(150,8){\bf Preceding Text}} +% \put( 75,40){\vector(0,1){4}} +% \put( 75,40){\vector(0,-1){4}} +% \put( 77,40){\makebox(0,0)[l]{\scriptsize\tt \char92 PredicateSkip \char92 par }} +% \end{picture} +% } +% \caption{The {\tt \char92 Predicate} command} +% \end{figure} +% +% \def\PrologFILE{prolog} +% +% \noindent +% "\Predicate foo_bar/6(Argument1, Argument2, Argument3,"\\ +% " Argument4, Argument5, Argument6)." +% +% \Predicate foo_bar/6(Argument1, Argument2, Argument3, +% Argument4, Argument5, Argument6). +% \def\PrologFILE{very\_Long\_Prolog\_File} +% \Predicate foo_bar/6(Argument1, Argument2, Argument3, +% Argument4, Argument5, Argument6). +% +% \noindent +% "\Predicate this_is_a_very_long_predicate/5("\\ +% " Argument1, Argument2, Argument3, Argument4, Argument5)." +% +% \def\PrologFILE{prolog} +% \Predicate this_is_a_very_long_predicate/5( +% Argument1, Argument2, Argument3, Argument4, Argument5). +% +% +% \subsection{The Underscore} +% +% One thing which occurs very often in program listings is the underscore +% "_". The problem arises that \LaTeX\ uses the underscore only in +% math mode to denote subscripts. For the comands described above the +% "_" can be simply used as is. Beware, don't expect math mode +% subscript to work there. +% +% The macro "\WithUnderscore" is provided by pl to +% execute some commands where the underscore does have the meaning as +% plain character. +% +% Example: +% +% It can be highly desirable to protect the index. Otherwise any +% indexed predicate containing an underscore would wrack \LaTeX. This +% can be done with a construction like the following one: +% +% "\WithUnderscore{\printindex}" +% +% +% \subsection{Inline Code} +% The style option {\tt idtt} allows to typeset some text using the +% teletype font ("\tt"). The text has simply to be enclosed in "|". +% +% The same effect can be achieved with the command +% "\MakeShortVerb" defined in {\sf doc.sty}. To use this you +% have to add the style option {\tt doc} and place the following +% command in the preamble: +% +% "\MakeShortVerb{|}" +% +% Example: +% +% You type "|proc_1|" and you get {\tt proc\_1}. +% +% +% \section*{Bugs and Problems} +% +% +% \begin{itemize} +% \item The bugs and problems of earlier releases have been corrected. +% \item The documentation needs polishing. +% \end{itemize} +% +% +% \newpage +% \section*{A Sample} +% +% +% {\catcode`\%=14 \Listing{sample.pl}} +% \newpage +% \PrologInput{sample.pl} +% +% +% ^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \StopEventually{} +% ^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \newpage +% +% \section{The Implementation} +% +% \begin{macrocode} +\ifx\documentclass\relax \else + \ProvidesPackage{pl}[\filedate\space gene (\fileversion)] +\fi +% \end{macrocode} +% +% \subsection{Options and Defaults} +% +% First of all we define the macros containing the default values for +% certain options. The user may redefine them with "\renewcommand" to +% adapt them to the personal preferences. +% +% \begin{macrocode} +\def\PrologFont{\small\tt} +% \end{macrocode} +% The macro "\PrologFont" contains the font changing command executed +% to typeset the Prolog code in the verbatim-like environment. +% +% \begin{macrocode} +\def\PrologIndent{2em} +% \end{macrocode} +% The macro "\PrologIndent" contains the indentation of the Prolog +% code in the verbatim-like environment. +% +% \begin{macrocode} +\def\PrologNumberFont{\tiny\rm} +% \end{macrocode} +% The macro "\PrologNumberFont" contains the font changing command +% used to typeset the line numbers (if enabled) in the verbatim-like +% environment. +% +% \begin{macrocode} +\def\PrologRuleWidth{0pt} +% \end{macrocode} +% The macro "\PrologRuleWidth" contains the width of the rule +% seperating Prolog code and text. +% +% \begin{macrocode} +\def\PrologListFont{\small\tt} +% \end{macrocode} +% The macro "\PrologListFont" contains the font changing command +% to typeset a Prolog list (exports). +% +% \begin{macrocode} +\def\PrologListIndent{2em} +% \end{macrocode} +% The macro "\PrologListIndent" contains the indentation for a Prolog +% list (exports). +% +% \begin{macrocode} +\def\PrologModule#1#2{\section{The Module {\tt #1}}} +% \end{macrocode} +% The macro "\PrologModule" contains the command which is called at +% the beginning of a module. The first argument is the name of the +% module. The second argument is the list of exports. +% +% This macro is supposed to be redefined by the user with +% "\renewcommand". +% +% \begin{macrocode} +\def\PrologFile#1#2{\section{The File {\tt #1}}} +% \end{macrocode} +% The macro "\PrologFile" contains the command which is called at +% the beginning of a non-module Prolog file. The first argument is the name +% of the module. The second argument is usually empty. +% +% This macro is supposed to be redefined by the user with +% "\renewcommand". +% +% \begin{macrocode} +\def\PredicateFont{\tt} +% \end{macrocode} +% The macro "\PredicateFont" contains the font switching command +% used in "\Predicate" for the body of the predicate description. +% +% \begin{macrocode} +\def\PredicateFileFont{\small\sf} +% \end{macrocode} +% The macro "\PredicateFileFont" contains the font switching command +% used in "\Predicate" for the file name +% +% \begin{macrocode} +\def\PredicateSkip{\smallskip} +% \end{macrocode} +% The macro "\PredicateSkip" contains the skip command executed before +% and after "\Predicate". +% +% \begin{macrocode} +\def\PredicateIndent{5em} +% \end{macrocode} +% The macro "\PredicateIndent" contains length of the +% maximal indentation in the macro "\Predicate". +% +% \begin{macrocode} +\def\PredicateFileExtension{} +% \end{macrocode} +% The macro "\PredicateFileExtension" contains the text appended to +% file name in the "\Predicate" command. +% +% \begin{macrocode} +\def\PredicateFileWidth{5em} +% \end{macrocode} +% The macro "\PredicateFileWidth" contains the minimum width of the +% file name in the "\Predicate" command. Shorter file names are padded +% to this length. +% +% \begin{macrocode} +\def\PredicateFileSep{1em} +% \end{macrocode} +% The macro "\PredicateFileSep" contains the width of the +% separating space between the predicate description and the file name. +% +% \begin{macrocode} +\def\PredicateBoxSep{3pt} +% \end{macrocode} +% The macro "\PredicateBoxSep" contains the amount of space between +% the box and contents in the "\Predicate" command. This is similar to +% "\fboxsep" in \LaTeX. +% +% \begin{macrocode} +\def\PredicateBoxRule{0.5pt} +% \end{macrocode} +% The macro "\PredicateBoxRule" contains the line thickness of box in +% the "\Predicate" command. This is similar to "\fboxrule" in +% \LaTeX. +% +% \begin{macrocode} +\def\PredicateIndex#1{\index{#1}} +% \end{macrocode} +% The macro "\PredicateIndex" contains the command which is called to +% put a predicate into an index. The argument is the string to index. +% +% This macro may be redefined by the user with "\renewcommand". +% +% \begin{macrocode} +\newif\ifPrologNumberLines +% \end{macrocode} +% switch to enable line numbering +% +% +% +% \subsection{Internals} +% +% \begin{macrocode} +\def\PrologEXPORTS{} +% \end{macrocode} +% The macro "\PrologEXPORTS" contains the current list of exports. +% +% \begin{macrocode} +\def\PrologFILE{} +% \end{macrocode} +% The macro "\PrologFILE" contains the current module or file +% name. This is not supposed to be set by the user. Nevertheless +% there might be occasions where this is neccesary (e.g. in the +% documentation of this style option). +% +% +% \subsection{Configuration Commands} +% The different Prolog dialects have different ways to declare +% modules. Thus pl needs to know which dialect is currently used. This +% influences how "PrologInput" handles the first Prolog clause. +% +% \begin{macrocode} +\def\PrologDialect#1{% + \@ifundefined{PL@start@module@#1}% + {\message{*** Prolog dialect #1 is undefined. Ignored.}}% + {\gdef\PL@Dialect{#1}}} +\def\PL@Dialect{eclipse} +% \end{macrocode} +% The command "\PrologDialect" can be used to declare the Prolog +% dialect used. The value is stored in the macro "\PL@Dialect" for +% later use. This is only done if an appropriate macro to handle a module +% are defined. +% +% +% \begin{macrocode} +\gdef\PL@@delayed{} +% \end{macrocode} +% Keep some characters which were read in advance. +% +% +% +% \begin{macrocode} +\newcount\PL@line +% \end{macrocode} +% We allocate a new counter for the line number of Prolog code (if +% enabled). +% +% +% +% \subsection{Typesetting Prolog Code} +% +% Prolog code is typeset is a verbatim-like way. For this purpose a +% modified version of the verbatim environment from the \TeX\ book is +% used. For an explanation see pages 380--382 in the \TeX\ book. +% +% \begin{macrocode} +\gdef\PL@code@setup{\PrologFont\parskip=0ex\parindent=0pt + \ifx\PL@@delayed\empty\else% + \parbox{\PrologIndent}{% + \ifPrologNumberLines \PrologNumberFont \the\PL@line% + \global\advance\PL@line1 + \else\ \fi}\PL@@delayed% + \gdef\PL@@delayed{}\par + \fi% + \def\par{\leavevmode\egroup\box0\endgraf} + \def\do##1{\catcode`##1=12 }\dospecials + \obeyspaces + \obeylines +% \catcode`\`=\other + \catcode`\^^I=13 + \everypar{\parbox{\PrologIndent}{% + \ifPrologNumberLines \PrologNumberFont \the\PL@line% + \global\advance\PL@line1 + \fi + \hfill}\PL@code@startbox}} +% \end{macrocode} +% +% +% \begin{macrocode} +\def\PL@code@startbox{\setbox0=\hbox\bgroup} +% \end{macrocode} +% +% +% \begin{macrocode} +{\catcode`\^^I=13 + \gdef^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \setbox1=\hbox{\PrologFont\space}\dimen1=8\wd1 + \divide\dimen0 by\dimen1 + \multiply\dimen0 by\dimen1 % compute previous multiple of tab + \advance\dimen0 by\dimen1 % advance to next multiple of tab + \wd0=\dimen0 \box0 \PL@code@startbox}% +} +{\obeyspaces\global\let =\ } +% \end{macrocode} +% +% +% \begin{macrocode} +\def\PL*/{\PL@PL@init% + \begingroup + \PL@code@setup + \PL@doPL} +% \end{macrocode} +% +% +% "|" is temporary escape character to catch the end "/*PL" +% \begin{macrocode} +{\catcode`\|=0 \catcode`\\=12 + |obeylines|gdef|PL@doPL^^M#1/*PL{#1|endgroup|PL@PL@exit}} +% \end{macrocode} +% +% +% Initialization macro +% \begin{macrocode} +\def\PL@PL@init{% + \ifdim\PrologRuleWidth>0pt% + \par\noindent\rule{\textwidth}{\PrologRuleWidth}\par% + \else\medskip\par\fi} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\def\PL@PL@exit{% + \ifdim\PrologRuleWidth>0pt% + \vspace{-2ex}\noindent\rule{\textwidth}{\PrologRuleWidth}\par% + \else\smallskip\par\fi} +% \end{macrocode} +% +% +% +% +% Dirty hack. +% make : active to catch :- +% use a group to hide the changes +% \begin{macrocode} +\def\PL@INIT{\begingroup\catcode`:=13\catcode`/=13} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\def\PL@EXIT{\endgroup} +% \end{macrocode} +% +% +% +% we make : active and include the file +% \begin{macrocode} +\gdef\PrologInput{% + \begingroup + \catcode`\_=12 + \PL@Input +} +% \end{macrocode} +% +% +% \begin{macrocode} +\PL@INIT +\gdef\PL@Input#1{% + \gdef\PrologFILE{#1}% + \gdef\PrologMODULE{}% + \gdef\PrologEXPORTS{}% + \global\PL@line=1% + \endgroup + \PL@INIT% + \let:=\PL@COLON + \let/=\PL@SLASH + \input{#1}% + \gdef\PrologFILE{}% + \gdef\PrologMODULE{}% + \gdef\PrologEXPORTS{}% + } +\PL@EXIT +% \end{macrocode} +% +% +% +% \subsection{End a File of Prolog Code} +% +% At the end of a file there is a "*/" which terminates the last +% comment for Prolog. Those two characters are stripped away by the macro +% "\EndProlog". +% +% \begin{macrocode} +\def\EndProlog#1*/{} +% \end{macrocode} +% +% +% +% \subsection{Definition for Various File Types} +% +% \subsubsection{Defininitions for Non-Module Files} +% +% A file can start with "/*". This case is handled by making the +% "/" active and binding it to the command "\PL@SLASH". This +% command checks if the next character is a "*". In this case the +% catcodes of "/" and ":" can be restored to their defaults. This +% is done by "\PL@EXIT". +% +% Finally the underscore "_" is made active and +% "\PL@start@star" is called to do the rest. +% +% \begin{macrocode} +\def\PL@SLASH{\@ifnextchar*{% + \PL@EXIT + \PL@US@start + \PL@SLASH@STAR}{/}} +% \end{macrocode} +% +% +% +% +% +% \begin{macrocode} +\def\PL@SLASH@STAR*{% + \PrologFile{\PrologFILE}{}% + \PL@US@end} +% \end{macrocode} +% +% +% +% +% +% +% \begin{macrocode} +\def\PL@COLON{\@ifnextchar-{\PL@goal}{: }} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\def\PL@goal-{% + \PL@EXIT + \PL@US@start + \@ifnextchar m{\csname PL@start@module@\PL@Dialect\endcsname}% + {\@ifnextchar t{\PL@start@true}% + {\csname PL@start@file@\PL@Dialect\endcsname}}} +% \end{macrocode} +% +% +% \begin{macrocode} +\def\PL@start@true true. /*{% + \PrologFile{\PrologFILE}{}% + \PL@US@end} +% \end{macrocode} +% +% +% +% +% +% +% \subsubsection{Defininitions for ECLiPSe-Prolog} +% +% The beginning of a module file in eclipse can be in one of the following +% forms: +% +% \begin{description} +% \item[:- module\_interface({\em Module})] +% \item[:- module({\em Module})] +% \end{description} +% +% We strip away the actual predicate name getting the rest in the macro +% parameter \#1. The complete module declaration is stored in the macro +% "\PL@delayed" to be inserted later. +% \begin{macrocode} +\def\PL@start@module@eclipse module#1(#2). /*{% + \global\PL@line=1 + \gdef\PL@@delayed{:- module#1(#2).} + \gdef\PrologMODULE{#2}% + \catcode`\,=13 % + \PrologModule{\PrologFILE}{}% + \PL@US@end} +% \end{macrocode} +% +% +% +% \subsubsection{Definitions for Quintus-Prolog} +% +% The beginning of a module file in Quintus is in the following form: +% +% \begin{description} +% \item[:- module({\em Module},{\em Exports})] \ +% \end{description} +% +% +% \begin{macrocode} +\def\PL@start@module@quintus module(#1,{% + \global\PL@line=1 + \gdef\PrologFILE{#1}% + \catcode`\,=13 % + \PL@start@module@quintus@} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\def\PL@start@module@quintus@[#1]). /*{% + \gdef\PrologEXPORTS{#1}% + \PrologModule{\PrologFILE}{#1}% + \PL@US@end} +% \end{macrocode} +% +% \subsubsection{Definitions for C-Prolog} +% +% I don't know if C-Prolog has a module system nowadays. The last time I +% checked it had none. If nobody has a better idea I use Quintus Prolog +% syntax in this case even it does not make any sense. +% +% \begin{macrocode} +\let\PL@start@module@cprolog=\PL@start@module@quintus +% \end{macrocode} +% +% \subsubsection{Definitions for Sixtus-Prolog} +% +% I don't know what's used in Sixtus-Prolog. So I use the same value as for +% eclipse. +% +% \begin{macrocode} +\let\PL@start@module@sixtus=\PL@start@module@eclipse +% \end{macrocode} +% +% \subsubsection{Definitions for SWI-Prolog} +% +% Fortunately the module system of SWI-Prolog is compatible with the module +% system of Quintus Prolog. So we just use the definition here again. +% +% \begin{macrocode} +\let\PL@start@module@swiprolog=\PL@start@module@quintus +% \end{macrocode} +% +% \subsubsection{Definitions for SB-Prolog} +% +% I don't know if C-Prolog has a module system nowadays. The last time I +% checked it had none. If nobody has a better idea I use Quintus Prolog +% syntax in this case even it does not make any sense. +% +% \begin{macrocode} +\let\PL@start@module@sbprolog=\PL@start@module@quintus +% \end{macrocode} +% +% \subsubsection{Definitions for bin-Prolog} +% +% I don't know what's used in bin-Prolog. So I use the same value as for +% eclipse. +% +% \begin{macrocode} +\let\PL@start@module@binprolog=\PL@start@module@eclipse +% \end{macrocode} +% +% +% +% +% \subsection{Typeset a Boxed Predicate Description} +% +% The first step is to protect the underscores in the predicate names and +% the arguments. +% +% +% \begin{macrocode} +\def\Predicate{\PL@US@start\Predicate@} +% \end{macrocode} +% +% The syntax is oriented towards Prolog syntax. The name and the arity of +% the predicate may not contain "/" or "(". +% +% \begin{macrocode} +\def\Predicate@#1/#2(#3).{% + \PredicateSkip\par\noindent% + {\setbox1=\hbox{\PredicateFileFont \PrologFILE\PredicateFileExtension}% + \fboxrule=\PredicateBoxRule% + \fboxsep=\PredicateBoxSep% + \fbox{\PredicateIndex{#1/#2}% + \dimen255=\wd1 + \ifdim\dimen255<\PredicateFileWidth \dimen255=\PredicateFileWidth \fi + \dimen255=-\dimen255 + \advance\dimen255 by-\PredicateFileSep + \advance\dimen255 by \textwidth + \parbox{\dimen255}{\raggedright + \setbox0=\hbox{\normalsize\PredicateFont #1(} + \dimen254=\wd0 + + \ifdim\dimen254>\PredicateIndent \dimen254=\PredicateIndent\fi + \dimen253=\dimen255 \advance\dimen253 by -\dimen254 + \parshape=2 0mm \dimen255 \dimen254 \dimen253 + \normalsize\PredicateFont #1\ifx\@empty#3 \else(#3)\fi + }}% + \hfill \box1\PredicateSkip\par + }\PL@US@end} +% \end{macrocode} +% +% +% +% +% +% +% +% \subsection{Typeset a List of Prolog Predicates} +% +% +% \begin{macrocode} +\def\PrologList{\par\noindent% + \PL@US@start + \PrologListFont + \catcode`\,=13% + \parindent=\PrologListIndent\parskip=0pt\par + \PL@List} +% \end{macrocode} +% +% +% +% \begin{macrocode} +{\catcode`\,=13 +\gdef\PL@List[#1]{% + \def,{\par}% + #1 + \PL@US@end\par} +} +% \end{macrocode} +% +% +% \begin{macrocode} +\def\PrologListEXPORTS{\PrologList[\PrologEXPORTS]} +% \end{macrocode} +% +% +% +% +% \subsection{Special Treatment of the Underscore} +% +% We define two macros to activate and deactivate the underscore +% respectively. Those two macros have to come in pairs always. The first +% one opens a group to protect the changes. The closing macro simply closes +% the group, thus undoing the effects of the first macro. +% +% \begin{macrocode} +\def\PL@US@start{\begingroup\catcode`\_=13 } +\def\PL@US@end{\endgroup } +% \end{macrocode} +% +% +% +% \begin{macrocode} +\def\WithUnderscore{\begingroup\catcode`\_=13 \With@Underscore} +\def\With@Underscore#1{#1\endgroup} +% \end{macrocode} +% +% \subsection{Misc} +% +% A spin off product of this style file is a macro to include a file +% verbosely. Such a macro is also provided by the verbatim package and +% others. Nevertheless I have left it in. +% +% \begin{macrocode} +\def\Listing#1{\par\begingroup% + \PL@line=1% + \PL@code@setup% + \input{#1}% + \endgroup} +% \end{macrocode} +% +%\iffalse +%</pl> +%<*pcode> +%\fi +% \section{Backward Compatibility Mode: {\tt pcode.sty}} +% +% For backward compatibility some macros are defined in a style file under +% the old name {\tt pcode.sty}. The new style file has to be acessible +% under the new name {\tt pl.sty}. This file is loaded before some macros +% are defined. +% +% \begin{macrocode} +\ifx\PrologFont\relax\else\input pl.sty\fi +% \end{macrocode} +% +% In former versions mainly the Prolog dialect Quintus has been +% supported. Thus a boolean was enough to tell apart the dialects Quintus +% and eclipse --- which came next. This is emulated with the next two +% macros. +% +% \begin{macrocode} +\def\PrologQuintustrue{\PrologDialect{quintus}} +\def\PrologQuintusfalse{\PrologDialect{eclipse}} +% \end{macrocode} +% +% The macro "\WithUnderscore" was named "\WithActiveUnderscore" +% in a former version of {\tt pcode.sty}. The {\em Active} part of the name +% was missleading for users. Thus it has been removed. The old name is made +% an alias for the new one. +% +% \begin{macrocode} +\let\WithActiveUnderscore=\WithUnderscore +% \end{macrocode} +% +% In an ancient version of {\tt pcode.sty} the macro "\EndProlog" was +% named "\StopProlog". Thus we make an alias for the old name. +% +% \begin{macrocode} +\let\StopProlog=\EndProlog +% \end{macrocode} +% +% Make "\PL@INIT" usable for the user as well. I don't know where +% this might be used. It has been in the old version, so I put it into the +% compatibility mode. +% +% \begin{macrocode} +\let\PrologInit=\PL@INIT +% \end{macrocode} +% +%\iffalse +%</pcode> +%\fi +% \Finale +% +\endinput diff --git a/macros/latex/contrib/gene/pl/pl.ins b/macros/latex/contrib/gene/pl/pl.ins new file mode 100644 index 0000000000..4b1aa60b07 --- /dev/null +++ b/macros/latex/contrib/gene/pl/pl.ins @@ -0,0 +1,6 @@ + +\def\batchfile{pl.ins} +\input docstrip.tex + +\generateFile{pl.sty}{f}{\from{pl.dtx}{pl}} +\generateFile{pcode.sty}{f}{\from{pl.dtx}{pcode}} diff --git a/macros/latex/contrib/gene/pl/pl.pdf b/macros/latex/contrib/gene/pl/pl.pdf Binary files differnew file mode 100644 index 0000000000..54a807060b --- /dev/null +++ b/macros/latex/contrib/gene/pl/pl.pdf diff --git a/macros/latex/contrib/gene/pl/pl.tex b/macros/latex/contrib/gene/pl/pl.tex new file mode 100644 index 0000000000..632d7a370d --- /dev/null +++ b/macros/latex/contrib/gene/pl/pl.tex @@ -0,0 +1,31 @@ +%%***************************************************************************** +%% $Id: pl.tex,v 3.0 1994/11/07 11:24:24 gerd Exp gerd $ +%%***************************************************************************** +%% Author: Gerd Neugebauer +%%----------------------------------------------------------------------------- + +\ifx\undefined\documentclass + \documentstyle[11pt,pl]{article} + \def\NeedsTeXFormat#1{} + \def\ProvidesPackage#1[#2]{} + \def\IfFileExists#1#2#3{#2} + \def\RequirePackage#1{\input #1.sty} + \def\rmfamily{\rm} + \def\ttfamily{\tt} + \def\bfseries{\bf} + \def\usepackage#1{\makeatletter\input{#1.sty}\makeatother} +\else + \documentclass[11pt]{article} +\fi + +\usepackage{doc} +\usepackage{pl} + +\makeatletter\input{pl.cfg}\makeatother + +\CodelineIndex + +\begin{document} +\DocInput{pl.dtx} +\WithUnderscore{\PrintIndex} +\end{document} diff --git a/macros/latex/contrib/gene/pl/sample.pl b/macros/latex/contrib/gene/pl/sample.pl new file mode 100644 index 0000000000..bbd94d15d7 --- /dev/null +++ b/macros/latex/contrib/gene/pl/sample.pl @@ -0,0 +1,40 @@ +%%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%^^A This is a sample file to demonstrate the use of the \LaTeX style option +%%^^A pl.sty. +%%^^A +%%^^A The ^^A is just used to make it printable with the documentation. +%%^^A doc.sty insists on it. Otherwise a single % would have been enough. +%%^^A +%%^^A written by gene 11/94 +%%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +:- module(sample). /* + +This is a dummy module to show the possibilities of the \LaTeX{} style +option pl. +We define a predicate. It looks like + +\Predicate select/3(Member, List, Rest). + +This predicate describes the relation of the three arguments which fulfill +$\mbox{\it Member}\in\mbox{\it List}$\/ and $\mbox{\it Rest}=\mbox{\it +List}\backslash\mbox{\it Member}$. + +And here comes the implementation: +\PL*/ +select(Member,[Member|Rest],Rest). +select(Member,[Head|List],[Head|Rest]) :- + select(Member,List,Rest). +/*PL + +\Predicate in/2(Member, List). + +This predicate is a reimplementation of the predicate \verb|member/2| +using the \verb|select/3| predicate. + +\PL*/ +in(Member,List) :- + select(Member,List,_). +/*PL +Now we are done with the example. +\EndProlog*/ diff --git a/macros/latex/contrib/gene/productbox/Makefile b/macros/latex/contrib/gene/productbox/Makefile new file mode 100644 index 0000000000..e92f9a8414 --- /dev/null +++ b/macros/latex/contrib/gene/productbox/Makefile @@ -0,0 +1,54 @@ +#****************************************************************************** +#* $Id: Makefile 8333 2010-12-29 19:58:06Z gene $ +#****************************************************************************** +#* Author: Gerd Neugebauer +#*============================================================================= + +DISTFILES = productbox.ins \ + productbox.dtx \ + productbox.bib \ + README \ + Makefile \ + productbox.pdf + +all: productbox.pdf + +%.pdf: %.dtx productbox.sty %.bbl %.ind %.gls + pdflatex -interaction=batchmode -draftmode $*.dtx + pdflatex -interaction=batchmode $*.dtx + ${RM} $*.out + +%.sty: %.dtx *.ins + rm -f $*.sty + tex $*.ins + +%.bbl: %.aux *.bib + bibtex $* + +%.ind: %.idx + makeindex -s gind $*.idx + +%.idx: %.dtx + pdflatex -draftmode $*.dtx + +%.aux: %.dtx + pdflatex -draftmode $*.dtx + +%.gls: %.glo + makeindex -s gglo -o $*.gls $*.glo + +%.glo: %.dtx + pdflatex -draftmode $*.dtx + +#------------------------------------------------------------------------------ + +productbox.tgz dist: productbox.pdf + tar -cvzf productbox.tgz ${DISTFILES} + +clean: + ${RM} productbox.aux productbox.ilg productbox.idx productbox.log productbox.toc productbox.glo productbox.out *~ + +distclean: clean + ${RM} productbox.sty productbox.pdf + +# diff --git a/macros/latex/contrib/gene/productbox/README b/macros/latex/contrib/gene/productbox/README new file mode 100644 index 0000000000..08179325ca --- /dev/null +++ b/macros/latex/contrib/gene/productbox/README @@ -0,0 +1,32 @@ +Purpose: + productbox.dtx provides a style file for typesetting a + three-dimensional product box. This product box can be rendered + as it is standing on a surface and some light is shed onto it. + Alternatively it can be typeset as a wireframe to be cut out + and glued together. This will lead to a physical product box. + +Documentation: + The documentation can be generated from the original file + productbox.dtx with the doc style/package. LaTeX the file + productbox.dtx to get the full documentation in pdf format. + +Prerequisite: + This package needs PGF and TikZ to be present at least in + version 2.0. + +Author: Gerd Neugebauer + Im Lerchelsbhl 5 + 64521 Gro-Gerau + gene@gerd-neugebauer.de + +Copyright (C) 2010 Gerd Neugebauer + + productbox.dtx is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY. No author or distributor accepts + responsibility to anyone for the consequences of using it or for + whether it serves any particular purpose or works at all, unless + he says so in writing. + + Everyone is granted permission to copy, modify and redistribute + productbox.dtx, provided this copyright notice is preserved and + any modifications are indicated. diff --git a/macros/latex/contrib/gene/productbox/productbox.bib b/macros/latex/contrib/gene/productbox/productbox.bib new file mode 100644 index 0000000000..3bd37308a1 --- /dev/null +++ b/macros/latex/contrib/gene/productbox/productbox.bib @@ -0,0 +1,19 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% $Id: productbox.bib,v 0.00 2010/12/26 22:09:16 gene Exp $ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +@Manual{tikz-manual, + title = {Ti{\it k}Z \& PGF: Manual for Version 2.0}, + author = {Till Tantau}, + year = 2008, + month = feb, + note = {\texttt{http://sourceforge.net/projects/pgf}} +} + +@Manual{geormetry-manual, + title = {The {\tt geometry} package}, + author = {Hideo Umeki}, + year = 2007, + month = jul, + note = {} +} diff --git a/macros/latex/contrib/gene/productbox/productbox.dtx b/macros/latex/contrib/gene/productbox/productbox.dtx new file mode 100644 index 0000000000..b5320bbbe3 --- /dev/null +++ b/macros/latex/contrib/gene/productbox/productbox.dtx @@ -0,0 +1,2113 @@ +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%^^A $Id: productbox.dtx 8333 2010-12-29 19:58:06Z gene $ +%%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\iffalse +%% Purpose: +%% productbox.dtx provides a style file for typesetting a +%% three-dimensional product box. This product box can be rendered +%% as it is standing on a surface and some light is shed onto it. +%% Alternatively it can be typeset as a wireframe to be cut out +%% and glued together. This will lead to a physical product box. +%% +%% Documentation: +%% The documentation can be generated from the original file +%% productbox.dtx with the doc style/package. LaTeX the file +%% productbox.dtx to get the full documentation in pdf format. +%% +%% Prerequisite: +%% This package needs TikZ to be present at least in version 2.0. +%% +%% Author: Gerd Neugebauer +%% Im Lerchelsb\"ohl 5 +%% 64521 Gro\ss-Gerau +%% Mail: gene@gerd-neugebauer.de +%% +%% Copyright (C) 2010 Gerd Neugebauer +%% +%% productbox.dtx is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY. No author or distributor accepts +%% responsibility to anyone for the consequences of using it or for +%% whether it serves any particular purpose or works at all, unless +%% he says so in writing. +%% +%% Everyone is granted permission to copy, modify and redistribute +%% productbox.dtx, provided this copyright notice is preserved and +%% any modifications are indicated. +%% +%\fi +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \title{A \LaTeX\ Style for +% Typesetting a Three-Dimensional Product Box\thanks{This file +% documents \filename\ version \fileversion\ +% (from revision \filerevision) as of \filedate.}} +% \author{Gerd Neugebauer\\\small +% Im Lerchelsb\"ohl 5\\\small +% 64521 Gro\ss-Gerau (Germany)\\\small +% Email: \texttt{\href{mailto:gene@gerd-neugebauer.de}{gene@gerd-neugebauer.de}}} +% \date{{\footnotesize Documentation date: \filedate}} +% \hypersetup{pdftitle=A LaTeX Style for Typesetting a Three-Dimensional Product Box} +% \hypersetup{pdfauthor=Gerd Neugebauer} +% \hypersetup{pdfsubject=\filename\ version \fileversion\ as of \filedate} +% \maketitle +% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \changes{1.0}{2010/12/20}{First public release.} +% \changes{1.1}{2010/12/23}{Simplified user interface added.} +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \DoNotIndex{\ ,\",\',\.,\[,\\,\],\^,\`,\~,\@,\@dottedtocline} +% \DoNotIndex{\@gobble,\@gobbletwo,\@ifnextchar,\@ifstar} +% \DoNotIndex{\@ifundefined,\@namedef,\@nameuse,\@tempdima,\@undefined} +% \DoNotIndex{\CurrentOption,\DeclareOption,\LARGE,\LaTeX,\Large} +% \DoNotIndex{\InputIfFileExists,\EnableCrossrefs,\DocInput} +% \DoNotIndex{\DeleteShortVerb,\CodelineIndex,\MacroFont} +% \DoNotIndex{\RecordChanges,\ProvidesPackage,\NeedsTeXFormat} +% \DoNotIndex{\LoadClass,\OptionNotUsed,\PassOptionsToClass} +% \DoNotIndex{\ProcessOptions,\ProvidesClass,\RequirePackage,\TeX} +% \DoNotIndex{\addcontentsline,\advance} +% \DoNotIndex{\begin,\begingroup,\bf,\bgroup,\egroup} +% \DoNotIndex{\bigskip,\box,\clearpage,\color,\csname} +% \DoNotIndex{\def,\definecolor,\dimen,\divide,\documentclass,\dp} +% \DoNotIndex{\else,\empty,\end,\endcsname,\endgroup,\endinput} +% \DoNotIndex{\expandafter,\fbox,\fi,\framebox} +% \DoNotIndex{\futurelet,\gdef,\global,\gobble,\hbox,\hfil} +% \DoNotIndex{\hfill,\hrule,\hskip,\hspace,\hss,\huge} +% \DoNotIndex{\ifdim,\ifx,\ignorespaces,\immediate,\index,\it} +% \DoNotIndex{\kern,\large,\let,\long,\lower} +% \DoNotIndex{\makebox,\makeindex,\markboth,\mbox,\medskip} +% \DoNotIndex{\newblock,\newcommand,\newcount,\newenvironment,\newfont} +% \DoNotIndex{\newif,\newpage,\nobreak,\noindent,\normalsize,\null} +% \DoNotIndex{\or,\pagestyle,\par,\paragraph,\parbox} +% \DoNotIndex{\parfillskip,\parindent,\parsep,\parskip,\partopsep} +% \DoNotIndex{\relax,\renewcommand,\renewenvironment,\rm,\rule} +% \DoNotIndex{\sbox,\sc,\setcounter,\settowidth,\sf,\sfcode,\sl} +% \DoNotIndex{\small,\space,\string,\symbol} +% \DoNotIndex{\the,\thepage,\thispagestyle} +% \DoNotIndex{\topmargin,\topsep,\tt,\typeout} +% \DoNotIndex{\unitlength,\usecounter,\varepsilon,\vbox} +% \DoNotIndex{\vfill,\vsize,\vskip,\vspace,\vss,\xdef} +% \DoNotIndex{\usetikzlibrary,\usepackage,\tikzfading,\setkeys} +% \DoNotIndex{\setbox,\scalebox} +% \DoNotIndex{\newbox,\ignorespacesafterend,\foreach,\filldraw} +% \DoNotIndex{\fill,\errmessage,\draw,\define@key,\copy,\clip} +% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \CheckSum{1028} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%^^A%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \newcommand\TikZ{Ti\textit{k}Z} +% +% \begin{abstract} +% The package \texttt{productbox} provides a style file for +% typesetting a three-dimensional product box. This product box +% can be rendered as it is standing on a surface and some light +% is shed onto it. Alternatively it can be typeset as a wireframe +% to be cut out and glued together. This will lead to a physical +% product box. +% \end{abstract} +% +% \begin{center}% +% \def\PB(#1,#2)#3{ +% \draw[xshift=-.2mm,yshift=.2mm] (#1,#2) node[white,opacity=.9]{#3}; +% \draw[xshift=.2mm,yshift=-.2mm] (#1,#2) node[black,opacity=.9]{#3}; +% \draw (#1,#2) node[blue]{#3}; +% }% +% \begin{ProductBox}[mirror=true,flare=true,scale=.6] +% \begin{Front} +% \shade [top color=yellow!20!red,bottom color=yellow!80!red] +% rectangle (88mm,100mm); +% \PB(44mm,85mm){\Huge\bf Product Box} +% \draw (77mm,90mm) node[circle,ball color=white,rotate=330]{\small\bf\fileversion}; +% \draw (44mm,75mm) node{A \LaTeX\ package for just another kind of boxes}; +% +% \foreach \x in {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} { +% \count0=\x \multiply\count0 4 +% \draw [red,line width=.2mm] +% (0mm,0 mm) .. controls (88mm,\the\count0 mm) and (\x mm,66mm) .. +% (88mm,\the\count0 mm); +% \draw [xshift=.4mm,white,line width=.2mm,opacity=.5] +% (0mm,0 mm) .. controls (88mm,\the\count0 mm) and (\x mm,66mm) .. +% (88mm,\the\count0 mm); +% } +% +% \clip (0mm,0mm) .. controls (88mm,64mm) and (16mm,66mm) .. +% (88mm,64mm) -- (88mm,100mm) -- (0mm,100mm) -- cycle; +% \draw (4mm,66mm) node [white!30!black,anchor=north west] { +% \begin{minipage}{160mm}\tt\tiny\raggedright +% |\usepackage{productbox}|\\ +% | |\\ +% | |\\ +% |\begin{ProductBox}[scale=.8]|\\ +% | \begin{Front}|\\ +% | \shade [top color=yellow!20!red,bottom color=yellow!80!red]|\\ +% | rectangle (88mm,100mm);|\\ +% | \PB(44mm,85mm){\Huge\bf Product Box}|\\ +% | \draw (77mm,90mm) node[circle,ball color=white]{\small\bf\fileversion};|\\ +% | \draw (44mm,75mm) node{A \LaTeX\ package for just another kind of boxes};|\\ +% ||\\ +% | \foreach \x in {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} {|\\ +% | \count0=\x \multiply\count0 4|\\ +% | \draw [red,line width=.2mm]|\\ +% | (0mm,0 mm) .. controls (88mm,\the\count0 mm) and (\x mm,66mm) ..|\\ +% | (88mm,\the\count0 mm);|\\ +% | \draw [xshift=.4mm,white,line width=.2mm,opacity=.5]|\\ +% | (0mm,0 mm) .. controls (88mm,\the\count0 mm) and (\x mm,66mm) ..|\\ +% | (88mm,\the\count0 mm);|\\ +% | }|\\ +% | \clip (0mm,0mm) .. controls (88mm,64mm) and (16mm,66mm) ..|\\ +% | (88mm,64mm) -- (88mm,100mm) -- (0mm,100mm) -- cycle;|\\ +% | \end{Front}|\\ +% | \begin{Top}|\\ +% | \shade [outer color=yellow!20!red,inner color=yellow!80!red]|\\ +% | rectangle (88mm,30mm);|\\ +% | \PB(44mm,15mm){\huge\bf Product Box}|\\ +% | \draw (77mm,20mm)|\\ +% | node[circle,ball color=white,rotate=330]{\small\bf\fileversion};|\\ +% | \end{Top}|\\ +% \end{minipage}}; +% \end{Front} +% \begin{Top} +% \shade [outer color=yellow!20!red,inner color=yellow!80!red] +% rectangle (88mm,30mm); +% \PB(44mm,15mm){\huge\bf Product Box} +% \draw (77mm,20mm) +% node[circle,ball color=white,rotate=330]{\small\bf\fileversion}; +% \end{Top} +% \begin{Bottom} +% \shade [outer color=yellow!20!red,inner color=yellow!80!red] +% rectangle (88mm,30mm); +% \end{Bottom} +% \begin{Left} +% \fill [top color=yellow!20!red,bottom color=yellow!80!red] +% rectangle (30mm,100mm); +% \PB(15mm,90mm){ +% \begin{minipage}{25mm}\centering +% \Large\bf Product Box +% \end{minipage}} +% \draw (15mm,25mm) node { +% \begin{minipage}{25mm}\sf\tiny\raggedright\parskip=.75ex +% Copyright (C) 2010 Gerd Neugebauer +% +% productbox.dtx is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY. No author or distributor accepts +% responsibility to anyone for the consequences of using it or for +% whether it serves any particular purpose or works at all, unless +% he says so in writing. +% +% Everyone is granted permission to copy, modify and redistribute +% productbox.dtx, provided this copyright notice is preserved and +% any modifications are indicated. +% \end{minipage}}; +% \end{Left} +% \begin{Right} +% \fill [top color=yellow!20!red,bottom color=yellow!80!red] +% rectangle (30mm,100mm); +% \PB(15mm,90mm){ +% \begin{minipage}{25mm}\centering +% \Large\bf Product Box +% \end{minipage}} +% \end{Right} +% \end{ProductBox} +% \end{center} +% +% \newpage +% \tableofcontents +% \newpage +% +% \section{Introduction} +% +% Humans are tied to the physical world. Even in the age of +% software it is desirable to have a physical representation for +% it. In the commercial world the software is sold in product boxes +% containing a CD or DVD and printed documentation. +% +% But even for open source software having a product box provides a +% means to associate a physical object with the more or less +% virtual entity ``software''. +% +% There are many programs around devoted to producing layouts for +% product boxes. Each graphics program can be used for this purpose +% as well. Nevertheless the integration of material from the \TeX\ +% world is not that easy. +% +% The \LaTeX\ package |productbox| is an attempt to use the +% possibilities for \LaTeX\ and some packages to provide a means +% for typesetting the faces of a product box and assemble them into +% a three-dimensional image. +% +% Note that this ``image'' is in fact a \textsc{pdf} object. It can +% be scaled without loss of quality\footnote{unless some pixel +% images have been included}. It is also possible to extract +% the text from the product box by cut and paste in an appropriate +% \textsc{pdf} reader. +% +% +% \section{The User Interface} +% +% The \LaTeX\ style |productbox| is based on \TikZ{} at +% \cite{tikz-manual} least in version~2.0. It is best used with a +% \LaTeX\ variant which is able to produce \textsc{pdf}. If no +% proper tool chain is used then some of the effects should not be +% used. +% +% \DescribeEnv{ProductBox} +% The environment |ProductBox| provides the central means for +% producing a product box. The contents is used to define the +% appearance of the faces. Finally the selected type of output is +% produced. +% +% The content of the environment consists mainly of the definition +% of the six faces. Not all of them need to be defined. If one face +% is not defined then it appears as an empty rectangle of white +% color. +% +% Thus you usually want to define the faces. Two approaches are +% provided to define the content of the faces. The simplified +% interface does not really require any knowledge of the underlying +% \TikZ{} package. Just some knowledge of \LaTeX\ is sufficient. +% The extended interface opens the full power to the user. Both +% interface types can be freely intermixed. The tow kinds of +% interfaces are described in section~\ref{sec:simplified} +% and~\ref{sec:extended}. +% +% The environment |ProductBox| can be controlled with a number of +% optional parameters. Those parameters are described in +% section~\ref{sec:options}. +% +% +% \subsection{The Simplified User Interface}\label{sec:simplified} +% +% The simplified user interface is meant for someone not familiar +% with \TikZ. It encapsulates nearly anything and relies on just +% some basic \LaTeX\ experience. As a downside the functionality is +% restricted. Any fancy artwork on the box background can hardly be +% achieved. +% +% The following example shows a complete -- even rather useless -- +% definition of a product box with the simplified user interface. +% +% \noindent +% {\advance\textwidth-\fboxsep \advance\textwidth-\fboxsep +% \advance\textwidth-\fboxrule \advance\textwidth-\fboxrule +% \setbox127\hbox\bgroup\begin{minipage}{\textwidth}\footnotesize +% |\begin{ProductBox}|\\ +% | \begin{FrontFace}[bottom color=white!30!blue,top color=white]|\\ +% | \Huge Product Box|\\ +% | \end{FrontFace}|\\ +% | \begin{BackFace}[top color=yellow!30!red,bottom color=white]|\\ +% | \large Back Face|\\ +% | \end{BackFace}|\\ +% | \begin{TopFace}[outer color=white!30!red,inner color=white]|\\ +% | \large Top Face|\\ +% | \end{TopFace}|\\ +% | \begin{BottomFace}[outer color=red,inner color=black]|\\ +% | \large Bottom Face|\\ +% | \end{BottomFace}|\\ +% | \begin{LeftFace}[left color=green,right color=yellow]|\\ +% | \large Left Face|\\ +% | \end{LeftFace}|\\ +% | \begin{RightFace}[left color=white,right color=black]|\\ +% | \large Right Face|\\ +% | \end{RightFace}|\\ +% |\end{ProductBox}| +% \end{minipage}\egroup +% \fcolorbox{red!30!black}{yellow!30!white}{\box127}} +% +% \newcommand\simpleSample[1]{% +% \begin{ProductBox}[scale=.25,#1] +% \begin{FrontFace}[bottom color=white!30!blue,top color=white] +% \Huge Product Box +% \end{FrontFace} +% \begin{BackFace}[top color=yellow!30!red,bottom color=white] +% \large Back Face +% \end{BackFace} +% \begin{TopFace}[outer color=white!30!red,inner color=white] +% \large Top Face +% \end{TopFace} +% \begin{BottomFace}[outer color=red,inner color=black] +% \large Bottom Face +% \end{BottomFace} +% \begin{LeftFace}[left color=green,right color=yellow] +% \large Left Face +% \end{LeftFace} +% \begin{RightFace}[left color=white,right color=black] +% \large Right Face +% \end{RightFace} +% \end{ProductBox}% +% } +% +% This code renders as +% +% \begin{center}\simpleSample{}\end{center} +% \newcommand\SampleEnv[1]{\noindent\par +% \fcolorbox{red!30!black}{yellow!30!white}{\begin{minipage}[b]{.98\textwidth}\footnotesize\tt +% \textcolor{blue}{\char92begin}\char123#1\char125\\ +% \hspace*{2em}...\\ +% \textcolor{blue}{\char92end}\char123#1\char125 +% \end{minipage}}\par} +% +% The content of the environment |ProductBox| is simply evaluated. +% It can contain any code you like. Useful for the production of a +% product box are some inner environments. They are called +% |FrontFace|, |BackFace|, |LeftFace|, |RightFace|, |TopFace|, and +% |BottomFace|. They are defined inside the main environment +% only. Those environments can be used to specify the contents of +% the respective faces of the box. +% +% Note that in the three-dimensional rendering will show at most +% three of the faces. It does not hurt to define all of them, even +% if they are not shown at all. +% +% \DescribeEnv{FrontFace} +% The environment |FrontFace| is used to define the content of +% the font face. The environment processes its contents inside a +% |minipage| of the default width 88\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 100\,mm is +% clipped. +% +% \SampleEnv{FrontFace} +% +% \DescribeEnv{BackFace} +% The environment |BackFace| is used to define the content of +% the back face. The environment processes its contents inside a +% |minipage| of the default width 88\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 100\,mm is +% clipped. +% +% \SampleEnv{BackFace} +% +% \DescribeEnv{LeftFace} +% The environment |LeftFace| is used to define the content of +% the left face. The environment processes its contents inside a +% |minipage| of the default width 100\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 30\,mm is +% clipped. +% +% \SampleEnv{LeftFace} +% +% \DescribeEnv{RightFace} +% The environment |RightFace| is used to define the content of +% the right face. The environment processes its contents inside a +% |minipage| of the default width 100\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 30\,mm is +% clipped. +% +% \SampleEnv{RightFace} +% +% \DescribeEnv{TopFace} +% The environment |TopFace| is used to define the content of +% the top face. The environment processes its contents inside a +% |minipage| of the default width 88\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 30\,mm is +% clipped. +% +% \SampleEnv{TopFace} +% +% \DescribeEnv{BottomFace} +% The environment |BottomFace| is used to define the content of +% the bottom face. The environment processes its contents inside a +% |minipage| of the default width 88\,mm reduced by the left and +% right separator width (|faceSep|). +% +% The minipage is centered vertically on the face. +% Usually anything extending the default height of 30\,mm is +% clipped. +% +% \SampleEnv{BottomFace} +% +% \newcommand\Sample[1]{ +% \noindent +% \fcolorbox{red!30!black}{yellow!30!white}{\begin{minipage}[b]{.8\textwidth}\footnotesize\tt +% \textcolor{blue}{\char92begin}\char123ProductBox\char125 \\ +% \hspace*{2em}\textcolor{blue}{\char92begin}\char123FrontFace\char125\\ +% \hspace*{4em}\textcolor{red}{[#1]}\\ +% \hspace*{4em}...\\ +% \hspace*{2em}\textcolor{blue}{\char92end}\char123FrontFace\char125\\ +% \hspace*{2em}...\\ +% \textcolor{blue}{\char92end}\char123ProductBox\char125 +% \end{minipage}}\hfill +% \begin{minipage}[b]{.18\textwidth}\hfill +% \begin{ProductBox}[front,scale=.2] +% \begin{FrontFace}[#1] \end{FrontFace} +% \end{ProductBox} +% \end{minipage}\medskip\par +% }% +% Any of the face defining environments described above can take an +% optional argument. This argument is used to specify the +% background. In the simplest case you just have one background +% color. This is specified with the keyword |color|. +% +% \Sample{color=yellow} +% +% Colors in \TikZ{} are either one of the named colors or a +% composition of those colors. The notation |red!60!blue| denotes +% the color by mixing 60\% red and 40\% blue. +% +% \Sample{color=red!60!blue} +% +% By mixing in black or white you can come to a lighter or darker +% color. +% +% \Sample{color=red!20!white} +% +% A fading from top to bottom can be specified with two +% colors named |top color| and |bottom color|. +% +% \Sample{top color=red!50!blue,bottom color=yellow} +% +% A fading from left to right can be specified with two +% colors named |left color| and |left color|. +% +% \Sample{left color=red!50!blue,right color=yellow} +% +% The parameter |middle color| can be used in horizontal or +% vertical fading to specifying the color in the middle. Note thta +% it has to be specified after the other colors! +% +% \Sample{top color=red,bottom color=yellow,middle color=blue} +% +% A circular fading can be specified with the color names +% |inner color| and |outer color|. +% +% \Sample{inner color=red,outer color=yellow} +% +% +% \subsection{The Extended User Interface}\label{sec:extended} +% +% The extended user interface allows you to use all features of +% \TikZ. For this purpose another set of face defining environments +% is provided which process their content in a |tikzpicture| +% environment. +% +% The following example shows a complete example of a product box +% with the extended user interface. This example is used below to +% demonstrate the effect of the differnt options. +% +% \noindent +% {\advance\textwidth-\fboxsep \advance\textwidth-\fboxsep +% \advance\textwidth-\fboxrule \advance\textwidth-\fboxrule +% \setbox127\hbox\bgroup\begin{minipage}{.98\textwidth}\footnotesize\raggedright +% |\begin{ProductBox}\sf|\\ +% | \begin{Front}|\\ +% | \fill [top color=white!30!blue,bottom color=white]|\\ +% | rectangle (88mm,100mm);|\\ +% | \fill [bottom color=white!40!blue,top color=white!90!blue]|\\ +% | (0mm,0mm) -- (44mm,90mm) -- (88mm,0mm) -- cycle;|\\ +% | \draw (44mm,40mm) node{\Huge Product Box};|\\ +% | \end{Front}|\\ +% | \begin{Back}|\\ +% | \fill [top color=yellow!30!red,bottom color=white]|\\ +% | rectangle (88mm,100mm);|\\ +% | \fill [top color=white,bottom color=blue]|\\ +% | (0mm,0mm) -- (88mm,100mm) -- (0mm,100mm) --cycle;|\\ +% | \draw (44mm,50mm) node{\large Back};|\\ +% | \end{Back}|\\ +% | \begin{Top}|\\ +% | \fill [outer color=white!30!red,inner color=white]|\\ +% | rectangle (88mm,30mm);|\\ +% | \draw[white,thick] (0mm,5mm) -- (88mm,25mm);|\\ +% | \draw (44mm,15mm) node{\large Top};|\\ +% | \end{Top}|\\ +% | \begin{Bottom}|\\ +% | \fill [outer color=red!30!white,inner color=black]|\\ +% | rectangle (88mm,30mm);|\\ +% | \draw[white] (44mm,15mm) node{\large Bottom};|\\ +% | \end{Bottom}|\\ +% | \begin{Left}|\\ +% | \fill [left color=green,right color=yellow]|\\ +% | rectangle (30mm,100mm);|\\ +% | \draw (15mm,50mm) node{\large Left};|\\ +% | \end{Left}|\\ +% | \begin{Right}|\\ +% | \fill [top color=green,bottom color=yellow]|\\ +% | rectangle (30mm,100mm);|\\ +% | \draw (15mm,50mm) node{\large Right};|\\ +% | \end{Right}|\\ +% |\end{ProductBox}| +% \end{minipage}\egroup +% \fcolorbox{red!30!black}{yellow!30!white}{\box127}} +% \newcommand\sample[1]{% +% \begin{ProductBox}[scale=.25,#1]\sf +% \begin{Front} +% \fill [top color=white!30!blue,bottom color=white] +% rectangle (88mm,100mm); +% \fill [bottom color=white!40!blue,top color=white!90!blue] +% (0mm,0mm) -- (44mm,90mm) -- (88mm,0mm) -- cycle; +% \draw (44mm,40mm) node{\Huge Product Box}; +% \end{Front} +% \begin{Back} +% \fill [top color=blue,bottom color=white] +% rectangle (88mm,100mm); +% \fill [top color=white,bottom color=blue] +% (0mm,0mm) -- (88mm,100mm) -- (0mm,100mm) --cycle; +% \draw (44mm,50mm) node{\large Back}; +% \end{Back} +% \begin{Top} +% \fill [outer color=white!30!red,inner color=white] +% rectangle (88mm,30mm); +% \draw[white,thick] (0mm,5mm) -- (88mm,25mm); +% \draw (44mm,15mm) node{\large Top}; +% \end{Top} +% \begin{Bottom} +% \fill [outer color=red!30!white,inner color=black] +% rectangle (88mm,30mm); +% \draw[white] (44mm,15mm) node{\large Bottom}; +% \end{Bottom} +% \begin{Left} +% \fill [left color=green,right color=yellow] +% rectangle (30mm,100mm); +% \draw (15mm,50mm) node{\large Left}; +% \end{Left} +% \begin{Right} +% \fill [top color=green,bottom color=yellow] +% rectangle (30mm,100mm); +% \draw (15mm,50mm) node{\large Right}; +% \end{Right} +% \end{ProductBox}% +% } +% +% The content of the environment is simply expanded. It may contain +% any code you like -- except an |ProductBox| environment. Useful +% for the production of a product box are some inner environments. +% They are called |Front|, |Back|, |Left|, |Right|, |Top|, and +% |Bottom|. They are defined inside the main +% environment only. Those environments can be used to specify the +% contents of the respective faces of the box. +% +% Note that in the three-dimensional rendering will show at most +% three of the faces. It does not hurt to define all of them, even +% if they are not shown at all. +% +% \DescribeEnv{Front} +% The environment |Front| is used to define the content of +% the font face. The environment processes its contents inside a +% |tikzpicture| of the default size 88\,mm$\times$100\,mm. +% Usually anything outside of this range is clipped. +% +% \SampleEnv{Front} +% +% \DescribeEnv{Back} +% The environment |Back| is used to define the content of +% the back face. The environment processes its contents inside a +% |tikzpicture| of the default size 88\,mm$\times$100\,mm. +% Usually anything outside of this range is clipped. +% +% \SampleEnv{Back} +% +% \DescribeEnv{Left} +% The environment |Left| is used to define the content of +% the left face, i.e. the face left to the front page. The +% environment processes its contents inside a |tikzpicture| +% of the default size 30\,mm$\times$100\,mm. Usually anything +% outside of this range is clipped. +% +% \SampleEnv{Left} +% +% \DescribeEnv{Right} +% The environment |Right| is used to define the content of +% the right face, i.e. the face right to the front page. The +% environment processes its contents inside a |tikzpicture| +% of the default size 30\,mm$\times$100\,mm. Usually anything +% outside of this range is clipped. +% +% \SampleEnv{Right} +% +% \DescribeEnv{Top} +% The environment |Top| is used to define the content of the +% top face. The environment processes its contents inside a +% |tikzpicture| of the default size 88\,mm$\times$30\,mm. Usually +% anything outside of this range is clipped. +% +% \SampleEnv{Top} +% +% \DescribeEnv{Bottom} +% The environment |Bottom| is used to define the content of the +% top face. The environment processes its contents inside a +% |tikzpicture| of the default size 88\,mm$\times$30\,mm. Usually +% anything outside of this range is clipped. +% +% \SampleEnv{Bottom} +% +% +% \subsection{Settings and Options of the Main Environment}\label{sec:options} +% +% The environment |ProductBox| can take some options to +% influence the appearance of the product box. Those options are +% comma separated. +% +% \def\CODE#1{ +% \noindent +% \fcolorbox{red!30!black}{yellow!30!white}{\begin{minipage}[b]{.98\textwidth}\footnotesize\tt +% #1 +% \end{minipage}\medskip\par +% }}% +% \CODE{\textcolor{blue}{\char92begin}\char123ProductBox\char125[shape=3d]} +% +% The settings are local to the main environment. If an option is not +% set then the fallback from the global settings are used. +% +% \DescribeMacro{\ProductBoxSet} +% The macro |\ProductBoxSet| modifies the global setting of the +% product box style. The arguments are the same as the optional +% arguments of the environment |ProductBox| -- but enclosed +% in braces instead of brackets. +% +% \CODE{\char92ProductBoxSet\char123shape=3d\char125 } +% +% The following options can be used to influence the result of the product +% box. +% +% \newcommand\SAMPLE[1]{ +% \noindent +% \fcolorbox{red!30!black}{yellow!30!white}{\begin{minipage}[b]{.45\textwidth}\footnotesize\tt\raggedright +% \def\x{#1}% +% \def\e{}% +% \textcolor{blue}{\char92begin}\char123ProductBox\char125 \ifx\x\e\else\textcolor{red}{[#1]}\fi\\ +% \hspace*{2em}\textcolor{blue}{\char92begin}\char123Front\char125\\ +% \hspace*{4em}...\\ +% \hspace*{2em}\textcolor{blue}{\char92end}\char123Front\char125\\ +% \hspace*{2em}\textcolor{blue}{\char92begin}\char123Left\char125\\ +% \hspace*{4em}...\\ +% \hspace*{2em}\textcolor{blue}{\char92end}\char123Left\char125\\ +% \hspace*{2em}...\\ +% \textcolor{blue}{\char92end}\char123ProductBox\char125 +% \end{minipage}}\hfill +% \begin{minipage}[b]{.53\textwidth}\hfill +% \sample{#1} +% \end{minipage}\medskip\par +% }% +% +% \DescribeMacro{style} +% The box style determines, how the box is drawn. Several rendering +% functions are provided to produce different effects. Any value is +% accepted. Unknown box styles will lead to an error message. +% +% \SAMPLE{style=3D} +% +% \DescribeMacro{3D} +% The box style |3D| is the default. It produces a +% three-dimensional view of the box. The option |3D| is an +% abbreviation for |style=3D|. It can also be written as |3d| or +% |threeD|. +% +% \SAMPLE{} +% +% \DescribeMacro{shadow} +% The option |shadow| controls the drawing of the drop shadow in the +% 3D rendering. It is a boolean value taking the values |true| and +% |false|. The default value is |true|. +% +% The option |shadow| is the abbreviation for |shadow=true|. +% +% \SAMPLE{shadow=false} +% +% \DescribeMacro{mirror} +% The option |mirror| controls the rendering of the mirror effect in +% the 3D rendering. It is a boolean value taking the values |true| and +% |false|. The default value is |false|. +% +% The option |mirror| is the abbreviation for |mirror=true|. +% +% \SAMPLE{mirror=true} +% +% \DescribeMacro{flare} +% The option |flare| controls the rendering of the flare effect in +% the 3D~rendering. The flare is a circular relection of the light +% source in the upper right corner of the front face. The option is +% a boolean value taking the values |true| and |false|. The default +% value is |false|. +% +% The option |flare| is the abbreviation for |flare=true|. +% +% \SAMPLE{flare=true} +% +% \DescribeMacro{flareDiameter} +% The option |flareDiameter| takes a dimension which defines the +% diameter of the flare effect in the 3D~rendering. The default +% value is 24\,mm. +% +% \SAMPLE{flare=true, flareDiameter=60mm} +% +% Internally the 3D rendering uses a |tikzpicture|. You can expand +% your own code either at the beginning or at the end of this +% environment. This can be achieved by overwriting a macro. +% +% \DescribeMacro{ProductBoxThreeDStartHook} +% The macro |ProductBoxThreeDStartHook| contains code to be +% expanded at the beginning of the 3D rendering. Initially it is +% defined as empty. +% +% \noindent +% \fcolorbox{red!30!black}{yellow!30!white}{\begin{minipage}[b]{.49\textwidth}\footnotesize\tt\raggedright +% \textcolor{blue}{\char92renewcommand}\char92ProductBoxThreeDStartHook\char123\\ +% \hspace*{2em}\char92 filldraw[yscale=.4,\\ +% \hspace*{6em} shift=\char123(30mm,4mm)\char125,\\ +% \hspace*{6em} color=white,\\ +% \hspace*{6em} inner color=white!70!blue,\\ +% \hspace*{6em} outer color=white]\\ +% \hspace*{4em} circle (120mm);\\ +% \char125\\ +% \textcolor{blue}{\char92begin}\char123ProductBox\char125\\ +% \hspace*{2em}...\\ +% \textcolor{blue}{\char92end}\char123ProductBox\char125 +% \end{minipage}}\hfill\hspace*{-4pt} +% \begin{minipage}[b]{.5\textwidth}\hfill +% \renewcommand\ProductBoxThreeDStartHook{ +% \filldraw[yscale=.4, +% shift={(30mm,4mm)}, +% color=white, +% inner color=white!80!blue, +% outer color=white] circle (120mm); +% } +% \sample{} +% \end{minipage}\hspace*{-3pt}\medskip\par +% +% \DescribeMacro{ProductBoxThreeDEndHook} +% The macro |ProductBoxThreeDEndHook| contains code to be +% expanded at the end of the 3D rendering. Initially it is +% defined as empty. +% +% \DescribeMacro{fold} +% The option |fold| switches to the box style for rendering a +% complete wire frame with all faces in place. The option +% |fold| is an abbreviation for |style=fold|. +% +% \SAMPLE{fold} +% +% The top face is printed on the left and right top ear as well. +% This should avoid a break in the pattern when the box is +% partially opened. The same principle applis for the glue ear on +% the right side and the bottom. +% +% The bottom is formed in a way to maiximize stability without the +% need to glue. In addition numbers are printed on the parts of the +% bottom indicating the sequence in which the parts should be +% closed. +% +% \DescribeMacro{earSize} +% The option |earSize| takes a dimension which defines the +% width of the ears in the fold rendering. The ears around the top +% are this wide. The width of the glueing ear is half of this size. +% The default value is 12\,mm. +% +% \SAMPLE{fold,earSize=30mm} +% +% Note that the ear size must not exceed the width of the left +% face, the width of the front face, and the heiht of the box. +% Otherwise funny effects in the ears will happen. +% +% \DescribeMacro{foldLine} +% The option |foldLine| takes a specification for the line +% surrounding the fold drawing. Usally you want to simply use a +% color like ``gray'' or ``red''. The default is a kind of gray. +% +% \SAMPLE{fold,foldLine=red} +% +% \DescribeMacro{foldOpacity} +% The option |foldOpacity| takes a fraction for the opacity of the line +% surrounding the fold drawing. The default is |0.5|. If you want +% to let the fold lines disappear then use a value of 1. +% +% \SAMPLE{fold,foldOpacity=0} +% +% \DescribeMacro{front} +% The option |front| switches to the box style for rendering the +% front face only. The option |front| is an abbreviation for +% |style=front|. +% +% \SAMPLE{front} +% +% \DescribeMacro{back} +% The option |back| switches to the box style for rendering the +% back face only. The option |back| is an abbreviation for +% |style=back|. +% +% \SAMPLE{back} +% +% \DescribeMacro{left} +% The option |left| switches to the box style for rendering the +% left face only. The option |left| is an abbreviation for +% |style=left|. +% +% \SAMPLE{left} +% +% \DescribeMacro{right} +% The option |right| switches to the box style for rendering the +% right face only. The option |right| is an abbreviation for +% |style=right|. +% +% \SAMPLE{right} +% +% \DescribeMacro{top} +% The option |top| switches to the box style for rendering the +% top face only. The option |top| is an abbreviation for +% |style=top|. +% +% \SAMPLE{top} +% +% \DescribeMacro{bottom} +% The option |bottom| switches to the box style for rendering the +% face only. The option |bottom| is an abbreviation for +% |style=bottom|. +% +% \SAMPLE{bottom} +% +% \DescribeMacro{empty} +% The option |empty| switches to the box style for not rendering +% the box at all. The option |empty| is an abbreviation for +% |style=empty|. +% +% \SAMPLE{empty} +% +% \DescribeMacro{scale} +% The option |scale| controlls the scaling of the whole rendering. +% It is a number where 1. represents the original size.\footnote{The +% examples on the right side are normally rendered with a scale of 0.25.} +% +% \SAMPLE{scale=.1} +% +% \DescribeMacro{view} +% The option |view| takes a name of a view definition and activates +% the appropriate settings. A few views are predefined. The default +% value is |1|. +% +% \SAMPLE{view=1} +% +% \SAMPLE{view=2} +% +% \SAMPLE{view=3} +% +% \DescribeMacro{edgeColor} +% The option |edgeColor| takes a color specification for +% highlighting the inner edges in the 3D rendering. +% +% \DescribeMacro{faceSep} +% The option |faceSep| takes a dimension denoting the additional +% separating whitespace between the outer border and the minipage +% in the simplified interface. +% +% \DescribeMacro{width} +% The option |width| takes a dimension denoting the width of the +% box. The default value is 88\,mm. +% +% \DescribeMacro{height} +% The option |height| takes a dimension denoting the height of the +% box. The default value is 100\,mm. +% +% \DescribeMacro{depth} +% The option |depth| takes a dimension denoting the depth of the +% box. The default value is 30\,mm. +% +% \DescribeMacro{clean} +% The option |clean| controlls the cleaning of the stored faces +% upon entering the main environment. If it is turned off then the +% previously defined faces are still present and do not need to be +% defined again. It is a boolean value taking the values |true| and +% |false|. The default value is |true|. +% +% This option can be used to typeset the same product box with +% differnt parameters. For this purpose the main environment +% |ProductBox| is left empty and the option |clean=false| is added. +% +% \DescribeMacro{clip} +% The option |clip| controls the clipping of the faces to their +% defined size. If it is turned off then the faces can be oversized +% leading to strange effects. It is a boolean value taking the +% values |true| and |false|. The default value is |true|. +% +% \section{Tipps and Tricks} +% +% \subsection{Adjusting the Paper for the Fold Rendering} +% +% When you produce the fold rendering it is usually meant to be cut +% out and glued together. This means that the normal rules for the +% paper layout are not relevant. Instead you want to use the +% complete page for printing the product box. +% Below an example is shown how this goal can be achieved. +% +% \noindent +% {\advance\textwidth-\fboxsep \advance\textwidth-\fboxsep +% \advance\textwidth-\fboxrule \advance\textwidth-\fboxrule +% \setbox127\hbox\bgroup\begin{minipage}{.98\textwidth}\raggedright\footnotesize\tt +% |\documentclass{|\textcolor{red}{\tt report}|}|\\ +% |\usepackage[|\textcolor{red}{a4paper}|,|\\ +% | landscape,|\\ +% | left=|\textcolor{red}{5mm}|,|\\ +% | right=|\textcolor{red}{5mm}|,|\\ +% | top=|\textcolor{red}{5mm}|,|\\ +% | bottom=|\textcolor{red}{5mm}|]{geometry}|\\ +% |\usepackage{productbox}|\\ +% \textcolor{green}{\itshape\% load any required packages here}\\ +% |\pagestyle{empty}|\\ +% |\begin{document}|\\ +% |\noindent|\\ +% |\begin{ProductBox}[style=fold]|\\ +% | |\textcolor{green}{\itshape\% include any definitions for the faces here}\\ +% |\end{ProductBox}|\\ +% |\end{document}|\\ +% \end{minipage}\egroup +% \fcolorbox{red!30!black}{yellow!30!white}{\box127}} +% +% The class for typesetting this example is |report|. This can be +% changed to suit your needs. For instance if you are used to a +% document class with other macros and environments predefined you +% can just use it instead. +% +% The example above uses the package |geometry| +% \cite{geormetry-manual} to get rid of any predefined page layout. +% Some parameters (marked in red) can be adjusted. First of all is +% the paper definition. Here the value |a4paper| is used. If you +% want to print onto paper of a different size just use an +% appropriate short name like |letterpaper| or |a3paper|. See the +% documentation of the geometry package for a complete list of +% values. +% +% The values |left|, |right|, |top|, and |bottom| denote the +% margins left on the respective outer side of the paper. They are +% set to 5\,mm in this example to cope with the problem that some +% printers are not able to fill the complete page. They might need +% a small non-printable area at the borders. You can experiment and +% adjust those values to whatever suits your printer. +% +% \section{Known Problems} +% +% This section lists some issues which might lead to undesirable +% results. +% +% \begin{description} +% \item[Nested |ProductBox| environments.] The definition of the +% environment uses some global storage. As a consequence the +% environment |ProductBox| can not be used inside the definition of +% a face. For instance if you want to show a product box on a side +% of another product box can lead to this problem. +% +% In this case you can simply store the inner product box in a box +% register (with |setbox|) and use this bos register instead of a +% direct rendering. This will overcome the restriction. +% +% \item[Free selection of the point of view.] The 3D rendering is +% rather limited in the possibilities of selecting the view. +% Arbitrary rotation about any axis is not implemented (yet). This +% is on the which list for a future release already. +% \end{description} +% +% +% \bibliographystyle{alpha} +% \bibliography{productbox} +% +% \StopEventually +% +% \newpage +% \section{The Documentation Driver} +% +% The documentation driver changes \textsf{productbox.dtx} into a +% self-extracting documentation. Thus it is possible to run +% \LaTeX{} on \textsf{productbox.dtx} to produce the documentation. +% +% The documentation can be adapted in a file named productbox.dcf +% (documentation configuration). This file can contain instructions +% for |docstrip|. Especially useful might be the instruction +% +% |\OnlyDescription| +% +% which suppresses the generation of the implementation description. +% +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +\usepackage{productbox} +\usepackage[colorlinks,citecolor=blue]{hyperref} +\usepackage{graphicx,color} +\RecordChanges +\EnableCrossrefs +\CodelineIndex +\definecolor{darkblue}{rgb}{.4,.4,1.} +\renewcommand\MacroFont{\tt\footnotesize\color{darkblue}} +\parindent=0pt +\parskip=1ex plus .5ex minus .25ex +\InputIfFileExists{productbox.dcf}{}{} +\begin{document} +\DocInput{productbox.dtx} +\end{document} +%</driver> +% \end{macrocode} +% +% \section{The Implementation} +% +% The implementation contains the code of the style. +% +% \subsection{The Version Information} +% +% The following lines define the version information for the class +% file. The information is partially taken from the version control +% system (Subversion). +% +% \begin{macrocode} +%<*style> +\begingroup + \def\ProductBox@VC$#1: #2 #3${#2} + \def\ProductBox@VCdate$#1: #2-#3-#4 #5${#2/#3/#4} + \xdef\fileversion{1.1} + \xdef\filerevision{\ProductBox@VC$Revision: 8333 $} + \xdef\filedate{\ProductBox@VCdate + $Date: 2010-12-29 20:58:06 +0100 (Mi, 29 Dez 2010) $} + \xdef\filename{productbox.dtx} +\endgroup +%</style> +% \end{macrocode} +% +% +% \subsection{Getting Started} +% +% First we have to determine that the right kind of \LaTeX{} is +% running and identify the style file. +% +% \begin{macrocode} +%<*style> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{productbox}[\filedate Another type of boxes...] +% \end{macrocode} +% +% A bunch of packages is loaded to form the base of the work herein. +% \begin{macrocode} +\RequirePackage{keyval} +\RequirePackage{tikz} +\usetikzlibrary{calc} +\usetikzlibrary{fadings} +% \end{macrocode} +% +% \subsection{Option Declarations} +% +% Define the parameters for the keyval package. They are used in +% the main environemnt |Product Box| and in the declaration of +% global options |\ProductBoxSet|. +% +% \subsubsection{General Parameters} +% \begin{macrocode} +\define@key{ProductBox}{scale}{% + \def\ProductBox@scale{#1}} +\define@key{ProductBox}{width}{% + \def\ProductBox@x{#1}} +\define@key{ProductBox}{height}{% + \def\ProductBox@y{#1}} +\define@key{ProductBox}{depth}{% + \def\ProductBox@z{#1}} +\define@key{ProductBox}{clean}[true]{% + \csname ProductBox@clean#1\endcsname} +% \end{macrocode} +% +% \subsubsection{Box Style Parameters} +% \begin{macrocode} +\define@key{ProductBox}{flat}[true]{% + \def\ProductBox@style{flat}} +\define@key{ProductBox}{fold}[true]{% + \def\ProductBox@style{fold}} +\define@key{ProductBox}{3d}[true]{% + \def\ProductBox@style{threeD}} +\define@key{ProductBox}{3D}[true]{% + \def\ProductBox@style{threeD}} +\define@key{ProductBox}{threeD}[true]{% + \def\ProductBox@style{threeD}} +\define@key{ProductBox}{top}[true]{% + \def\ProductBox@style{top}} +\define@key{ProductBox}{bottom}[true]{% + \def\ProductBox@style{bottom}} +\define@key{ProductBox}{front}[true]{% + \def\ProductBox@style{front}} +\define@key{ProductBox}{back}[true]{% + \def\ProductBox@style{back}} +\define@key{ProductBox}{left}[true]{% + \def\ProductBox@style{left}} +\define@key{ProductBox}{right}[true]{% + \def\ProductBox@style{right}} +\define@key{ProductBox}{empty}[true]{% + \def\ProductBox@style{empty}} +\define@key{ProductBox}{style}{% + \def\ProductBox@style{#1}} +% \end{macrocode} +% +% \subsubsection{Parameters for the 3D Rendering} +% \begin{macrocode} +\define@key{ProductBox}{shadow}[true]{% + \csname ProductBox@shadow#1\endcsname} +\define@key{ProductBox}{mirror}[true]{% + \csname ProductBox@mirror#1\endcsname} +\define@key{ProductBox}{flare}[true]{% + \csname ProductBox@flare#1\endcsname} +\define@key{ProductBox}{flareDiameter}{% + \def\ProductBox@flareDiameter{#1}} +\define@key{ProductBox}{edgeColor}{% + \def\productBox@edgeColor{#1}} +\define@key{ProductBox}{view}{% + \@nameuse{ProductBox@View@#1}} +% \end{macrocode} +% +% \subsubsection{Parameters for the Fold Rendering} +% \begin{macrocode} +\define@key{ProductBox}{earSize}{% + \def\ProductBox@earSize{#1}} +\define@key{ProductBox}{foldLine}{% + \def\ProductBox@foldLine{#1}} +\define@key{ProductBox}{foldOpacity}{% + \def\ProductBox@foldOpacity{#1}} +% \end{macrocode} +% +% \subsubsection{Parameters for the Simplified Interface} +% \begin{macrocode} +\define@key{ProductBox}{faceSep}{% + \def\ProductBox@FaceSep{#1}} +% \end{macrocode} +% +% \subsection{Storage for the Faces} +% +% \begin{macro}{\ProductBox@Front} +% The box |\ProductBox@Front| contains the front material. +% \begin{macrocode} +\newbox\ProductBox@Front +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@Left} +% The box |\ProductBox@Left| contains the left material. +% \begin{macrocode} +\newbox\ProductBox@Left +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@Top} +% The box |\ProductBox@Top| contains the top material. +% \begin{macrocode} +\newbox\ProductBox@Top +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@Right} +% The box |\ProductBox@Right| contains the right material. +% \begin{macrocode} +\newbox\ProductBox@Right +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@Bottom} +% The box |\ProductBox@Bottom| contains the bottom material. +% \begin{macrocode} +\newbox\ProductBox@Bottom +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@Back} +% The box |\ProductBox@Back| contains the back material. +% \begin{macrocode} +\newbox\ProductBox@Back +% \end{macrocode} +% \end{macro} +% +% \subsection{Settings} +% +% \begin{macro}{\ProductBoxSet} +% The macro |\ProductBoxSet| defines the global parameters used by +% the environment |ProductBox|. They can be overwritten either +% within a group or in the optional parameter of the environment. +% \begin{macrocode} +\newcommand\ProductBoxSet[1]{\setkeys{ProductBox}{#1}} +% \end{macrocode} +% \end{macro} +% +% \subsection{The Main Environment} +% +% \begin{macro}{\ProductBox@style} +% The default style is the 3D rendering. +% \begin{macrocode} +\newcommand\ProductBox@style{threeD} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@x} +% The width of the box. +% \begin{macrocode} +\newcommand\ProductBox@x{88mm} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@y} +% The height of the box. +% \begin{macrocode} +\newcommand\ProductBox@y{100mm} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@z} +% The depth of the box. +% \begin{macrocode} +\newcommand\ProductBox@z{30mm} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ifProductBox@clean} +% Indicator that the boxes for the faces should be cleaned. +% \begin{macrocode} +\newif\ifProductBox@clean +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ifProductBox@active} +% Indicator that we are inside a |ProductBox| environment already. +% \begin{macrocode} +\newif\ifProductBox@active +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{ifProductBox@clip} +% The boolean |ProductBox@clip| determines whether or not the +% additional clipping of the boxes should be enabled. +% \begin{macrocode} +\newif\ifProductBox@clip \ProductBox@cliptrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@FaceSep} +% The horizontal separator of the minipage in the face definitions +% in the simplified interface. +% \begin{macrocode} +\newcommand\ProductBox@FaceSep{1em} +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{ProductBox} +% This is the central environment provided by this style. In the begin code +% only the local environments are initialized and the optional parameters +% are evaluated with the help of the package |keyval|. +% \begin{macrocode} +\newenvironment{ProductBox}[1][]{% + \setkeys{ProductBox}{#1}% +% \end{macrocode} +% +% Next we clean the faces if this is required. +% \changes{1.1}{2010/12/27}{Do not clean the faces upon request.} +% \begin{macrocode} + \ifProductBox@clean + \global\setbox\ProductBox@Front\hbox{}% + \global\setbox\ProductBox@Back\hbox{}% + \global\setbox\ProductBox@Left\hbox{}% + \global\setbox\ProductBox@Right\hbox{}% + \global\setbox\ProductBox@Top\hbox{}% + \global\setbox\ProductBox@Bottom\hbox{}% + \fi +% \end{macrocode} +% +% Next we define the local environments to make sure that they have +% the proper definitions within this environment. Since the +% environment provides an implicit group, the definitions are local +% to this environment. +% +% To suppress any error messages about environments which are +% already defined the start macros are reset to undefined. +% \changes{1.1}{2010/12/23}{Simplified user interface added.} +% \changes{1.1}{2010/12/25}{Suppress error messages.} +% \changes{1.1}{2010/12/26}{Issue an error message for nested +% ProductBox environments.} +% \begin{macrocode} + \ifProductBox@active + \errmessage{Trying to use an environment ProductBox inside the + environment ProductBox. This is not allowed.}% + \else + \ProductBox@activetrue + \fi + \let\Front\undefined \let\endFront\undefined + \let\Back\undefined \let\endBack\undefined + \let\Left\undefined \let\endLeft\undefined + \let\Right\undefined \let\endRight\undefined + \let\Top\undefined \let\endTop\undefined + \let\Bottom\undefined \let\endBottom\undefined + \let\FrontFace\undefined \let\endFrontFace\undefined + \let\BackFace\undefined \let\endBackFace\undefined + \let\LeftFace\undefined \let\endLeftFace\undefined + \let\RightFace\undefined \let\endRightFace\undefined + \let\TopFace\undefined \let\endTopFace\undefined + \let\BottomFace\undefined \let\endBottomFace\undefined + \newenvironment{Front}{\ProductBox@Start\ProductBox@Front + (\ProductBox@x,\ProductBox@y)}{\ProductBox@End}% + \newenvironment{Back}{\ProductBox@Start\ProductBox@Back + (\ProductBox@x,\ProductBox@y)}{\ProductBox@End}% + \newenvironment{Left}{\ProductBox@Start\ProductBox@Left + (\ProductBox@z,\ProductBox@y)}{\ProductBox@End}% + \newenvironment{Right}{\ProductBox@Start\ProductBox@Right + (\ProductBox@z,\ProductBox@y)}{\ProductBox@End}% + \newenvironment{Top}{\ProductBox@Start\ProductBox@Top + (\ProductBox@x,\ProductBox@z)}{\ProductBox@End}% + \newenvironment{Bottom}{\ProductBox@Start\ProductBox@Bottom( + \ProductBox@x,\ProductBox@z)}{\ProductBox@End}% + \newenvironment{FrontFace}[1][white]{\ProductBox@StartFace\ProductBox@Front + {\ProductBox@x}{\ProductBox@y}{##1}}{\ProductBox@EndFace}% + \newenvironment{BackFace}[1][white]{\ProductBox@StartFace\ProductBox@Back + {\ProductBox@x}{\ProductBox@y}{##1}}{\ProductBox@EndFace}% + \newenvironment{LeftFace}[1][white]{\ProductBox@StartFace\ProductBox@Left + {\ProductBox@z}{\ProductBox@y}{##1}}{\ProductBox@EndFace}% + \newenvironment{RightFace}[1][white]{\ProductBox@StartFace\ProductBox@Right + {\ProductBox@z}{\ProductBox@y}{##1}}{\ProductBox@EndFace}% + \newenvironment{TopFace}[1][white]{\ProductBox@StartFace\ProductBox@Top + {\ProductBox@x}{\ProductBox@z}{##1}}{\ProductBox@EndFace}% + \newenvironment{BottomFace}[1][white]{\ProductBox@StartFace\ProductBox@Bottom + {\ProductBox@x}{\ProductBox@z}{##1}}{\ProductBox@EndFace}% + \ignorespacesafterend +}{% +% \end{macrocode} +% Check that the box style is defined or issue an appropriate error +% message. +% \begin{macrocode} + \@ifundefined{ProductBox@style@\ProductBox@style}{% + \errmessage{Box style '\ProductBox@style' for ProductBox is unknown}% + }{% +% \end{macrocode} +% The main activity is performed in the end code. Since the +% flexibility of the environment is one of its design goals, the +% expansion of the macro |\ProductBox@style| is used to invoke the +% macro stored in it. Optionally it is enclosed in a |\scalebox| +% macro to perform the scaling. Thus the implementations of the box +% styles do not need to care about scaling at all. +% \begin{macrocode} + \@ifundefined{ProductBox@scale}{% + \@nameuse{ProductBox@style@\ProductBox@style}}{% + \scalebox{\ProductBox@scale}% + {\@nameuse{ProductBox@style@\ProductBox@style}} + }}% + \ProductBox@activefalse + \ignorespacesafterend +} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\ProductBox@Start} +% The macro |\ProductBox@Start| starts the environment storing a face. +% \begin{macrocode} +\def\ProductBox@Start#1(#2){% + \global\setbox#1\hbox\bgroup\begin{tikzpicture}% + \ifProductBox@clip \clip rectangle (#2); \fi + }% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@End} +% The macro |\ProductBox@End| ends the environment storing a face. +% \begin{macrocode} +\newcommand\ProductBox@End{\end{tikzpicture}\egroup\ignorespacesafterend} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@StartFace} +% The macro |\ProductBox@StartFace| starts the environment storing +% a face in a minipage. +% \begin{macrocode} +\newcommand\ProductBox@StartFace[4]{% + \let\ProductBox@@box#1% + \def\ProductBox@@w{#2}% + \def\ProductBox@@h{#3}% + \def\ProductBox@@args{[#4]}% + \@tempdima=#2 + \advance\@tempdima-\ProductBox@FaceSep + \advance\@tempdima-\ProductBox@FaceSep + \setbox#1\hbox\bgroup\begin{minipage}{\the\@tempdima}% + \ignorespaces +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@EndFace} +% This macro ends a face definition and stores the result in the +% internal box |\ProductBox@@box|. +% \begin{macrocode} +\newcommand\ProductBox@EndFace{\end{minipage}\egroup + \global\setbox\ProductBox@@box=\hbox{\begin{tikzpicture} + \ifProductBox@clip \clip rectangle (\ProductBox@@w,\ProductBox@@h); \fi + \expandafter\fill \ProductBox@@args rectangle(\ProductBox@@w,\ProductBox@@h); + \draw (.5*\ProductBox@@w,.5*\ProductBox@@h) + node[inner sep=0pt] {\box\ProductBox@@box}; + \end{tikzpicture}}\ignorespacesafterend} +% \end{macrocode} +% \end{macro} +% +% \subsection{Box Styles} +% +% \begin{macro}{\ProductBox@style@empty} +% This macro defines the sytle \emph{empty} for a product box. It +% simply does nothing. +% \changes{1.1}{2010/12/26}{New box style ``empty''.} +% \begin{macrocode} +\newcommand\ProductBox@style@empty{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@style@flat} +% This macro defines the sytle \emph{flat} for a product box. +% \begin{macrocode} +\newcommand\ProductBox@style@flat{% + \par\noindent + \hspace*{\ProductBox@z}\kern1mm \copy\ProductBox@Top\\[1ex] + \copy\ProductBox@Left\kern1mm \copy\ProductBox@Front\kern1mm + \copy\ProductBox@Right\kern1mm \copy\ProductBox@Back\\[1ex] + \hspace*{\ProductBox@z}\kern1mm \copy\ProductBox@Bottom\par +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{front}} +% +% \begin{macro}{\ProductBox@style@front} +% This macro defines the sytle \emph{front} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@front{% + \copy\ProductBox@Front +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{back}} +% +% \begin{macro}{\ProductBox@style@back} +% This macro defines the sytle \emph{back} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@back{%class + \copy\ProductBox@Back +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{left}} +% +% \begin{macro}{\ProductBox@style@left} +% This macro defines the sytle \emph{left} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@left{% + \copy\ProductBox@Left +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{right}} +% +% \begin{macro}{\ProductBox@style@right} +% This macro defines the sytle \emph{right} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@right{% + \copy\ProductBox@Right +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{top}} +% +% \begin{macro}{\ProductBox@style@top} +% This macro defines the sytle \emph{top} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@top{% + \copy\ProductBox@Top +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{bottom}} +% +% \begin{macro}{\ProductBox@style@bottom} +% This macro defines the sytle \emph{bottom} for a product box. Only this +% one face of the box is shown. +% \begin{macrocode} +\newcommand\ProductBox@style@bottom{% + \copy\ProductBox@Bottom +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{fold}} +% +% \begin{macro}{\ProductBox@earSize} +% Parameter for the size of the ears. +% \begin{macrocode} +\newcommand\ProductBox@earSize{12mm} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@foldLine} +% The color of the additional lines in the fold rendering. +% \begin{macrocode} +\newcommand\ProductBox@foldLine{white!80!black} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@foldOpacity} +% The color of the additional lines in the fold rendering. +% \begin{macrocode} +\newcommand\ProductBox@foldOpacity{.5} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@style@fold} +% This macro defines the sytle \emph{fold} for a product box. +% \begin{macrocode} +\newcommand\ProductBox@style@fold{% + \begin{tikzpicture}[sw/.style={anchor=south west, + inner sep=0pt}, + se/.style={anchor=south east, + inner sep=0pt}, + nw/.style={anchor=north west, + inner sep=0pt}, + num/.style={circle, + fill=white!90!black, + fill opacity=.5, + font=\tiny\bfseries\sffamily}] +% \end{macrocode} +% left face +% \begin{macrocode} + \begin{scope} + \clip rectangle (\ProductBox@z,\ProductBox@y); + \draw node[sw]{\copy\ProductBox@Left}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + rectangle (\ProductBox@z,\ProductBox@y); + \end{scope} +% \end{macrocode} +% front face +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z] + \clip rectangle (\ProductBox@x,\ProductBox@y); + \draw node[sw]{\copy\ProductBox@Front}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + rectangle (\ProductBox@x,\ProductBox@y); + \end{scope} +% \end{macrocode} +% right face +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z+\ProductBox@x] + \clip rectangle (\ProductBox@z,\ProductBox@y); + \draw node[sw]{\copy\ProductBox@Right}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + rectangle (\ProductBox@z,\ProductBox@y); + \end{scope} +% \end{macrocode} +% back face +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@x+2*\ProductBox@z] + \clip rectangle (\ProductBox@x,\ProductBox@y); + \draw node[sw]{\copy\ProductBox@Back}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + rectangle (\ProductBox@x,\ProductBox@y); + \end{scope} +% \end{macrocode} +% top face +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z,yshift=\ProductBox@y] + \clip rectangle (\ProductBox@x,\ProductBox@z); + \draw node[sw]{\copy\ProductBox@Top}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + rectangle (\ProductBox@x,\ProductBox@z); + \end{scope} +% \end{macrocode} +% bottom ear 3 front +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z] + \clip + (0mm,0mm) -- (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x,0mm) -- cycle; + \draw (\ProductBox@x,-\ProductBox@z) + node[se]{\copy\ProductBox@Bottom}; + \draw [thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x,0mm) -- cycle; + \draw (.5*\ProductBox@x,-.75*\ProductBox@z) node[num]{3}; + \end{scope} +% \end{macrocode} +% bottom ear 1 back +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@x+2*\ProductBox@z] + \clip + (0mm,0mm) -- (0mm,-\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x,-\ProductBox@z) -- (\ProductBox@x,0mm) -- + cycle; + \draw node[se,rotate=180]{\copy\ProductBox@Bottom}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (0mm,-\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-.5*\ProductBox@z) -- + (\ProductBox@x-.5*\ProductBox@z,-\ProductBox@z) -- + (\ProductBox@x,-\ProductBox@z) -- (\ProductBox@x,0mm) -- + cycle; + \draw (.25*\ProductBox@z,-.75*\ProductBox@z) node[num]{1}; + \draw (\ProductBox@x-.25*\ProductBox@z,-.75*\ProductBox@z) + node[num]{1}; + \end{scope} +% \end{macrocode} +% bottom ear 2 right +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z+\ProductBox@x] + \clip + (0mm,0mm) -- (\ProductBox@z,0mm) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- (0mm,-\ProductBox@z) -- + cycle; + \draw (\ProductBox@z,0mm) + node[se,rotate=90]{\copy\ProductBox@Bottom}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@z,0mm) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- (0mm,-\ProductBox@z) -- + cycle; + \draw (.25*\ProductBox@z,-.75*\ProductBox@z) node[num]{2}; + \end{scope} +% \end{macrocode} +% bottom ear 2 left +% \begin{macrocode} + \begin{scope} + \clip + (0mm,0mm) -- (\ProductBox@z,0mm) -- + (\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- cycle; + \draw + node[sw,rotate=270]{\copy\ProductBox@Bottom}; + \draw [thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@z,0mm) -- + (\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-\ProductBox@z) -- + (.5*\ProductBox@z,-.5*\ProductBox@z) -- cycle; + \draw (.75*\ProductBox@z,-.75*\ProductBox@z) node[num]{2}; + \end{scope} +% \end{macrocode} +% glue ear +% \begin{macrocode} + \begin{scope}[xshift=2*\ProductBox@x+2*\ProductBox@z] + \clip + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize/4) -- + (\ProductBox@earSize/2,\ProductBox@y-\ProductBox@earSize/4) -- + (0mm,\ProductBox@y) -- cycle; + \draw node[sw]{\copy\ProductBox@Left}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize/4) -- + (\ProductBox@earSize/2,\ProductBox@y-\ProductBox@earSize/4) -- + (0mm,\ProductBox@y) -- cycle; + \end{scope} +% \end{macrocode} +% top ear left +% \begin{macrocode} + \begin{scope}[yshift=\ProductBox@y] + \clip + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z,0mm) -- cycle; + \draw node[nw,rotate=90]{\copy\ProductBox@Top}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z,0mm) -- cycle; + \end{scope} +% \end{macrocode} +% top ear right +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@x+\ProductBox@z, + yshift=\ProductBox@y] + \clip + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z,0mm) -- cycle; + \draw node[se,rotate=270]{\copy\ProductBox@Top}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@z,0mm) -- cycle; + \end{scope} +% \end{macrocode} +% top ear back +% \begin{macrocode} + \begin{scope}[xshift=\ProductBox@z, + yshift=\ProductBox@y+\ProductBox@z] + \clip + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@x-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@x,0mm) -- cycle; + \draw (0mm,\ProductBox@y) + node[se,rotate=180]{\copy\ProductBox@Back}; + \draw[thin,opacity=\ProductBox@foldOpacity,\ProductBox@foldLine] + (0mm,0mm) -- (\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@x-\ProductBox@earSize/2,\ProductBox@earSize) -- + (\ProductBox@x,0mm) -- cycle; + \end{scope} + \end{tikzpicture}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Box Style \texttt{threeD}} +% +% \begin{macro}{\ProductBoxThreeDStartHook} +% A hook to add some code at the beginning. +% \begin{macrocode} +\newcommand\ProductBoxThreeDStartHook{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBoxThreeDEndHook} +% A hook to add some code at the end. +% \begin{macrocode} +\newcommand\ProductBoxThreeDEndHook{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifProductBox@shadow} +% The boolean |ProductBox@shadow| determines whether or not the +% shadow in the 3D rendering is shown. +% \begin{macrocode} +\newif\ifProductBox@shadow \ProductBox@shadowtrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifProductBox@mirror} +% The boolean |ProductBox@mirror| determines whether or not the +% mirror effect in the 3D rendering is shown. +% \begin{macrocode} +\newif\ifProductBox@mirror +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifProductBox@flare} +% The boolean |ProductBox@flare| determines whether or not the +% flare effect in the 3D rendering is shown. +% \begin{macrocode} +\newif\ifProductBox@flare +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@edgeColor} +% The edge color in the 3D rendering. +% \begin{macrocode} +\newcommand\ProductBox@edgeColor{white} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@flareDiameter} +% The diameter of the flare. +% \begin{macrocode} +\newcommand\ProductBox@flareDiameter{24mm} +% \end{macrocode} +% \end{macro} +% +% The angle to rotate the box about the z axis. +% \begin{macrocode} +\newcommand\ProductBox@angleZ{8} +% \end{macrocode} +% +% The angle to rotate the box about the x axis. +% \begin{macrocode} +\newcommand\ProductBox@angleX{10} +% \end{macrocode} +% +% \begin{macro}{\ProductBox@style@threeD} +% This macro defines the sytle \emph{threeD} for a product box. The +% faces are placed such the illusion of a three-dimensional box +% appears. In addition a shadow is shown if not disabled. +% \changes{1.1}{2010/12/26}{Fix: The flare is also transformed and clipped.} +% \begin{macrocode} +\newcommand\ProductBox@style@threeD{ + \begin{tikzpicture}[sw/.style={anchor=south west, + inner sep=0pt}] + \ProductBoxThreeDStartHook + \ifProductBox@mirror \ProductBox@threeD@mirror \fi + \ifProductBox@shadow \ProductBox@threeD@shadow \fi + + \begin{scope} + \fill[white, + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + yscale=\ProductBox@p@front@yscale, + anchor=south west] + rectangle (\ProductBox@x,\ProductBox@y); + \draw + node[sw, + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + yscale=\ProductBox@p@front@yscale] + {\copy\ProductBox@Front}; + \fill[black, + fill opacity=.025, + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + yscale=\ProductBox@p@front@yscale, + anchor=south west] + rectangle (\ProductBox@x,\ProductBox@y); + \ifProductBox@flare + \begin{scope}[ + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + yscale=\ProductBox@p@front@yscale] + \clip rectangle(\ProductBox@x,\ProductBox@y); + \ProductBox@threeD@flare + \end{scope} + \fi + \end{scope} + \begin{scope}[shift={(-\ProductBox@p@left@xscale*\ProductBox@z, + \ProductBox@p@left@yslant + *\ProductBox@p@left@xscale + *\ProductBox@z)}] + \fill[white, + yslant=-\ProductBox@p@left@yslant, + xscale=\ProductBox@p@left@xscale, + yscale=\ProductBox@p@left@yscale, + anchor=south west] + rectangle (\ProductBox@z,\ProductBox@y); + \draw + node[sw, + yslant=-\ProductBox@p@left@yslant, + xscale=\ProductBox@p@left@xscale, + yscale=\ProductBox@p@left@yscale] + {\copy\ProductBox@Left}; + \fill[black, + fill opacity=.25, + yslant=-\ProductBox@p@left@yslant, + xscale=\ProductBox@p@left@xscale, + yscale=\ProductBox@p@left@yscale, + anchor=south west] + rectangle (\ProductBox@z,\ProductBox@y); + \end{scope} + \begin{scope}[yshift=\ProductBox@y] + \fill [white, + anchor=south west, + xslant=-\ProductBox@p@top@xslant, + xscale=\ProductBox@p@top@xscale, + yslant=\ProductBox@p@top@yslant, + yscale=\ProductBox@p@top@yscale] + rectangle (\ProductBox@x,\ProductBox@z); + \draw + node[sw, + xslant=-\ProductBox@p@top@xslant, + xscale=\ProductBox@p@top@xscale, + yslant=\ProductBox@p@top@yslant, + yscale=\ProductBox@p@top@yscale] + {\copy\ProductBox@Top}; + \fill [black, + fill opacity=.0025, + anchor=south west, + xslant=-\ProductBox@p@top@xslant, + xscale=\ProductBox@p@top@xscale, + yslant=\ProductBox@p@top@yslant, + yscale=\ProductBox@p@top@yscale] + rectangle (\ProductBox@x,\ProductBox@z); + \end{scope} + \begin{scope}[shift={(-\ProductBox@p@left@xscale*\ProductBox@z, + \ProductBox@p@left@yslant*\ProductBox@p@left@xscale*\ProductBox@z)}] + \draw [\ProductBox@edgeColor, + line width=.5mm, + draw opacity=.25, + yslant=-\ProductBox@p@left@yslant, + xscale=\ProductBox@p@left@xscale] + (\ProductBox@z,0mm) -- + (\ProductBox@z,\ProductBox@y) -- + (0mm,\ProductBox@y); + \end{scope} + \draw [\ProductBox@edgeColor, + line width=.5mm, + draw opacity=.25, + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + anchor=south west] + (0mm,\ProductBox@y) -- (\ProductBox@x,\ProductBox@y); + \ProductBoxThreeDEndHook + \end{tikzpicture}} +% \end{macrocode} +% \end{macro} +% +% Parameters and views. +% +% \begin{macrocode} +\newcommand\ProductBox@setFrontParams[3]{% + \def\ProductBox@p@front@yslant{#1}% + \def\ProductBox@p@front@xscale{#2}% + \def\ProductBox@p@front@yscale{#3}% +} +\newcommand\ProductBox@setLeftParams[3]{% + \def\ProductBox@p@left@yslant{#1}% + \def\ProductBox@p@left@xscale{#2}% + \def\ProductBox@p@left@yscale{#3}% +} +\newcommand\ProductBox@setTopParams[4]{% + \def\ProductBox@p@top@xslant{#1}% + \def\ProductBox@p@top@yslant{#2}% + \def\ProductBox@p@top@xscale{#3}% + \def\ProductBox@p@top@yscale{#4}% +} +\newcommand\ProductBox@setMirrorParams[1]{% + \def\ProductBox@p@mirror@yscale{#1}% +} +\@namedef{ProductBox@View@1}{% + \ProductBox@setFrontParams{.25}{.9090909}{1}% + \ProductBox@setLeftParams{.5}{.6666666}{1}% + \ProductBox@setTopParams{2}{.2265}{1.363}{.3333333}% + \ProductBox@setMirrorParams{.4}} +\@namedef{ProductBox@View@2}{% + \ProductBox@setFrontParams{.15}{.9090909}{1}% + \ProductBox@setLeftParams{.6666666}{.5}{1}% + \ProductBox@setTopParams{1.5}{.12}{1.11}{.333333}% + \ProductBox@setMirrorParams{.4}} +\@namedef{ProductBox@View@3}{% + \ProductBox@setFrontParams{.05}{.95}{1}% + \ProductBox@setLeftParams{.25}{.4}{1}% + \ProductBox@setTopParams{4}{.04}{1.133333}{.1}% + \ProductBox@setMirrorParams{.4}} +\@nameuse{ProductBox@View@1} +% \end{macrocode} +% +% \begin{macro}{\ProductBox@threeD@shadow} +% This macro defines the code to produce the shadow effect for the 3D rendering. +% \begin{macrocode} +\newcommand\ProductBox@threeD@shadow{ + \begin{scope} + \foreach \x in {.5,1,1.5,2,2.5,3,4,5,6,8,10} { + \filldraw [black, + line width=\x mm, + rounded corners=2mm, + opacity=.01, + shift={(-1mm,1mm)}] + (0mm,0mm) -- + (-\ProductBox@p@top@xslant + *\ProductBox@p@left@xscale + *\ProductBox@z, + \ProductBox@p@top@yscale + *\ProductBox@z) -- + (0mm, + \ProductBox@p@top@yscale*\ProductBox@z + + \ProductBox@p@top@xslant + *\ProductBox@p@left@xscale + *\ProductBox@p@top@yslant + *\ProductBox@z) -- + cycle; + } + \end{scope} +} +% \end{macrocode} +% \end{macro} +% +% The following fading is used for the mirror effect in the 3D rendering. +% \begin{macrocode} +\tikzfading[name=ProductBoxFade, + top color=transparent!100, + bottom color=transparent!50, + middle color=transparent!100] +% \end{macrocode} +% \begin{macro}{\ProductBox@threeD@mirror} +% This macro defines the code to produce the mirror effect. +% \changes{1.1}{2010/12/27}{Code rewritten to make full use of tranparency.} +% \begin{macrocode} +\newcommand\ProductBox@threeD@mirror{% + \fill + node[anchor=south west, + inner sep=0pt, + yslant=\ProductBox@p@front@yslant, + xscale=\ProductBox@p@front@xscale, + yscale=-\ProductBox@p@mirror@yscale] + {\begin{tikzpicture} + \clip rectangle (\ProductBox@x, + \ProductBox@y*\ProductBox@p@mirror@yscale); + \fill node [scope fading=ProductBoxFade, + yscale=\ProductBox@p@mirror@yscale, + inner sep=0pt]{\copy\ProductBox@Front}; + \end{tikzpicture}}; + \fill[xshift=-\ProductBox@p@left@xscale*\ProductBox@z, + yshift=\ProductBox@p@top@yscale*\ProductBox@z] + node[anchor=south west, + inner sep=0pt, + yslant=-\ProductBox@p@left@yslant, + xscale=\ProductBox@p@left@xscale, + yscale=-\ProductBox@p@mirror@yscale] + {\begin{tikzpicture} + \clip rectangle (\ProductBox@z, + \ProductBox@y*\ProductBox@p@mirror@yscale); + \fill node [scope fading=ProductBoxFade, + yscale=\ProductBox@p@mirror@yscale, + inner sep=0pt]{\copy\ProductBox@Left}; + + \end{tikzpicture}}; +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ProductBox@threeD@flare} +% This macro defines the code to produce the flare effect. The +% flare is achieved with overlaying a partially transparent and +% fading circle of white color. +% \begin{macrocode} +\newcommand\ProductBox@threeD@flare{ + \fill [white,path fading=ProductBoxFlare] + (.8*\ProductBox@x,.9*\ProductBox@y) + circle(\ProductBox@flareDiameter); +} +% \end{macrocode} +% \end{macro} +% +% The following fading is used for the flare effect in the 3D rendering. +% \begin{macrocode} +\tikzfading[name=ProductBoxFlare, + inner color=transparent!60, + outer color=transparent!100] +% \end{macrocode} +% +% Finally we define some variant names. +% \begin{macrocode} +\@namedef{ProductBox@style@3D}{\ProductBox@style@threeD} +\@namedef{ProductBox@style@3d}{\ProductBox@style@threeD} +%</style> +% \end{macrocode} +% That's all. +% +% \newpage +% \setcounter{IndexColumns}2 +% \PrintChanges +% \newpage +% \PrintIndex +% \Finale +\endinput +% +% Local Variables: +% End: diff --git a/macros/latex/contrib/gene/productbox/productbox.ins b/macros/latex/contrib/gene/productbox/productbox.ins new file mode 100644 index 0000000000..f27c57bf31 --- /dev/null +++ b/macros/latex/contrib/gene/productbox/productbox.ins @@ -0,0 +1,46 @@ +%%------------------------------------------------------------------ +%% Driver file to extract the productbox style file. +%% +%% Copyright (C) 2010 Gerd Neugebauer +%% +%% productbox.ins is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY. No author or distributor accepts +%% responsibility to anyone for the consequences of using it or for +%% whether it serves any particular purpose or works at all, unless +%% he says so in writing. +%% +%% Everyone is granted permission to copy, modify and redistribute +%% productbox.ins, provided this copyright notice is preserved and +%% any modifications are indicated. +%% +%%------------------------------------------------------------------ +%% +%% Run this file through TeX or LaTeX to extract the files. +%% You need the docstrip package as distributed with LaTeX2e. +%% It is also available as seperate package from any CTAN site +%% (http://www.ctan.org). +%%------------------------------------------------------------------ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% $Id: productbox.ins 8333 2010-12-29 19:58:06Z gene $ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input docstrip.tex \keepsilent \askonceonly + +\generate{\file{productbox.sty}{\from{productbox.dtx}{style}} + } + +\Msg{****************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by (La)TeX:} +\Msg{*} +\Msg{* \space\space productbox.sty} +\Msg{*} +\Msg{* To produce the documentation run productbox.dtx through LaTeX,} +\Msg{* BibTeX, makeindex (for index and glossary), and LaTeX twice } +\Msg{* again.} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{****************************************************************} + +\endbatchfile +\endinput diff --git a/macros/latex/contrib/gene/productbox/productbox.pdf b/macros/latex/contrib/gene/productbox/productbox.pdf Binary files differnew file mode 100644 index 0000000000..d41b684054 --- /dev/null +++ b/macros/latex/contrib/gene/productbox/productbox.pdf |