summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dox/dox.sty
blob: 592dfa7a290cfd600cd042fc5b4761951b206719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
%%
%% This is file `dox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% dox.dtx  (with options: `header,dox')
%% 


%% Copyright (C) 2009 Didier Verna

%% This file is part of DoX.

%% DoX may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.1
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.1 or later is part of all distributions of LaTeX
%% version 1999/06/01 or later.

%% DoX consists of the files listed in the file `README'.

%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{dox}[2009/09/11 v1.0 Extensions to the doc package]

\long\def\doxm@cro@#1#2{%
  \endgroup%
  \topsep\MacroTopsep\trivlist
  \def\makelabel##1{\llap{##1}}%
  \if@inlabel
    \let\@tempa\@empty
    \count@\macro@cnt
    \loop\ifnum\count@>\z@
      \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m@ne%
    \repeat
    \edef\makelabel##1{%
      \llap{\vtop to\baselineskip
{\@tempa\hbox{##1}\vss}}}%
    \advance\macro@cnt\@ne
  \else
    \macro@cnt\@ne
  \fi
  \edef\@tempa{%
    \noexpand\item[%
      \expandafter\noexpand\csname Print#1Name\endcsname{\string#2}]}%
  \@tempa
  \global\advance\c@CodelineNo\@ne
  \@nameuse{SpecialMain#1Index}{#2}\nobreak
  \global\advance\c@CodelineNo\m@ne
  \ignorespaces}

\newcommand\doxitem[3]{%
  \@ifundefined{Print#1Name}{%
    \expandafter\def\csname Print#1Name\endcsname##1{%
      \strut\MacroFont\string##1\ }}{}
  \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}%
    \@esphack}
  \@ifundefined{PrintDescribe#1}{%
    \expandafter\def\csname PrintDescribe#1\endcsname##1{%
      \strut\MacroFont##1\ }}{}
  \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}\@esphack}
  \expandafter\def\csname Describe@#1\endcsname##1{%
    \endgroup
    \marginpar{\raggedleft\@nameuse{PrintDescribe#1}{##1}}%
    \@nameuse{Special#1Index}{##1}\@esphack\ignorespaces}
  \expandafter\def\csname Describe#1\endcsname{%
    \leavevmode\@bsphack\begingroup\MakePrivateLetters
    \@nameuse{Describe@#1}}
  \expandafter\def\csname #2\endcsname{%
    \begingroup
      \catcode`\\12
      \MakePrivateLetters\doxm@cro@{#1}}
  \expandafter\let\csname end#2\endcsname\endtrivlist}

\endinput
%%
%% End of file `dox.sty'.