summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nlctdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-14 22:41:32 +0000
committerKarl Berry <karl@freefriends.org>2017-05-14 22:41:32 +0000
commit4ebe0923247961f1c04ef98e3880128ceb705e3c (patch)
treed3b6825553a630810b2bac0d6436aeee8bd5e224 /Master/texmf-dist/tex/latex/nlctdoc
parente8a3bbca0649c257c934e198600a4547ca453b1d (diff)
nlctdoc (14may17)
git-svn-id: svn://tug.org/texlive/trunk@44353 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nlctdoc')
-rw-r--r--Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls214
1 files changed, 121 insertions, 93 deletions
diff --git a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
index d0bc3b1f85f..4afd5eb7039 100644
--- a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
+++ b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
@@ -4,7 +4,7 @@
% 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
+% Copyright 2017 Nicola Talbot
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -15,37 +15,56 @@
% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{nlctdoc}[2016/11/07 v1.05 (NLCT)]
+\ProvidesClass{nlctdoc}[2017/05/13 v1.06 (NLCT)]
\RequirePackage{ifpdf}
+\RequirePackage{ifxetex}
% 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}%
+ \newcommand{\@nlctdoc@if@usingtexht}[2]{#2}
\else
- \def\@nlctdoc@class{article}%
+ \ifxetex
+ \newcommand{\@nlctdoc@if@usingtexht}[2]{#2}
+ \else
+ \newcommand{\@nlctdoc@if@usingtexht}[2]{#1}
+ \fi
\fi
+
+\@nlctdoc@if@usingtexht
+{
+ \def\@nlctdoc@class{article}%
+}
+{
+ \def\@nlctdoc@class{scrartcl}%
+}
\DeclareOption{article}{%
- \ifpdf
- \def\@nlctdoc@class{scrartcl}%
- \else
+ \@nlctdoc@if@usingtexht
+ {%
\def\@nlctdoc@class{article}%
- \fi
+ }%
+ {%
+ \def\@nlctdoc@class{scrartcl}%
+ }%
}
\DeclareOption{book}{%
- \ifpdf
- \def\@nlctdoc@class{scrbook}%
- \else
+ \@nlctdoc@if@usingtexht
+ {%
\def\@nlctdoc@class{book}%
- \fi
+ }%
+ {%
+ \def\@nlctdoc@class{scrbook}%
+ }%
}
\DeclareOption{report}{%
- \ifpdf
- \def\@nlctdoc@class{scrreprt}%
- \else
+ \@nlctdoc@if@usingtexht
+ {%
\def\@nlctdoc@class{report}%
- \fi
+ }%
+ {%
+ \def\@nlctdoc@class{scrreprt}%
+ }%
}
\DeclareOption{a5paper}{\@latexerr{Option not supported}%
{}}
@@ -67,24 +86,34 @@
\DeclareOption*{%
\PassOptionsToClass {\CurrentOption}{\@nlctdoc@class}}
\ProcessOptions
-\ifpdf
+\@nlctdoc@if@usingtexht
+{%
+ \LoadClass{\@nlctdoc@class}
+}%
+{%
\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}
+\ifxetex
\else
- \RequirePackage[xhtml,fn-in,css-in,uni-html4,utf8]{tex4ht}
+ \RequirePackage[utf8]{inputenc}
\fi
+\@nlctdoc@if@usingtexht
+{%
+ \RequirePackage[xhtml,fn-in,css-in,uni-html4,utf8]{tex4ht}
+}%
+{%
+ \ifxetex
+ \else
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{cmap}
+ \fi
+ \RequirePackage{fourier}
+}%
\RequirePackage{etoolbox}
\RequirePackage{doc,dox}
\RequirePackage{upquote}
@@ -238,7 +267,41 @@
\newlength\macrowidth
-\ifpdf
+\@nlctdoc@if@usingtexht
+{%
+ \newenvironment{definition}[1][]{%
+ \par\HCode{<hr><div title="Definition">}#1\ttfamily\noindent
+ }{%
+ \HCode{</div><hr>}\par\noindent
+ }
+
+ \newcommand{\importantpar}[1][-3]{\importantsymbol\space}
+
+ \newenvironment{important}{%
+ \par\HCode{<div class="important" title="Important Note">}\noindent
+ }{%
+ \HCode{</div>}\par\noindent
+ }
+
+ \newenvironment{prompt}{%
+ \HCode{<spacer type=vertical size=10>}\begin{ttfamily}\obeylines\ignorespaces
+ }{%
+ \end{ttfamily}\HCode{<spacer type=vertical size=10>}\noindent
+ }
+
+ \newenvironment{display}{%
+ \HCode{<spacer type=vertical size=10>}\obeylines\ignorespaces
+ }{%
+ \HCode{<spacer type=vertical size=10>}\noindent
+ }
+
+ \newenvironment{labelledbox}[1]{%
+ \par\HCode{<hr><div>}\marginpar{#1}\noindent
+ }{%
+ \HCode{</div><hr>}\par\noindent
+ }
+}%
+{%
\definecolor{defbackground}{rgb}{1,1,0.75}
\newsavebox\defsbox
\newlength\defwidth
@@ -341,41 +404,7 @@
\noindent
\ignorespacesafterend
}
-
-\else
- \newenvironment{definition}[1][]{%
- \par\HCode{<hr><div title="Definition">}#1\ttfamily\noindent
- }{%
- \HCode{</div><hr>}\par\noindent
- }
-
- \newcommand{\importantpar}[1][-3]{\importantsymbol\space}
-
- \newenvironment{important}{%
- \par\HCode{<div class="important" title="Important Note">}\noindent
- }{%
- \HCode{</div>}\par\noindent
- }
-
- \newenvironment{prompt}{%
- \HCode{<spacer type=vertical size=10>}\begin{ttfamily}\obeylines\ignorespaces
- }{%
- \end{ttfamily}\HCode{<spacer type=vertical size=10>}\noindent
- }
-
- \newenvironment{display}{%
- \HCode{<spacer type=vertical size=10>}\obeylines\ignorespaces
- }{%
- \HCode{<spacer type=vertical size=10>}\noindent
- }
-
- \newenvironment{labelledbox}[1]{%
- \par\HCode{<hr><div>}\marginpar{#1}\noindent
- }{%
- \HCode{</div><hr>}\par\noindent
- }
-
-\fi
+}%
\newcommand*{\appfmt}[1]{\texttt{#1}}
\DeclareRobustCommand*{\iapp}[1]{\index{#1=\appfmt{#1}\encapchar hyperpage}}
@@ -510,36 +539,8 @@ bibliography style|hyperpage}}
\begin{center}\rule{2in}{1pt}\end{center}%
}
-\ifpdf
- \newcommand*{\toTop}{}
- \newcommand*{\sectionref}[1]{Section~\ref{#1}}
- \newcommand*{\qtdocref}[2]{\qt{#1} (\href{#2.pdf}{#2.pdf})}
- \newcommand*{\docref}[2]{#1 (\href{#2.pdf}{#2.pdf})}
- \newcommand*{\urlref}[2]{\url{#1}}
- \newcommand*{\urlfootref}[2]{#2\footnote{\url{#1}}}
- \newcommand*{\submenu}[1]{\,$\to$\,\menu{#1}}
-
- % \altdocref{text}{pdf}{html}
- \newcommand*{\altdocref}[3]{#1 (\href{#2.pdf}{#2.pdf})}
-
- % \xrsectionref{label}{html file}{html title}
- \newcommand*{\xrsectionref}[3]{Section~\ref{#1}}
-
- \newcommand*{\listofexamples}{%
- \@ifundefined{chapter}
- {%
- \section*{List of Examples}%
- }%
- {%
- \chapter*{List of Examples}%
- }
- \@starttoc{loe}%
- }
-
- \newcommand{\aargh}{\grimace}
-
-\else
-
+\@nlctdoc@if@usingtexht
+{%
\edef\aargh{\noexpand\HCode{\string&\string#x1F631;}}
\newcommand*{\toTop}{\par\noindent\hyperlink{top}{Top}}
@@ -613,9 +614,36 @@ bibliography style|hyperpage}}
\renewcommand*{\meta}[1]{%
\nlcthlangle\emph{#1}\nlcthrangle}
+}%
+{%
+ \newcommand*{\toTop}{}
+ \newcommand*{\sectionref}[1]{Section~\ref{#1}}
+ \newcommand*{\qtdocref}[2]{\qt{#1} (\href{#2.pdf}{#2.pdf})}
+ \newcommand*{\docref}[2]{#1 (\href{#2.pdf}{#2.pdf})}
+ \newcommand*{\urlref}[2]{\url{#1}}
+ \newcommand*{\urlfootref}[2]{#2\footnote{\url{#1}}}
+ \newcommand*{\submenu}[1]{\,$\to$\,\menu{#1}}
+ % \altdocref{text}{pdf}{html}
+ \newcommand*{\altdocref}[3]{#1 (\href{#2.pdf}{#2.pdf})}
+
+ % \xrsectionref{label}{html file}{html title}
+ \newcommand*{\xrsectionref}[3]{Section~\ref{#1}}
+
+ \newcommand*{\listofexamples}{%
+ \@ifundefined{chapter}
+ {%
+ \section*{List of Examples}%
+ }%
+ {%
+ \chapter*{List of Examples}%
+ }
+ \@starttoc{loe}%
+ }
+
+ \newcommand{\aargh}{\grimace}
+}%
-\fi
\AtBeginDocument{\MakeShortVerb{\|}}