summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scrhack/nomencl.hak
blob: 188ad4b57c532d88439ffeee48bbabeff37237a1 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%%
%% This is file `nomencl.hak',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrhack-2023-07-07.dtx  (with options: `hack,nomencl,identify')
%% scrhack-2023-07-07.dtx  (with options: `hack,nomencl,body')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from nomencl.hak.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file scrhack-2023-07-07.dtx scrhack-2023-07-07.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\ProvidesFile{nomencl.hak}[%
  2024-04-17 v3.42
  scrhack part
  (hacking package
    nomencl)%
]
\RequirePackage{tocbasic}
\@ifpackagelater{nomencl}{2019/01/01}{%
  \PackageInfo{scrhack}{only `tocbasic' loaded for `nomencl'}%
  \expandafter\endinput
}{}
\addtotoclist[nomencl]{nlo}
\addtotoclist[nomencl]{nls}
\xpatchcmd{\thenomenclature}{%
  \@ifundefined{chapter}%
  {
    \section*{\nomname}
    \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
  }%
  {
    \chapter*{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%
}{%
  \scr@hack@nomencl@head
}{%
  \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
}{%
  \xpatchcmd{\thenomenclature}{%
    \@ifundefined{chapter}%
    {
      \section*{\nomname}
      \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
    }%
    {
      \chapter*{\nomname}
      \markboth{\nomname}{\nomname}%
      \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
    }%
  }{%
    \scr@hack@nomencl@head
  }{%
    \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
  }{%
    \xpatchcmd{\thenomenclature}{%
      \@ifundefined{chapter}%
      {
        \section*{\nomname}
        \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
      }%
      {
        \chapter*{\nomname}
        \@mkboth{\nomname}{\nomname}%
        \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
      }%
    }{%
      \scr@hack@nomencl@head
    }{%
      \PackageInfo{scrhack}{\string\thenomenclature\space successfully patched}%
    }{%
      \xpatchcmd{\thenomenclature}{%
        \@ifundefined{chapter}%
      }{%
        \scr@hack@nomencl@head
        \@gobbletwo
      }{%
        \PackageWarning{scrhack}{%
          using emergency patch of \string\thenomenclature.\MessageBreak
          This could happen if you are using an unknown\MessageBreak
          release of package `nomencl'.\MessageBreak
          Mostly this patch does work too, but it also could\MessageBreak
          break `nomencl`. If this happens, please deactivate\MessageBreak
          the `nomencl` hack of `scrhack`%
        }%
      }{%
        \PackageWarning{scrhack}{%
          cannot patch \string\thenomenclature.\MessageBreak
          This could happen if you are using an unknown\MessageBreak
          release of package `nomencl'%
        }%
      }%
    }%
  }%
}
\newcommand*{\scr@hack@nomencl@head}{%
  \providecommand*{\listofnlsname}{\nomname}%
  \def\@currext{nls}%
  \tocbasic@listhead{\nomname}%
}
\if@intoc
  \setuptoc{nls}{totoc}
\fi
\endinput
%%
%% End of file `nomencl.hak'.