summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-16 23:57:53 +0000
committerKarl Berry <karl@freefriends.org>2010-12-16 23:57:53 +0000
commitf565a84e02adcdb964437eb46e1f5c3a6554ddc2 (patch)
treebe5f5f3d469a34a8a8e6f0a7a60b33328ca92327 /Master/texmf-dist/tex/latex/dox
parent3d7921d8c3592f86548fb1c0dda79e234a63c223 (diff)
dox 2.2 (17dec10)
git-svn-id: svn://tug.org/texlive/trunk@20768 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dox')
-rw-r--r--Master/texmf-dist/tex/latex/dox/dox.sty79
1 files changed, 62 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/dox/dox.sty b/Master/texmf-dist/tex/latex/dox/dox.sty
index 15e35086540..c2ef47d8a8f 100644
--- a/Master/texmf-dist/tex/latex/dox/dox.sty
+++ b/Master/texmf-dist/tex/latex/dox/dox.sty
@@ -8,7 +8,7 @@
%%
-%% Copyright (C) 2009 Didier Verna
+%% Copyright (C) 2009, 2010 Didier Verna
%% This file is part of DoX.
@@ -38,13 +38,14 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{dox}[2009/09/28 v2.1 Extensions to the doc package]
+\ProvidesPackage{dox}[2010/12/16 v2.2 Extensions to the doc package]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=dox,prefix=dox@}
\DeclareBoolOption{noprint}
\DeclareBoolOption{noindex}
+\DeclareBoolOption{macrolike}
\DeclareStringOption{idxtype}
\long\def\@@doxenv#1#2{%
@@ -108,20 +109,40 @@
\def\@doxcreatespecialmainindex#1#2#3{%
\expandafter\def\csname SpecialMain#1Index\endcsname##1{%
\@bsphack%
- \special@index{%
- ##1\actualchar{\string\ttfamily\space##1} (#2)\encapchar main}%
- \special@index{%
- #3:\levelchar##1\actualchar%
- {\string\ttfamily\space##1}\encapchar main}%
+ \special@index{##1\actualchar{\string\ttfamily\space##1} (#2)
+ \encapchar main}%
+ \special@index{#3:\levelchar##1\actualchar{\string\ttfamily\space##1}
+ \encapchar main}%
+ \@esphack}}
+\def\@doxcreatespecialmainmacrolikeindex#1#2#3{%
+ \expandafter\def\csname SpecialMain#1Index\endcsname##1{%
+ \@SpecialIndexHelper@##1\@nil
+ \@bsphack%
+ \special@index{\@gtempa\actualchar
+ \string\verb\quotechar*\verbatimchar\bslash\@gtempa\verbatimchar
+ \space(#2)\encapchar main}%
+ \special@index{#3:\levelchar\@gtempa\actualchar%
+ \string\verb\quotechar*\verbatimchar\bslash\@gtempa\verbatimchar
+ \encapchar main}%
\@esphack}}
\def\@doxcreatespecialindex#1#2#3{%
\expandafter\def\csname Special#1Index\endcsname##1{%
\@bsphack%
- \index{##1\actualchar{\protect\ttfamily##1}
- (#2)\encapchar usage}%
- \index{#3:\levelchar##1\actualchar{\protect\ttfamily##1}\encapchar
- usage}%
+ \index{##1\actualchar{\protect\ttfamily##1} (#2)\encapchar usage}%
+ \index{#3:\levelchar##1\actualchar{\protect\ttfamily##1}
+ \encapchar usage}%
+ \@esphack}}
+\def\@doxcreatespecialmacrolikeindex#1#2#3{%
+ \expandafter\def\csname Special#1Index\endcsname##1{%
+ \@SpecialIndexHelper@##1\@nil
+ \@bsphack%
+ \index{\@gtempa\actualchar
+ \string\verb\quotechar*\verbatimchar\bslash\@gtempa\verbatimchar
+ \space(#2)\encapchar usage}%
+ \index{#3:\levelchar\@gtempa\actualchar
+ \string\verb\quotechar*\verbatimchar\bslash\@gtempa\verbatimchar
+ \encapchar usage}%
\@esphack}}
\def\@doxcreatedescribe#1{%
@@ -147,17 +168,36 @@
\@doxcreateenv{Env}{environment}
\newcommand\doxitem[4][]{%
+ \@nameuse{dox@macrolike\dox@macrolikedefault}%
\def\dox@idxtype{#3}%
\setkeys{dox}{#1}
\@ifundefined{Print#2Name}{%
- \expandafter\def\csname Print#2Name\endcsname##1{%
- \strut\MacroFont##1\ }}{}
- \def\@doxexpr{\@doxcreatespecialmainindex{#2}}%
+ \ifdox@macrolike
+ \expandafter\def\csname Print#2Name\endcsname##1{%
+ \strut\MacroFont\string ##1\ }
+ \else
+ \expandafter\def\csname Print#2Name\endcsname##1{%
+ \strut\MacroFont ##1\ }
+ \fi}{}
+ \ifdox@macrolike
+ \def\@doxexpr{\@doxcreatespecialmainmacrolikeindex{#2}}%
+ \else
+ \def\@doxexpr{\@doxcreatespecialmainindex{#2}}%
+ \fi
\expandafter\@doxexpr\expandafter{\dox@idxtype}{#4}%
\@ifundefined{PrintDescribe#2}{%
- \expandafter\def\csname PrintDescribe#2\endcsname##1{%
- \strut\MacroFont##1\ }}{}
- \def\@doxexpr{\@doxcreatespecialindex{#2}}%
+ \ifdox@macrolike
+ \expandafter\def\csname PrintDescribe#2\endcsname##1{%
+ \strut\MacroFont\string ##1\ }
+ \else
+ \expandafter\def\csname PrintDescribe#2\endcsname##1{%
+ \strut\MacroFont ##1\ }
+ \fi}{}
+ \ifdox@macrolike
+ \def\@doxexpr{\@doxcreatespecialmacrolikeindex{#2}}%
+ \else
+ \def\@doxexpr{\@doxcreatespecialindex{#2}}%
+ \fi
\expandafter\@doxexpr\expandafter{\dox@idxtype}{#4}%
\@doxcreatedescribe{#2}
\@doxcreateenv{#2}{#3}}
@@ -173,6 +213,11 @@
\else
\def\dox@noindexdefault{false}
\fi
+\ifdox@macrolike
+ \def\dox@macrolikedefault{true}
+\else
+ \def\dox@macrolikedefault{false}
+\fi
\endinput
%%