diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-21 23:39:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-21 23:39:37 +0000 |
commit | 8ddf4012aa829655a657b87c422449e81bf93d93 (patch) | |
tree | 366097ed1b6da73f3ac3d08c4b250b9f78fabe7a | |
parent | 18d3ed873290d987fea4820b83615c3f35c44770 (diff) |
nlctdoc 1.01 (21may12)
git-svn-id: svn://tug.org/texlive/trunk@26548 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls | 119 |
1 files changed, 107 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls index 6d9b597765d..c1c1f38b593 100644 --- a/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls +++ b/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls @@ -2,19 +2,24 @@ % wants to compile the documentation that comes with my packages. % Some of the code is taken from doc.sty \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{nlctdoc}[2010/05/11 (NLCT)] +\ProvidesClass{nlctdoc}[2012/05/21 v1.01 (NLCT)] +\def\@nlctdoc@class{scrartcl}% +\DeclareOption{article}{\def\@nlctdoc@class{scrartcl}} +\DeclareOption{book}{\def\@nlctdoc@class{scrbook}} +\DeclareOption{report}{\def\@nlctdoc@class{scrreprt}} \DeclareOption{a5paper}{\@latexerr{Option not supported}% {}} \DeclareOption*{% - \PassOptionsToClass {\CurrentOption}{article}} + \PassOptionsToClass {\CurrentOption}{\@nlctdoc@class}} \ProcessOptions -\LoadClass{article} +\LoadClass{\@nlctdoc@class} \RequirePackage{xcolor} +\RequirePackage{fourier} \RequirePackage{ifpdf} \ifpdf \RequirePackage{cmap} \else - \RequirePackage[xhtml,fn-in,css-in]{tex4ht} + \RequirePackage[xhtml,fn-in,css-in,uni-html4,utf8]{tex4ht} \fi \@ifundefined{macro@cnt}{}{\endinput} \catcode`\^^A=14 @@ -944,6 +949,8 @@ \PageIndex \CodelineNumbered +\newcommand{\importantsymbol}{\bfseries\Huge\danger} + \ifpdf \definecolor{defbackground}{rgb}{1,1,0.75} \newsavebox\defsbox @@ -955,7 +962,7 @@ \setlength\defwidth\linewidth \addtolength\defwidth{-2\fboxrule}% \addtolength\defwidth{-2\fboxsep}% - \begin{minipage}{\defwidth}\flushleft + \begin{minipage}{\defwidth}\flushleft\ttfamily }{% \end{minipage} \end{lrbox}% @@ -967,6 +974,21 @@ \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}% @@ -1024,11 +1046,13 @@ \else \newenvironment{definition}[1][]{% - \par\HCode{<hr><div title="Definition">}#1\noindent + \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 }{% @@ -1072,7 +1096,12 @@ \newcommand*{\icsopt}[2]{\index{#1 options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} -\newcommand*{\csopt}[2]{\textsf{#2}\icsopt{#1}{#2}} +\newcommand*{\csopt}[2]{% + \textsf{#2}% + \@for\@thiscmd:=#1\do{% + \icsopt{\@thiscmd}{#2}% + }% +} \newcommand*{\pkgoptfmt}[1]{\textsf{#1}} @@ -1102,6 +1131,34 @@ options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} \index{package options:>#2=\pkgoptfmt{#2}>#1=\pkgoptfmt{#1}|main}% } +\newcommand*{\clsoptfmt}[1]{\textsf{#1}} + +% \iclsopt[value]{option} +\newcommand*{\iclsopt}[2][]{% + \def\@argi{#1}% + \ifx\@argi\@empty + \index{class options:>#2=\clsoptfmt{#2}|main}% + \else + \index{class options:>#2=\clsoptfmt{#2}>#1=\clsoptfmt{#1}|main}% +\fi +} + +\newcommand*{\clsopt}[2][]{% + \def\@argi{#1}% + \ifx\@argi\@empty + \clsoptfmt{#2}\index{class options:>#2=\clsoptfmt{#2}|main}% + \else + \clsoptfmt{#2=#1}% + \index{class options:>#2=\clsoptfmt{#2}>#1=\clsoptfmt{#1}|main}% +\fi +} + +% \clsoptval{value}{option} +\newcommand*{\clsoptval}[2]{% + \clsoptfmt{#1}% + \index{class options:>#2=\clsoptfmt{#2}>#1=\clsoptfmt{#1}|main}% +} + \newcommand*{\filetypefmt}[1]{\texttt{#1}} \newcommand*{\ifiletype}[1]{\index{file types>#1=\filetypefmt{#1}|hyperpage}} @@ -1120,12 +1177,49 @@ options=\cs{#1} options>#2=\textsf{#2}|hyperpage}} \newcommand*{\cls}[1]{\clsfmt{#1}\icls{#1}} \newcommand*{\envfmt}[1]{\textsf{#1}} -\newcommand*{\ienv}[1]{\index{#1 environment=\envfmt{#1} -environment|hyperpage}} +\newcommand*{\ienv}[1]{\SpecialMainEnvIndex{#1}} \newcommand*{\env}[1]{\envfmt{#1}\ienv{#1}} +\newcommand*{\ctrfmt}[1]{\textsf{#1}} +\newcommand*{\ictr}[1]{\index{#1 counter=\ctrfmt{#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*{\bool}[1]{\boolfmt{#1}\ibool{#1}} + +\newcommand*{\bstfmt}[1]{\textsf{#1}} +\newcommand*{\ibst}[1]{\index{#1 bibliography style=\bstfmt{#1} +bibliography style|hyperpage}} +\newcommand*{\bst}[1]{\bstfmt{#1}\ibst{#1}} + \newcommand*{\menu}[1]{\textsf{#1}} +\providecommand*{\ctandoc}[1]{% + \urlfootref{http://ctan.org/pkg/#1}{\sty{#1} documentation}% +} + +\newcounter{example} +\newcommand*{\examplename}{example} + +\newenvironment{example}[2]{% + \refstepcounter{example}\label{#2}% + \par\vskip10pt\noindent + \textbf{\large Example \theexample\ (#1)}% + \addcontentsline{loe}{section}{\protect\numberline{\theexample}#1}% + \nopagebreak\par\vskip10pt\nopagebreak +} +{% + \begin{center}\rule{2in}{1pt}\end{center}% +} + +\newcommand*{\listofexamples}{% + \section*{List of Examples}% + \@starttoc{loe}% +} + \ifpdf \newcommand*{\toTop}{} \newcommand*{\sectionref}[1]{Section~\ref{#1}} @@ -1143,13 +1237,13 @@ environment|hyperpage}} \else \newcommand*{\toTop}{\par\noindent\hyperlink{top}{Top}} \AtBeginDocument{% - \hypertarget{top}{}% \Configure{section}{}{\toTop}{}{}% \Configure{subsection}{\toTop}{}{}{}% \Configure{subsubsection}{\toTop}{}{}{}% \Configure{paragraph}{\toTop\par}{}{}{}% \Configure{subparagraph}{\toTop\par}{}{}{}% \Css{div.important { background-color:red; }}% + \titlehead{\hypertarget{top}{}}% } \let\oldlabel\label @@ -1157,6 +1251,9 @@ environment|hyperpage}} \HCode{<a name=\string"#1\string">}\oldlabel{#1}% } + \renewcommand{\StopEventually}[1]{#1\toTop} + \renewcommand*{\OnlyDescription}{} + \newcommand*{\sectionref}[1]{\hyperref[#1]{\S\ref*{#1} }\nameref{#1}} \newcommand*{\xrsectionref}[3]{\href{#2.html\##1}{#3}} \newcommand*{\qtdocref}[2]{\href{#2.html}{\qt{#1}}} @@ -1165,8 +1262,6 @@ environment|hyperpage}} \newcommand*{\urlref}[2]{\href{#1}{#2}} \newcommand*{\urlfootref}[2]{\href{#1}{#2}} \newcommand*{\submenu}[1]{\menu{-\textgreater #1}} - - \renewcommand{\StopEventually}[1]{#1\toTop} \fi \endinput |