summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/chet/chetmacros.txt
blob: 793328cc79ec4a739c63034c670645966ca7e857 (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
\usepackage{xparse}
\usepackage{xspace}
% Numbered equation with optional label
\NewDocumentCommand\eqn{mo}{%
  \IfNoValueTF{#2}
     {\[ #1 \]}
     {\begin{equation}\label{#2} #1 \end{equation} \expandafter\newcommand\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces}
}

% Numbered aligned equation with optional label in the vertical middle
\NewDocumentCommand\eqna{mo}{%
  \IfNoValueTF{#2}
    {\begin{align*} #1 \end{align*}}
    {\begin{equation}\label{#2}\begin{split} #1 \end{split}\end{equation} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces}
}

% Numbered subequations
% Two subequations
\NewDocumentCommand\twoseqn{momoo}{%
    \IfNoValueTF{#5}
       {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4}  \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces}
       {\begin{subequations}\label{#5}\begin{align} #1\label{#2} \\ #3 \label{#4}  \end{align}\end{subequations} \expandafter\def\csname #5\endcsname{\eqref{#5}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces}
}
% Three subequations
\NewDocumentCommand\threeseqn{momomoo}{%
   \IfNoValueTF{#7}
     {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces}
     {\begin{subequations}\label{#7}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \end{align}\end{subequations} \expandafter\def\csname #7\endcsname{\eqref{#7}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces}
}

% Four subequations
\NewDocumentCommand\fourseqn{momomomoo}{%
   \IfNoValueTF{#9}
     {\begin{subequations}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \\ #7\label{#8} \end{align}\end{subequations} \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces \expandafter\def\csname #8\endcsname{\eqref{#8}\xspace}\ignorespaces}
     {\begin{subequations}\label{#9}\begin{align} #1\label{#2} \\ #3 \label{#4} \\ #5 \label{#6} \\ #7\label{#8} \end{align}\end{subequations} \expandafter\def\csname #9\endcsname{\eqref{#9}\xspace}\ignorespaces \expandafter\def\csname #2\endcsname{\eqref{#2}\xspace}\ignorespaces \expandafter\def\csname #4\endcsname{\eqref{#4}\xspace}\ignorespaces \expandafter\def\csname #6\endcsname{\eqref{#6}\xspace}\ignorespaces \expandafter\def\csname #8\endcsname{\eqref{#8}\xspace}\ignorespaces}
}

\newcommand{\rcite}{\cite}
\newcommand{\draftmode}{\usepackage[notref,notcite]{showkeys}}
\providecommand*\showkeyslabelformat[1]{\normalfont\sffamily\footnotesize#1}
\newcommand{\foot}{\footnote}

% Sections and subsections
\NewDocumentCommand\newsec{mo}{%
  \IfNoValueTF{#2}
     {\section{#1}}
     {\section{#1}\label{#2} \expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces}
}
\NewDocumentCommand\subsec{mo}{%
  \IfNoValueTF{#2}
     {\subsection{#1}}
     {\subsection{#1}\label{#2}\expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces}
}
\NewDocumentCommand\subsubsec{mo}{%
  \IfNoValueTF{#2}
     {\subsubsection{#1}}
     {\subsubsection{#1}\label{#2}\expandafter\gdef\csname #2\endcsname{\ref{#2}\xspace}\ignorespaces}
}

\makeatletter
\renewcommand\section{\@startsection {section}{1}{\z@}% 
{-6ex \@plus -1ex \@minus -.2ex}% 
{2.3ex \@plus.2ex}% 
{\bfseries}}
\makeatother
\makeatletter
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\itshape}}
\makeatother
\makeatletter
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\itshape}}
\makeatother