% This class file is provided 'as is' in the event that someone % wants to compile the documentation that comes with my packages. % It is not intended for any other purpose, although you may freely % copy the code here to another file and modify it for your own purposes. % There's no guarantee that it will work with other packages. % % Copyright 2013 Nicola Talbot % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license of (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. \NeedsTeXFormat{LaTeX2e} \ProvidesClass{nlctdoc}[2016/11/07 v1.05 (NLCT)] \RequirePackage{ifpdf} % tex4ht stopped working with koma during TL2013. % Use pdflatex with koma for the pdf version % and latex with one of the base classes for the html % version to circumvent this. \ifpdf \def\@nlctdoc@class{scrartcl}% \else \def\@nlctdoc@class{article}% \fi \DeclareOption{article}{% \ifpdf \def\@nlctdoc@class{scrartcl}% \else \def\@nlctdoc@class{article}% \fi } \DeclareOption{book}{% \ifpdf \def\@nlctdoc@class{scrbook}% \else \def\@nlctdoc@class{book}% \fi } \DeclareOption{report}{% \ifpdf \def\@nlctdoc@class{scrreprt}% \else \def\@nlctdoc@class{report}% \fi } \DeclareOption{a5paper}{\@latexerr{Option not supported}% {}} \newcommand*{\nlct@setupmargin}{} \DeclareOption{normalmp}{% \renewcommand*{\nlct@setupmargin}{% \normalmarginpar \renewcommand*{\nlctdocmarginfmt}{\raggedright}% }% } \newif\ifnlctdocinlinetitle \nlctdocinlinetitlefalse \DeclareOption{inlinetitle}{\nlctdocinlinetitletrue} \newif\ifwidecs \widecsfalse \DeclareOption{widecs}{\widecstrue} \DeclareOption*{% \PassOptionsToClass {\CurrentOption}{\@nlctdoc@class}} \ProcessOptions \ifpdf \ifnlctdocinlinetitle \LoadClass[captions=tableheading,abstract=true,titlepage=false]{\@nlctdoc@class} \else \LoadClass[captions=tableheading,abstract=true]{\@nlctdoc@class} \fi \else \LoadClass{\@nlctdoc@class} \fi \RequirePackage{xcolor} \RequirePackage[utf8]{inputenc} \ifpdf \RequirePackage[T1]{fontenc} \RequirePackage{cmap} \RequirePackage{fourier} \else \RequirePackage[xhtml,fn-in,css-in,uni-html4,utf8]{tex4ht} \fi \RequirePackage{etoolbox} \RequirePackage{doc,dox} \RequirePackage{upquote} % doc.sty interferes with upquote.sty so patch it \def\@verbatim{\trivlist \item[]\if@minipage\else\vskip\parskip\fi \leftskip\@totalleftmargin\rightskip\z@ \parindent\z@\parfillskip\@flushglue\parskip\z@ \@@par \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par \penalty\interlinepenalty \check@percent}% \obeylines \@noligs \let\do\@makeother \dospecials} \newcommand*{\nlctdocmarginfmt}{\raggedleft} \nlct@setupmargin \def\@@doxdescribe#1#2{% \endgroup% \ifdox@noprint\else% \marginpar{\nlctdocmarginfmt\@nameuse{PrintDescribe#1}{#2}}% \fi% \ifdox@noindex\else% \@nameuse{Special#1Index}{#2}% \fi% \endgroup% \@esphack\ignorespaces} \DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} \providecommand\marg[1]{% \allowbreak{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} \providecommand\oarg[1]{% \allowbreak{\ttfamily[}\meta{#1}{\ttfamily]}} \providecommand\parg[1]{% \allowbreak{\ttfamily(}\meta{#1}{\ttfamily)}} \def\PrintChanges{\@input@{\jobname.gls}% \global\let\PrintChanges\@empty} \let\RecordChanges\makeglossary \def\main#1{\underline{\hyperpage{#1}}} \def\usage#1{\textit{\hyperpage{#1}}} \def\SortIndex#1#2{\index{#1\actualchar#2\encapchar hyperpage}} \newcommand*{\SpecialPageIndex}[1]{\@bsphack \index{#1\encapchar hyperpage}\@esphack} \renewcommand*\PageIndex{\makeindex \codeline@indexfalse \let\special@index\SpecialPageIndex} \ifdef\chapter { \renewcommand*\glossary@prologue{% \chapter*{{Change History}}% \markboth{{Change History}}{{Change History}}% \addcontentsline{toc}{chapter}{Change History}% \raggedright\sloppy } \def\index@prologue{\chapter*{Index}% \markboth{Index}{Index}% \addcontentsline{toc}{chapter}{Index}% Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the \ifcodeline@index code line of the \fi definition; numbers in roman refer to the \ifcodeline@index code lines \else pages \fi where the entry is used. } } { \renewcommand*\glossary@prologue{% \section*{{Change History}}% \markboth{{Change History}}{{Change History}}% \addcontentsline{toc}{section}{Change History}% \raggedright\sloppy } \def\index@prologue{\section*{Index}% \markboth{Index}{Index}% \addcontentsline{toc}{section}{Index}% Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the \ifcodeline@index code line of the \fi definition; numbers in roman refer to the \ifcodeline@index code lines \else pages \fi where the entry is used. } } \ifwidecs \else \setlength\marginparwidth{8pc} \fi \renewcommand*{\changes@}[3]{% \protected@edef\@tempa{\noexpand\glossary{#1 (#2)\levelchar \ifx\saved@macroname\@empty \space \actualchar \generalname \else \expandafter\@gobble \saved@macroname \actualchar \string\verb\quotechar*% \verbatimchar\saved@macroname \verbatimchar \fi :\levelchar #3}}% \@tempa\endgroup\@esphack} \newcommand{\see}[2]{\emph{see} #1} \RecordChanges \PageIndex \CodelineNumbered \newcommand{\importantsymbol}{\bfseries\Huge\danger} \newcommand\Describe@Wide@Macro[1]{% \endgroup \marginpar{\raggedright\hbox to\marginparwidth{\PrintDescribeMacro{#1}}\par}% \SpecialUsageIndex{#1}\@esphack \ignorespaces } \newlength\macrowidth \ifpdf \definecolor{defbackground}{rgb}{1,1,0.75} \newsavebox\defsbox \newlength\defwidth \newenvironment{definition}[1][]{% \def\defarg{#1}% \setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}% \begin{lrbox}{\defsbox}% \setlength\defwidth\linewidth \addtolength\defwidth{-2\fboxrule}% \addtolength\defwidth{-2\fboxsep}% \begin{minipage}{\defwidth}\flushleft\ttfamily }{% \end{minipage} \end{lrbox}% \vskip10pt \noindent \ifwidecs \let\Describe@Macro\Describe@Wide@Macro \defarg \nopagebreak\mbox{}\nopagebreak \par\nopagebreak\vspace{0.5ex plus 0.25ex minus 0.1ex}\nopagebreak\noindent \else \defarg \fi \fcolorbox{black}{defbackground}{\usebox\defsbox}% \vskip10pt \noindent \ignorespacesafterend } \newlength\tmpwidth \newlength\tmpheight \newcommand{\importantpar}[1][-3]{% \settoheight{\tmpheight}{\importantsymbol}% \settowidth{\tmpwidth}{\importantsymbol}% \advance\tmpwidth by .5em\relax \par\noindent \hangindent=\tmpwidth \hangafter=#1\relax \makebox[0pt][l]{\hspace*{-\tmpwidth}% \smash{\raisebox{-\tmpheight}{\importantsymbol}}% }% } \newenvironment{important}{% \setlength{\fboxrule}{4pt}% \setlength\defwidth{\linewidth}% \addtolength\defwidth{-2\fboxsep}% \addtolength\defwidth{-2\fboxrule}% \begin{lrbox}{\defsbox}% \begin{minipage}{\defwidth}% \raggedright \setlength\parindent{1em}% \noindent\ignorespaces }{% \end{minipage}% \end{lrbox}% \par\vskip10pt\noindent \fcolorbox{red}{white}{\usebox{\defsbox}}\par\vskip10pt \noindent\ignorespacesafterend } \newenvironment{prompt}{% \par\vskip\baselineskip \begin{ttfamily}\obeylines\noindent\ignorespaces }{% \end{ttfamily}% \par\vskip\baselineskip \noindent\ignorespacesafterend } \newenvironment{display}{% \par\vskip\baselineskip\noindent \obeylines\ignorespaces }{% \par \vskip\baselineskip \noindent\ignorespacesafterend } \newenvironment{labelledbox}[1]{% \def\defarg{#1}% \setlength{\fboxsep}{4pt}\setlength{\fboxrule}{1.25pt}% \begin{lrbox}{\defsbox}% \setlength\defwidth\linewidth \addtolength\defwidth{-2\fboxrule}% \addtolength\defwidth{-2\fboxsep}% \begin{minipage}{\defwidth}\flushleft }{% \end{minipage} \end{lrbox}% \vskip10pt \noindent \begin{tabular}{@{}r@{}}% \fbox{\usebox\defsbox}\\[4pt] \footnotesize\mbox{\defarg}% \end{tabular} \vskip10pt \noindent \ignorespacesafterend } \else \newenvironment{definition}[1][]{% \par\HCode{