summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/expex/epltxchapno.sty
blob: e0c317dab245a0fd4b51425cf4eb5898d901982d (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
\ProvidesPackage{epltxchapno}%
  [2014/01/27 v1.0 ExPex-LaTex chapter numbering integration (JF)]
\RequirePackage{expex}

% epltxchapno.sty is for use in conjunction with LaTex classes which use
% \chapter (book.cls, scrbook.cls, report.cls, and memoir.cls at least).
% \excnt is set to 1 at the beginning of each chapter and examples are
% numbered (n.1), (n.2), etc. in chapter n.  The \deftag/\getref
% mechanism produces the desired reference.

\@ifundefined{if@mainmatter}{\newif\if@mainmatter\@mainmattertrue}\relax
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \excnt=1
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\lingset{exnotype=chapter.arabic}