Commit 6277b0d3 authored by rohieb's avatar rohieb
Browse files

basic packaging with docstrip, documentation still TBD

parent 513f9d23
% s0artcl.cls
% Stratum 0 CI -- article class
% 2016-Dec-07 Roland Hieber <rohieb+stratum0-latex-qua1aiMe@rohieb.name>
%
% Heavily inspired by Jim Hefferon's "Minutes in Less Than Hours":
% http://tutex.tug.org/pracjourn/2005-4/hefferon/hefferon.pdf
% --- Class structure: identification part
% ---
\ProvidesClass{s0artcl}[2016/12/07 version 1.00 Stratum 0 Corporate Identity -- Article]
\NeedsTeXFormat{LaTeX2e}
% --- Class structure: declaration of options part
% ---
% This class extends the scrartcl class
% Pass default options to scrartcl:
% \iffalse this-is-a-meta-comment-intended-for-humans
%
% Copyright (C) 2017 Roland Hieber <rohieb+latex@rohieb.name>
%
% This file 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.
%
% \fi
%
\def\thisclass{s0artcl}
\def\thisfile{\thisclass.dtx}
% \iffalse
%<*driver>
\ProvidesFile{\thisfile}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{\thisclass}
%<*class>
[2017/02/21 v1.00 Stratum 0 Corporate Identity -- Article]
%</class>
%
%<*driver>
\documentclass{scrdoc}
\usepackage{hyperref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{\thisfile}
\end{document}
%</driver>
% \fi
%
% \changes{v1.0}{2017/02/21}{Initial version}
%
% \GetFileInfo{\thisfile}
%
% \title{The \textsf{\thisclass} class\thanks{This document corresponds to
% \textsf{\thisclass}~\fileversion, dated \filedate.}}
% \author{Roland Hieber \\ \url{rohieb+stratum0-latex-qua1aiMe@rohieb.name>}}
%
% \maketitle
% \tableofcontents
%
% \section{Introduction}
% This document class is part of the Stratum 0 Corporate Identity and can be used to
% typeset general documents.
%
% \section{Package Options}
% This class extends the \textsf{scrartcl} class, and knows every option that \textsf{scrartcl}
% knows. Refer to the \textsf{KOMA-Script} manual for more information.
%
% \StopEventually{\PrintChanges}
%
% \section{Implementation}
% \subsection{Option Parsing}
% Pass default options to \textsf{scrartcl}:
% \begin{macrocode}
\PassOptionsToClass{a4paper}{scrartcl}
\PassOptionsToClass{11pt}{scrartcl}
\PassOptionsToClass{parskip=half-}{scrartcl}
% Read all the documentclass options; pass them to article,
% unless the file "<currentoption>.s0c" exists, then it is loaded
% \end{macrocode}
%
% Read all the documentclass options; pass them to \textsf{scrartcl}, unless the file
% |<currentoption>.s0c| exists, then it is loaded.
% \begin{macrocode}
\DeclareOption*{\InputIfFileExists{\CurrentOption.s0c}{}{%
\PassOptionsToClass{\CurrentOption}{scrartcl}}}
% --- Class structure: execution of options part
% ---
\ProcessOptions \relax
% --- Class structure: declaration of options part
% ---
\LoadClass{scrartcl}
% --- Helper packages
% ---
% \end{macrocode}
%
% \subsection{General Helper Packages}
% \begin{macrocode}
\RequirePackage{xpatch}
\RequirePackage{hyperref}
\hypersetup{unicode=true,colorlinks=false,pdfborder=0 0 0}
\urlstyle{sf}
% --- Page Layout
% ---
% \end{macrocode}
%
% \subsection{Page Layout}
% \begin{macrocode}
\RequirePackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2.5cm]{geometry}
% -- Optimize vertical spacing
% --
% \end{macrocode}
%
% \subsection{Optimize Vertical Spacing}
% \begin{macrocode}
\RedeclareSectionCommand[afterskip=0.5em]{section}
\RedeclareSectionCommand[beforeskip=.5\parskip, afterskip=-1em]{paragraph}
\setlength{\parindent}{0em}
\RequirePackage{enumitem}
\setlist{nosep}
\RequirePackage{tocloft}
\setlength{\cftbeforesecskip}{0.3\baselineskip}
% tocloft renders the table of contents header in serif font...
% \end{macrocode}
%
% \textsf{tocloft} renders the table of contents header in serif font...
% \begin{macrocode}
\renewcommand{\cfttoctitlefont}{\usekomafont{section}}
% --- Default Fonts
% ---
% \end{macrocode}
%
% \subsection{Default Fonts}
% Yanone Kaffeesatz ZeroHack for titles etc.
% \begin{macrocode}
\RequirePackage{yanonekaffeesatzzerohack}
\setkomafont{title}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{b}{n}}
\setkomafont{subtitle}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{l}{n}\Large}
\setkomafont{subject}{\normalfont\large}
\setkomafont{author}{\normalfont\large}
\setkomafont{date}{\normalfont\large}
% koma-script has an explicit \usekomafont{title}{\huge \@title}...
% see http://tex.stackexchange.com/a/82851
\makeatletter
% \end{macrocode}
%
% Workaround because \textsf{KOMA-Script} has an explicit |\huge\@title| in |\maketitle|\ldots
% (see \url{http://tex.stackexchange.com/a/82851})
% \begin{macrocode}
\xpatchcmd{\maketitle}{\huge}{\Huge}{}{}
\xpatchcmd{\@maketitle}{\huge}{\Huge}{}{}
\makeatother
\setkomafont{section}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{b}{n}\huge}
\setkomafont{subsection}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{l}{n}\LARGE}
% yanonekaffeesatzzerohack really needs a [nodefault] option...
% \end{macrocode}
%
% \textsf{yanonekaffeesatzzerohack} really needs a \oarg{nodefault} option...
% \begin{macrocode}
\renewcommand*{\encodingdefault}{T1}
% Droid for all the rest
% \end{macrocode}
%
% Droid for all the rest:
% \begin{macrocode}
\RequirePackage[default]{droidsans}
\RequirePackage[defaultmono]{droidmono}
\makeatletter
% \end{macrocode}
%
% \Finale
\endinput
% vim: set tw=100 noet sw=2 ts=2 sts=2:
% s0minutes.cls
% Stratum 0 CI -- meeting minutes
% 2016-Dec-15 Roland Hieber <rohieb+stratum0-latex-qua1aiMe@rohieb.name>
%
% Heavily inspired by Jim Hefferon's "Minutes in Less Than Hours":
% http://tutex.tug.org/pracjourn/2005-4/hefferon/hefferon.pdf
% --- Class structure: identification part
% ---
\ProvidesClass{s0minutes}[2016/12/15 version 1.00 Stratum 0 Corporate Identity -- Meeting Minutes]
\NeedsTeXFormat{LaTeX2e}
% --- Class structure: declaration of options part
% ---
% This class extends the article class
% Read all the documentclass options; pass them to article,
% unless the file "<currentoption>.s0c" exists, then it is loaded
% \iffalse this-is-a-meta-comment-intended-for-humans
%
% Copyright (C) 2017 Roland Hieber <rohieb+latex@rohieb.name>
%
% This file 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.
%
% \fi
%
\def\thisclass{s0minutes}
\def\thisfile{\thisclass.dtx}
% \iffalse
%<*driver>
\ProvidesFile{\thisfile}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{\thisclass}
%<*class>
[2017/02/21 v1.00 Stratum 0 Corporate Identity -- Meeting Minutes]
%</class>
%
%<*driver>
\documentclass{scrdoc}
\usepackage{hyperref}
\usepackage{color}
\usepackage{todo}
\def\todomark{\textsc{Fixme}}
\def\todoformat{\color{red}}
\makeatletter\let\@tododisplay\relax\makeatother
\EnableCrossrefs
\CodelineIndex
\RecordChanges
%\OnlyDescription
\begin{document}
\DocInput{\thisfile}
\todos
\end{document}
%</driver>
% \fi
%
% \changes{v1.0}{2017/02/21}{Initial version}
%
% \GetFileInfo{\thisfile}
%
% \title{The \textsf{\thisclass} class\thanks{This document corresponds to
% \textsf{\thisclass}~\fileversion, dated \filedate.}}
% \author{Roland Hieber \\ \url{rohieb+stratum0-latex-qua1aiMe@rohieb.name>}}
%
% \maketitle
% \tableofcontents
%
% \section{Introduction}
% This document class can be used to typeset meeting minutes in the Stratum~0 Corporate Identity.
% The macros correspond to version \Todo{FIX VERSION}of the
% \href{https://github.com/rohieb/minutes-m4rkup}{\textsf{minutes-m4rkup}} specification.
%
% \section{Package Options}
% This class extends the \textsf{s0artcl} class, and knows every option that \textsf{s0artcl}
% knows. Refer to its manual for more information.
%
% \StopEventually{\PrintChanges}
% \section{Implementation}
% \subsection{Option Parsing}
% \begin{macrocode}
\DeclareOption*{\InputIfFileExists{\CurrentOption.s0c}{}{%
\PassOptionsToClass{\CurrentOption}{s0artcl}}}
% --- Class structure: execution of options part
% ---
\ProcessOptions \relax
% --- Class structure: declaration of options part
% ---
\LoadClass{s0artcl}
% -- Helper packages
% --
% \end{macrocode}
%
% \subsection{General Helper Packages}
% \begin{macrocode}
\RequirePackage{xifthen} % \isempty test
\RequirePackage{framed} % leftbar environment etc.
\RequirePackage{framed} % resolution rendering etc.
\RequirePackage{dingbat} % \leftthumbsup etc.
\RequirePackage[svgnames,table]{xcolor}
% -- Tweak section numbering
% set table of contents number field to max width of section numbers
% \end{macrocode}
% Tweak section numbering, set table of contents number field to max width of section numbers:
% \begin{macrocode}
\let\theoldsection\thesection
\renewcommand*{\thesection}{TOP \theoldsection}
\setcounter{section}{-1} % Real hackers start counting at 0
\setcounter{section}{-1} % Real hackers(TM) start counting at 0
\settowidth{\cftsecnumwidth}{TOP 10 }
\settowidth{\cftsubsecnumwidth}{TOP 1.10 }
% -- Heading and footer setup
% --
% \end{macrocode}
%
% \subsection{Heading and Footer Setup}
% \Todo{Convert this to \textsf{scrheadings}}
% \begin{macrocode}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\pagestyle{fancy}
......@@ -52,10 +103,10 @@
\lfoot{}
\cfoot{Seite \thepage\ von \pageref{LastPage}}
\rfoot{}
% -- User Commands and Environments
% --
% \end{macrocode}
%
% \section{User Commands and Environments}
% \DescribeMacro{\meetingminutes}
% Meeting information, to be used in the preamble:
% 1. Type of the meeting (e.g., board meeting, general meeting, etc.)
% 2. Date of the meeting
......@@ -64,7 +115,7 @@
% 5. (List of) attending people
% 6. (List of) absent people, if any
% 7. Name of minute taker
\makeatletter
% \begin{macrocode}
\newcommand*{\meetingminutes}[7]{%
\def\sn@typeofmeeting{#1}%
\def\sn@date{#2}%
......@@ -179,5 +230,8 @@ Es gibt keine weiteren Tagesordnungspunkte. Die Versammlung wird geschlossen.
\newcommand{\question}[2][]{\textbf{Frage\ifthenelse{\isempty{#1}}{}{ (#1)}:\hspace{1ex}}#2 \\}
\newcommand{\answer}[2][]{\textbf{Antwort\ifthenelse{\isempty{#1}}{}{ (#1)}:\hspace{1ex}}#2}
\makeatother
% \end{macrocode}
% \Finale
\endinput
% vim: set tw=100 noet sw=2 ts=2 sts=2:
% vim: set tw=100 noet sw=2 ts=2 sts=2:
%%
%% Copyright (C) 2017 Roland Hieber <rohieb+latex@rohieb.name>
%%
%% This file 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.
%%
\input docstrip.tex
\keepsilent
\usedir{tex/latex/stratum0-latex}
\askforoverwritefalse
\preamble
Copyright (C) 2017 Roland Hieber <rohieb+latex@rohieb.name>
This file 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.
\endpreamble
\generate{\file{s0artcl.cls}{\from{s0artcl.dtx}{class}}}
\generate{\file{s0minutes.cls}{\from{s0minutes.dtx}{class}}}
\endbatchfile
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment