summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/iitem/iitem.sty
blob: 800ab2c122830aca15be24f3dd170c687e239453 (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
%%
%% This is file `iitem.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% iitem.dtx  (with options: `package')
%% This is a generated file.
%% 
%% Copyright (C) 2013 by Ben Vitecek
%% 
%% This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version 1999/12/01 or later.





\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesPackage{iitem}
[2013/03/31 v1.0 Go a step deeper in lists
using the new commands ``iitem'', ``iiitem'' and ``ivtem''.]

\def\Pseudo@item{{{%
  \@inmatherr\item
  \@ifnextchar [\@item{\@item[]}
 }}}

\newcounter{iitemcounter}
\newcounter{iiitemcounter}
\newcounter{ivtemcounter}

\let\AltesItem\item
\renewcommand{\item}{%
\if@nmbrlist%
 \ifnum%
  \@enumdepth=1%
  \setcounter{iitemcounter}{0}%
  \setcounter{iiitemcounter}{0}%
  \setcounter{ivtemcounter}{0}%
 \fi%
\fi%
\AltesItem}

\newcommand*{\iitem@line@command}[2]{%
  \newcommand*{#1}{%
    \begingroup%
    \escapechar=`\\%
    \catcode\endlinechar=\active%
    \csname\string#1\endcsname%
  }%
  \begingroup%
  \escapechar=`\\%
  \lccode`\~=\endlinechar%
  \lowercase{%
    \expandafter\endgroup
    \expandafter\def\csname\string#1\endcsname##1~%
  }{\endgroup#2\space}%
}

\iitem@line@command{\iitem}{\partopsep0pt%
 \expandafter\begin\expandafter{\@currenvir}%
  \if@nmbrlist\setcounter{\@listctr}{\theiitemcounter}\fi%
  \item #1%
 \expandafter\end\expandafter{\@currenvir}%
\stepcounter{iitemcounter}%
\setcounter{iiitemcounter}{0}\setcounter{ivtemcounter}{0}}

\iitem@line@command{\iiitem}{\partopsep0pt%
 \expandafter\begin\expandafter{\@currenvir}\Pseudo@item%
  \expandafter\begin\expandafter{\@currenvir}%
   \if@nmbrlist\setcounter{\@listctr}{\theiiitemcounter}\fi%
   \item #1
  \expandafter\end\expandafter{\@currenvir}%
 \expandafter\end\expandafter{\@currenvir}%
\stepcounter{iiitemcounter}\setcounter{ivtemcounter}{0}}

\iitem@line@command{\ivtem}{\partopsep0pt%
 \expandafter\begin\expandafter{\@currenvir}\Pseudo@item%
  \expandafter\begin\expandafter{\@currenvir}\Pseudo@item%
   \expandafter\begin\expandafter{\@currenvir}%
    \if@nmbrlist  \setcounter{\@listctr}{\theivtemcounter}\fi%
    \item #1%
   \expandafter\end\expandafter{\@currenvir}%
  \expandafter\end\expandafter{\@currenvir}%
 \expandafter\end\expandafter{\@currenvir}%
\stepcounter{ivtemcounter}}


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