From 0daeff73d32aacd49e6140586dd0f12601f2382f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Jan 2006 23:58:00 +0000 Subject: trunk/Master/texmf-dist/source/latex/statistik git-svn-id: svn://tug.org/texlive/trunk@527 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/statistik/sta_cvs-info.csv | 4 + .../source/latex/statistik/sta_xml-info.xml | 7 + .../source/latex/statistik/statistik.dtx | 558 +++++++++++++++++++++ .../source/latex/statistik/statistik.ins | 66 +++ 4 files changed, 635 insertions(+) create mode 100644 Master/texmf-dist/source/latex/statistik/sta_cvs-info.csv create mode 100644 Master/texmf-dist/source/latex/statistik/sta_xml-info.xml create mode 100644 Master/texmf-dist/source/latex/statistik/statistik.dtx create mode 100644 Master/texmf-dist/source/latex/statistik/statistik.ins (limited to 'Master/texmf-dist/source/latex/statistik') diff --git a/Master/texmf-dist/source/latex/statistik/sta_cvs-info.csv b/Master/texmf-dist/source/latex/statistik/sta_cvs-info.csv new file mode 100644 index 00000000000..97b14b0dd0e --- /dev/null +++ b/Master/texmf-dist/source/latex/statistik/sta_cvs-info.csv @@ -0,0 +1,4 @@ +1;^^d6sterreich;4 +2;B;2 +3;Kapitel C;4 +4;Kapitel D;1 diff --git a/Master/texmf-dist/source/latex/statistik/sta_xml-info.xml b/Master/texmf-dist/source/latex/statistik/sta_xml-info.xml new file mode 100644 index 00000000000..8acb57a019b --- /dev/null +++ b/Master/texmf-dist/source/latex/statistik/sta_xml-info.xml @@ -0,0 +1,7 @@ + + +1^^d6sterreich4 +2B2 +3Kapitel C4 +4Kapitel D1 + diff --git a/Master/texmf-dist/source/latex/statistik/statistik.dtx b/Master/texmf-dist/source/latex/statistik/statistik.dtx new file mode 100644 index 00000000000..b0f5ee5d57d --- /dev/null +++ b/Master/texmf-dist/source/latex/statistik/statistik.dtx @@ -0,0 +1,558 @@ +% \CheckSum{0} +% \iffalse meta comment +% File: statistik.dtx +% Copyright (C) 2003 Michael Niedermair +% +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +% +% \fi +% +% \iffalse +%<*driver> +\documentclass[a4paper]{ltxdoc} + \usepackage[latin1]{inputenc} + \usepackage[T1]{fontenc} + \usepackage{ngerman} + \usepackage{mathpazo} + \usepackage[scaled=0.95]{helvet} + \usepackage{courier} + \usepackage{expdlist,booktabs} + \newcommand{\bs}{$\backslash$} + \GetFileInfo{statistik.dtx} + \title{Statistiken über Kapitel erstellen} + \author{Michael Niedermair\thanks{Michael Niedermair m.g.n@gmx.de}} + \date{2003--04--05} + \begin{document} + \maketitle + \DocInput{statistik.dtx} + \end{document} +% +% \fi +% +% \begin{abstract} +% \noindent Mit dem Paket \emph{statistik} werden die Seiten pro Kapitel gezählt und +% auf verschiedene Weise in einer extra Datei ausgegeben. +% \end{abstract} +% +% \section{Paket einbinden} +% +% Das Paket wird über +% \begin{verbatim} +% \usepackage[]{statistik} +% \end{verbatim} +% eingebunden. +% +% +% +% +% +% \section{Optionen} +% +% Dabei stehen folgende Optionen zur Verfügung: +% +% \begin{description}[\compact\setlabelphantom{xmlencoding}] +% \item [textable] +% Hierbei wird eine eigenständige \LaTeX--Datei erzeugt, die in einer +% Tabelle die entsprechenden Kapitel und deren Seitenzahlen enthält. +% +% \begin{tabular}{@{}clc@{}} +% Nummer & Titel & Seiten \\ \midrule +% 1 & Österreich & 4 \\ +% 2 & B & 2 \\ +% 3 & Kapitel C & 4 \\ +% 4 & Kapitel D & 1 \\ +% \end{tabular}\\ +% +% \item [table] +% Wie \emph{textable}, jedoch wird nur die reine Tabelle in die Datei geschrieben, +% so dass diese über \verb|\input{}| eingebunden werden kann. +% +% \item [csv] +% Die Daten werden in eine CSV-Datei (\textbf{C}omma \textbf{S}eparated \textbf{V}alue) +% geschrieben, so dass diese mit einem Tabellenkalkulationsprogramm weiter +% verarbeitet werden können. +% +%\begin{verbatim} +%1;Österreich;4 +%2;B;2 +%3;Kapitel C;4 +%4;Kapitel D;1 +%\end{verbatim} +% +% \item [xml] +% Die Daten werden in eine XML-Datei geschrieben. Dabei werden aber keine +% Entitäten, Sonderzeichen, etc.\ berücksichtigt. +% +%\begin{verbatim} +% +% +% +% 1Österreich4 +% +% +% 2B2 +% +% +% 3Kapitel C4 +% +% +% 4Kapitel D1 +% +%\end{verbatim} +% +% \item [encoding] +% Legt das Encoding für die \LaTeX--Datei fest. Als Standard wird hier +% \verb|latin1| verwendet. +% +% \item [xmlencoding] +% Legt das Encoding für die XML--Datei fest. Als Standard wird hier +% \verb|ISO-8859-1| verwendet. +% +% \end{description} +% +% \section{Beispiele} +% +% Folgende Beispieldateien sind vorhanden: +% \begin{description}[\compact\setlabelphantom{sta\_mytable.tex }] +% \item [sta\_textable.tex] Beispiel für die Option \verb|textable|. +% \item [sta\_tab.tex] Beispiel für die Option \verb|table|. +% \item [sta\_csv.tex] Beispiel für die Option \verb|csv|. +% \item [sta\_xml.tex] Beispiel für die Option \verb|xml|. +% \item [sta\_mytable.tex] Beispiel, welches den Output entsprechend anpasst. +% \end{description} +% +% +% +% +% +% \section{Anpassung der Ausgabe} +% +% Mit nachfolgenden Befehlen wird gesteuert, wie die Ausgabe erzeugt wird. +% +% \begin{description}[\compact\setlabelphantom{\bs stafilename}] +% \item [\bs stafilename] +% Legt den Dateinamen für die erzeugte Ausgabedatei fest. Der Standard +% ist hier der aktuelle Jobname mit den Anhang '-info.tex': +%\begin{verbatim} +%\renewcommand{\stafilename}{\jobname-info.tex} +%\end{verbatim} +% +% \item [\bs staheader] +% Legt fest, was als Header am Anfang in die Datei geschrieben wird. +%\begin{verbatim} +%\renewcommand{\staheader}{% +% \string\documentclass{article}^^J% +% \string\usepackage[\staenconding]\string{inputenc\string}^^J% +% \string\usepackage[ngerman]{babel}^^J% +% \string\begin{document}^^J% +% \string\begin{tabular}{|c|l|c|}\string\hline^^J% +% Nummer & Titel & Seiten \string\\\string\hline\string\hline% +%} +%\end{verbatim} +% +% \item [\bs statabline] +% Legt fest, was nach jeder Tabellenzeile in die Datei geschrieben werden +% soll, zum Beispiel \verb|\hline| etc. +%\begin{verbatim} +%\renewcommand{\statabline}{} +%\end{verbatim} +% +% \item [\bs stafoot] +% Legt fest, was am Ende (nach der Tabelle) in die Datei geschrieben werden +% soll. +%\begin{verbatim} +%\renewcommand{\stafoot}{% +% \string\hline^^J% +% \string\end{tabular}^^J% +% \string\end{document}^^J% +%} +%\end{verbatim} +% +% \item [\bs stabody] +% Legt fest, was in jede Tabellezeile geschrieben werden soll. Der Befehl +% erhält drei Parameter (Kapitelnummer, Kapiteltitel und Seitenzahl). +%\begin{verbatim} +%\renewcommand{\stabody}[3]{% +% #1 & #2 & #3 \string\\\statabline% +%} +%\end{verbatim} +% +% \end{description} +% +% \section{Der Code} +% +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{statistik} + [2003/04/05 v0.03 Statistiken über Kapitel erstellen (mgn)] +% \end{macrocode} +% \subsection*{benötigte Pakete} +% Das Paket \emph{keyval} wird für die Parameterübergabe benötigt. +% \begin{macrocode} +\RequirePackage{keyval} +% \end{macrocode} +% \subsection*{Befehle für die einzelnen Ausgaben} +% Legt den Dateinamen für die Ausgabedatei fest. +% \begin{macrocode} +\newcommand{\stafilename}{\jobname-info.tex} +% \end{macrocode} +% Legt das Encoding für die \LaTeX--Datei fest. +% \begin{macrocode} +\newcommand{\staenconding}{latin1} +% \end{macrocode} +% Legt das Encoding für die XML--Datei fest. +% \begin{macrocode} +\newcommand{\staxmlencoding}{ISO-8859-1} +% \end{macrocode} +% Befehl, der den Datei--Header erzeugt. +% \begin{macrocode} +\newcommand{\staheader}{} +% \end{macrocode} +% Befehl, der den Datei--Foot erzeugt. +% \begin{macrocode} +\newcommand{\stafoot}{} +% \end{macrocode} +% Befehl, der die Zeilen für jedes Kapitel erzeugt. +% \begin{macrocode} +\newcommand{\stabody}[3]{% +#1 #2 #3 ^^J% +} +% \end{macrocode} +% Befehl, der das Zeilenende (nach \verb|\stabody|) erzeugt. +% \begin{macrocode} +\newcommand{\statabline}{} +% \end{macrocode} +% Befehl, der Befehle bei \verb|AtBeginDocument| hinzufügt. +% \begin{macrocode} +\newcommand{\stabegincommand}{} +% \end{macrocode} +% \subsection*{Optionen} +% \subsubsection*{encoding} +% \begin{macrocode} +\define@key{Sta}{encoding}[latin1]{\renewcommand{\staenconding}{#1}} +% \end{macrocode} +% \subsubsection*{xmlencoding} +% \begin{macrocode} +\define@key{Sta}{xmlencoding}[ISO-8859-1]{% + \renewcommand{\staxmlenconding}{#1}} +% \end{macrocode} +% \subsubsection*{textable} +% \begin{macrocode} +\define@key{Sta}{textable}[true]{% + \renewcommand{\stafilename}{\jobname-info.tex} + \renewcommand{\staheader}{% + \string\documentclass{article}^^J% + \string\usepackage[\staenconding]\string{inputenc\string}^^J% + \string\usepackage[ngerman]{babel}^^J% + \string\begin{document}^^J% + \string\begin{tabular}{|c|l|c|}\string\hline^^J% + Nummer & Titel & Seiten \string\\\string\hline\string\hline% + } + \renewcommand{\statabline}{} + \renewcommand{\stafoot}{% + \string\hline^^J% + \string\end{tabular}^^J% + \string\end{document}^^J% + } + \renewcommand{\stabody}[3]{% + ##1 & ##2\space & ##3 \string\\\statabline% + } + \renewcommand{\stabegincommand}{% + \AtBeginDocument{% + \WrtStatistik{\staheader}% + \AtEndDocument{% + \clearpage\ShowPagesOfThisChapter{}% + \WrtStatistik{\stafoot}% + }% + } + } +} +% \end{macrocode} +% \subsubsection*{table} +% \begin{macrocode} +\define@key{Sta}{table}[true]{% + \renewcommand{\stafilename}{\jobname-info.tex} + \renewcommand{\staheader}{% + \string\begin{tabular}{|c|l|c|}\string\hline^^J% + Nummer & Titel & Seiten \string\\\string\hline\string\hline% + } + \renewcommand{\statabline}{} + \renewcommand{\stafoot}{% + \string\hline^^J% + \string\end{tabular}^^J% + } + \renewcommand{\stabody}[3]{% + ##1 & ##2\space & ##3 \string\\\statabline% + } + \renewcommand{\stabegincommand}{% + \AtBeginDocument{% + \WrtStatistik{\staheader}% + \AtEndDocument{% + \clearpage\ShowPagesOfThisChapter{}% + \WrtStatistik{\stafoot}% + }% + } + } +} +% \end{macrocode} +% \subsubsection*{csv} +% \begin{macrocode} +\define@key{Sta}{csv}[true]{% + \renewcommand{\stafilename}{\jobname-info.csv} + \renewcommand{\staheader}{} + \renewcommand{\stafoot}{} + \renewcommand{\stabody}[3]{##1;##2;##3} + \renewcommand{\statabline}{} + \renewcommand{\stabegincommand}{% + \AtEndDocument{\clearpage\ShowPagesOfThisChapter{}} + } +} +% \end{macrocode} +% \subsubsection*{xml} +% \begin{macrocode} +\define@key{Sta}{xml}[true]{% + \renewcommand{\stafilename}{\jobname-info.xml} + \renewcommand{\staheader}{% + ^^J} + \renewcommand{\stafoot}{} + \renewcommand{\stabody}[3]{% + ##1##2##3} + \renewcommand{\statabline}{} + \renewcommand{\stabegincommand}{% + \AtBeginDocument{% + \WrtStatistik{\staheader}% + \AtEndDocument{\clearpage\ShowPagesOfThisChapter{}% + \WrtStatistik{\stafoot}% + }% + }% + } +} +% \end{macrocode} +% \subsubsection*{Verarbeitung der Aufrufparameter} +% \begin{macrocode} +\def\ProcessOptionsWithKV#1{% + \let\@tempc\relax + \let\Sta@tempa\@empty + \@for\CurrentOption:=\@classoptionslist\do{% + \@ifundefined{KV@#1@\CurrentOption}% + {}% + {\edef\Sta@tempa{\Sta@tempa,\CurrentOption,}}% + }% + \edef\Sta@tempa{% + \noexpand\setkeys{#1}{% + \Sta@tempa\@ptionlist{\@currname.\@currext}% + }% + }% + \Sta@tempa +} +% +\ProcessOptionsWithKV{Sta} +\AtEndOfPackage{% + \let\@unprocessedoptions\relax +} +% \end{macrocode} +% \subsection*{Der Hauptteil} +% \begin{macrocode} +\newwrite\Statistik +\immediate +\openout\Statistik=\stafilename +\stabegincommand +\newcommand*{\WrtStatistik}{\immediate\write\Statistik} +\newcounter{lastchapterfirstpage}\setcounter{lastchapterfirstpage}{-1} +\newcounter{lastchapterpages} +\newcommand*{\Orig@Chapter}{} +\let\Orig@Chapter=\chapter +\newcommand*\TitleOfLastChapter{} +\newcommand*\XTitleOfLastChapter{} +\newcommand*{\ShowPagesOfThisChapter}[2][\thechapter]{% + \ifnum \value{lastchapterfirstpage}>-1 + \setcounter{lastchapterpages}{\value{page}}% + \addtocounter{lastchapterpages}{-\value{lastchapterfirstpage}}% + \WrtStatistik{\stabody{#1}{\XTitleOfLastChapter}{\thelastchapterpages}}% + \fi + \renewcommand*{\TitleOfLastChapter}{#2}% + \expandafter\edef\expandafter\XTitleOfLastChapter\expandafter{% + \expandafter\strip@prefix\meaning\TitleOfLastChapter}% +} +% \end{macrocode} +% Dies ist der meaning-Trick (von Markus Kohm; Danke Dir), damit das auch mit Umlauten noch klappt. +% ``Anfänger mögen beachten, dass man \verb|\expandafter| geschickt einstreuen kann +% und keineswegs Dutzende \verb|\expandafter| hintereinander schreiben muss (was +% ich oft gesehen habe, aber nur extrem selten nötig war).'' +% \begin{macrocode} +\newcommand*{\St@schapter}[1]{% + \ShowPagesOfThisChapter{#1}% + \setcounter{lastchapterfirstpage}{\value{page}}% + \Orig@Chapter*{#1}} +\newcommand*{\St@chapter}[2][]{% + \ShowPagesOfThisChapter{#1}% oder #2 für den langen Titel + \setcounter{lastchapterfirstpage}{\value{page}}% + \Orig@Chapter[{#1}]{#2}} +\renewcommand*{\chapter}{% + \if@twoside\cleardoublepage\else\clearpage\fi + \secdef\St@chapter\St@schapter +} +% \end{macrocode} +% \begin{macrocode} +% +% \end{macrocode} +% +% \Finale +% +% \iffalse +%<*stacvs> +\documentclass{book} + +\usepackage[latin1]{inputenc} + +\usepackage[csv]{statistik} + +\begin{document} +\chapter{Österreich} +\clearpage +\null\clearpage +\null\clearpage +\chapter{B} +\clearpage +\null\clearpage +\chapter{Kapitel C} +\clearpage +\null\clearpage +\null\clearpage +\null\clearpage +\chapter{Kapitel D} +\end{document} +% +% +%<*staxml> +\documentclass{book} + +\usepackage[latin1]{inputenc} + +\usepackage[xml]{statistik} + +\begin{document} +\chapter{Österreich} +\clearpage +\null\clearpage +\null\clearpage +\chapter{B} +\clearpage +\null\clearpage +\chapter{Kapitel C} +\clearpage +\null\clearpage +\null\clearpage +\null\clearpage +\chapter{Kapitel D} +\end{document} +% +% +%<*statextable> +\documentclass{book} + +\usepackage[latin1]{inputenc} + +\usepackage[textable]{statistik} + +\begin{document} +\chapter{Österreich} +\clearpage +\null\clearpage +\null\clearpage +\chapter{B} +\clearpage +\null\clearpage +\chapter{Kapitel C} +\clearpage +\null\clearpage +\null\clearpage +\null\clearpage +\chapter{Kapitel D} +\end{document} +% +% +%<*statab> +\documentclass{book} + +\usepackage[latin1]{inputenc} + +\usepackage[table]{statistik} + +\begin{document} +\chapter{Österreich} +\clearpage +\null\clearpage +\null\clearpage +\chapter{B} +\clearpage +\null\clearpage +\chapter{Kapitel C} +\clearpage +\null\clearpage +\null\clearpage +\null\clearpage +\chapter{Kapitel D} +\end{document} +% +% +%<*stamytable> +\documentclass{book} + +\usepackage[latin1]{inputenc} + +\usepackage[textable]{statistik} + +\renewcommand{\staheader}{% + \string\documentclass{article}^^J% + \string\usepackage[\staenconding]\string{inputenc\string}^^J% + \string\usepackage[ngerman]{babel}^^J% + \string\usepackage{booktabs}^^J% + \string\begin{document}^^J% + \string\begin{tabular}{@{}clc@{}}\string\toprule^^J% + Kapitel--Nummer & Kapitel--Text & Seitenanzahl \string\\\string\midrule% +} +\renewcommand{\stafoot}{% + \string\bottomrule^^J% + \string\end{tabular}^^J% + \string\end{document}^^J% +} + +\begin{document} +\chapter{Österreich} +\clearpage +\null\clearpage +\null\clearpage +\chapter{B} +\clearpage +\null\clearpage +\chapter{Kapitel C} +\clearpage +\null\clearpage +\null\clearpage +\null\clearpage +\chapter{Kapitel D} +\end{document} +% +% \fi +% +\endinput +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: + + diff --git a/Master/texmf-dist/source/latex/statistik/statistik.ins b/Master/texmf-dist/source/latex/statistik/statistik.ins new file mode 100644 index 00000000000..226e1136231 --- /dev/null +++ b/Master/texmf-dist/source/latex/statistik/statistik.ins @@ -0,0 +1,66 @@ +%% +%% statistik.ins -- Installationsdatei für statistik.sty +%% Copyright (C) 2003 Michael Niedermair +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU General Public License as published by +%% the Free Software Foundation; either version 2 of the License, or +%% (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\batchfile{statistik.ins} +\input docstrip.tex +\preamble + +statistik.sty -- Statistiken über Kapitel erstellen +Copyright (C) 2003 Michael Niedermair + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +\endpreamble +\usedir{tex/latex/misc} +\keepsilent + +\generate{\file{statistik.sty}{\from{statistik.dtx}{package}}} +\generate{\file{sta_cvs.tex}{\from{statistik.dtx}{stacvs}}} +\generate{\file{sta_xml.tex}{\from{statistik.dtx}{staxml}}} +\generate{\file{sta_tab.tex}{\from{statistik.dtx}{statab}}} +\generate{\file{sta_textable.tex}{\from{statistik.dtx}{statextable}}} +\generate{\file{sta_mytable.tex}{\from{statistik.dtx}{stamytable}}} + +\Msg{***********************************************************************} +\Msg{* } +\Msg{* 1. Kopieren Sie die Datei statistik.sty nach /tex/latex/misc } +\Msg{* (ls-R Datenbank erneuern!) } +\Msg{* 2. Dokumentation erstellen } +\Msg{* latex statistik.dtx oder pdflatex statistik.dtx } +\Msg{* 3. Beispiele ausprobieren } +\Msg{* latex sta_textable.tex oder pdflatex sta_textable.tex } +\Msg{* latex sta_textable-info.tex oder pdflatex sta_textable-info.tex } +\Msg{* } +\Msg{* Happy TeXing } +\Msg{***********************************************************************} + +\endbatchfile -- cgit v1.2.3