diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls | 94 |
1 files changed, 70 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls index 0f671f18adb..d077b07de38 100644 --- a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls +++ b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls @@ -15,11 +15,38 @@ % version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{nlctdoc}[2013/12/05 v1.04 (NLCT)] -\def\@nlctdoc@class{scrartcl}% -\DeclareOption{article}{\def\@nlctdoc@class{scrartcl}} -\DeclareOption{book}{\def\@nlctdoc@class{scrbook}} -\DeclareOption{report}{\def\@nlctdoc@class{scrreprt}} +\ProvidesClass{nlctdoc}[2014/01/17 v1.04 (NLCT)] +\RequirePackage{ifpdf} +% tex4ht no longer seems to work with koma. +% 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}% {}} \newif\ifwidecs @@ -28,9 +55,12 @@ \DeclareOption*{% \PassOptionsToClass {\CurrentOption}{\@nlctdoc@class}} \ProcessOptions -\LoadClass[captions=tableheading]{\@nlctdoc@class} +\ifpdf + \LoadClass[captions=tableheading]{\@nlctdoc@class} +\else + \LoadClass{\@nlctdoc@class} +\fi \RequirePackage{xcolor} -\RequirePackage{ifpdf} \RequirePackage[utf8]{inputenc} \ifpdf \RequirePackage[T1]{fontenc} @@ -1143,14 +1173,14 @@ \fi \newcommand*{\appfmt}[1]{\texttt{#1}} -\newcommand*{\iapp}[1]{\index{#1=\appfmt{#1}|hyperpage}} -\newcommand*{\app}[1]{\appfmt{#1}\iapp{#1}} +\DeclareRobustCommand*{\iapp}[1]{\index{#1=\appfmt{#1}|hyperpage}} +\DeclareRobustCommand*{\app}[1]{\appfmt{#1}\iapp{#1}} \newcommand*{\qt}[1]{``#1''} -\newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}} -\newcommand*{\term}[1]{#1\iterm{#1}} -\newcommand*{\iterm}[1]{\index{#1|main}} +\DeclareRobustCommand*{\termdef}[1]{\emph{#1}\iterm{#1}} +\DeclareRobustCommand*{\term}[1]{#1\iterm{#1}} +\DeclareRobustCommand*{\iterm}[1]{\index{#1|main}} \newcommand*{\tableref}[1]{\hyperref[#1]{table~\ref*{#1}}} \newcommand*{\Tableref}[1]{\hyperref[#1]{Table~\ref*{#1}}} @@ -1244,13 +1274,11 @@ options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} \newcommand*{\env}[1]{\envfmt{#1}\ienv{#1}} \newcommand*{\ctrfmt}[1]{\textsf{#1}} -\newcommand*{\ictr}[1]{\index{#1 counter=\ctrfmt{#1} -counter|hyperpage}} +\newcommand*{\ictr}[1]{\index{#1={\protect\ttfamily#1} (counter)|hyperpage}} \newcommand*{\ctr}[1]{\ctrfmt{#1}\ictr{#1}} \newcommand*{\boolfmt}[1]{\textsf{#1}} -\newcommand*{\ibool}[1]{\index{#1 boolean variable=\boolfmt{#1} -boolean variable|hyperpage}} +\newcommand*{\ibool}[1]{\index{#1={\ttfamily#1} (boolean variable)|hyperpage}} \newcommand*{\bool}[1]{\boolfmt{#1}\ibool{#1}} \newcommand*{\bstfmt}[1]{\textsf{#1}} @@ -1304,17 +1332,35 @@ bibliography style|hyperpage}} \@starttoc{loe}% } + \newcommand{\aargh}{\grimace} + \else + + \edef\aargh{\noexpand\HCode{\string&\string#x1F631;}} + \newcommand*{\toTop}{\par\noindent\hyperlink{top}{Top}} + \@ifundefined{chapter} + {% \AtBeginDocument{% - \Configure{section}{}{\toTop}{}{}% - \Configure{subsection}{\toTop}{}{}{}% - \Configure{subsubsection}{\toTop}{}{}{}% - \Configure{paragraph}{\toTop\par}{}{}{}% - \Configure{subparagraph}{\toTop\par}{}{}{}% - \Css{div.important { border : solid red; }}% - \titlehead{\hypertarget{top}{}}% - } + \Configure{section}{\toTop\HCode{<h2 class="sectionHead">}}{}{}{}% + \Configure{subsection}{\toTop\HCode{<h3 class="subsectionHead">}}{}{}{}% + \Css{div.important { border : solid red; }}% + \hypertarget{top}{}% + } + }% + {% + \renewcommand{\thefootnote}{\thechapter.\arabic{footnote}} + \AtBeginDocument{% + \Configure{chapter} + {\HCode{<div class="chapter">}} + {\HCode{</div>}\toTop} + {\HCode{<h2 class="chapterHead">}\thechapter. }{\HCode{</h2>}}% + \Configure{section}{\toTop\HCode{<h3 class="sectionHead">}}{}{}{}% + \Configure{subsection}{\toTop\HCode{<h4 class="subsectionHead">}}{}{}{}% + \Css{div.important { border : solid red; }}% + \hypertarget{top}{}% + }% + }% \let\oldlabel\label \renewcommand*{\label}[1]{% |