|
173 | 173 | %---------------------------------------------------------------------------%
|
174 | 174 | %->> Detect class and counter
|
175 | 175 | %---------------------------------------------------------------------------%
|
176 |
| -\newcommand*{\ifcounter}[1]{% check if counter exists |
| 176 | +\newcommand*{\artxifcnt}[1]{% check if counter exists |
177 | 177 | \ifcsname c@#1\endcsname%
|
178 | 178 | \expandafter\@firstoftwo%
|
179 | 179 | \else%
|
180 | 180 | \expandafter\@secondoftwo%
|
181 | 181 | \fi
|
182 | 182 | }
|
183 |
| -\ifcounter{chapter}{\def\maincounter{chapter}}{\def\maincounter{section}} |
| 183 | +\artxifcnt{chapter}{\def\artxmaincnt{chapter}}{\def\artxmaincnt{section}}% |
184 | 184 | %---------------------------------------------------------------------------%
|
185 | 185 | %->> Required packages
|
186 | 186 | %---------------------------------------------------------------------------%
|
|
190 | 190 | \RequirePackage{amsmath,amsthm,amssymb}% math structures, theorems, and extended symbols
|
191 | 191 | \theoremstyle{plain}% for theorems, lemmas, propositions, etc
|
192 | 192 | \providecommand{\theoremname}{Theorem}%
|
193 |
| -\newtheorem{theorem}{\theoremname}[\maincounter] |
| 193 | +\newtheorem{theorem}{\theoremname}[\artxmaincnt] |
194 | 194 | \providecommand{\axiomname}{Axiom}%
|
195 | 195 | \newtheorem{axiom}[theorem]{\axiomname}
|
196 | 196 | \providecommand{\lemmaname}{Lemma}%
|
|
205 | 205 | \newtheorem{conjecture}[theorem]{\conjecturename}
|
206 | 206 | \theoremstyle{definition}% for definitions and examples
|
207 | 207 | \providecommand{\definitionname}{Definition}%
|
208 |
| -\newtheorem{definition}{\definitionname}[\maincounter] |
| 208 | +\newtheorem{definition}{\definitionname}[\artxmaincnt] |
209 | 209 | \providecommand{\examplename}{Example}%
|
210 |
| -\newtheorem{example}{\examplename}[\maincounter] |
| 210 | +\newtheorem{example}{\examplename}[\artxmaincnt] |
211 | 211 | \theoremstyle{remark}% for remarks and notes
|
212 | 212 | \providecommand{\remarkname}{Remark}%
|
213 | 213 | \newtheorem*{remark}{\remarkname}
|
|
507 | 507 | %-
|
508 | 508 | %-> Macro for adding link to toc and bookmark
|
509 | 509 | %-
|
510 |
| -\def\munch#1{}% auxiliary command |
| 510 | +\long\def\artxaux#1{}% auxiliary command |
511 | 511 | \newcommand{\intotocnostar}[3]{% [<\chapter|...>,<*>,<title>]
|
512 | 512 | #1#2{% excute command
|
513 | 513 | \phantomsection% create bookmark link
|
514 |
| - \addcontentsline{toc}{\expandafter\munch\string#1}{#3}% add content #3 to toc as #1 |
| 514 | + \addcontentsline{toc}{\expandafter\artxaux\string#1}{#3}% add content #3 to toc as #1 |
515 | 515 | #3%
|
516 | 516 | }
|
517 | 517 | \markboth{\MakeUppercase{#3}}{}% set header mark
|
518 | 518 | }
|
519 |
| -\newcommand{\intotocstar}[3]{% [<\chapter|...>,<extra commands>,<title>] |
| 519 | +\newcommand{\intotocstar}[3][\artxmaincnt]{% [<chapter|...>,<extra commands>,<title>] |
520 | 520 | #2% excute command
|
521 | 521 | \phantomsection% create bookmark link
|
522 |
| - \addcontentsline{toc}{\expandafter\munch\string#1}{#3}% add content #3 to toc as #1 |
| 522 | + \addcontentsline{toc}{#1}{#3}% add content #3 to toc as #1 |
523 | 523 | \markboth{\MakeUppercase{#3}}{}% set header mark
|
524 | 524 | }
|
525 | 525 | \newcommand{\intotoc}{\@ifstar{\intotocstar}{\intotocnostar}}% swap starred and non-starred versions
|
|
0 commit comments