-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomCommands.tex
74 lines (60 loc) · 2.72 KB
/
customCommands.tex
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
% use this \textlabel command to have a reference within normal text; don't use any other referencing with textlabel enabled
\makeatletter
\newcommand*{\textlabel}[2]{%
\edef\@currentlabel{#1}% Set target label
\leavevmode\phantomsection% Correct hyper reference link
#1\label{#2}% Print and store label
}
\makeatother
% proper nouns
\newcommand{\graphioli}{\textsc{Graphioli}\xspace}
\newcommand{\twixt}{\textsc {TwixT}\xspace}
\newcommand{\graphcoloring}{\textsc {Graph-Coloring}\xspace}
\newcommand{\gameexplorer}{\textsc {Game-Explorer}\xspace}
% creates the class name with its reference
\newcommand{\class}[2]{\subsubsection*{\textcolor{Blue}{Class \textlabel{#1}{cls:#2}\index{#1}}}}
% creates the interface name with its reference
\newcommand{\interface}[2]{\subsubsection*{\textcolor{Blue}{Interface \textlabel{#1}{cls:#2}\index{#1}}}}
% creates static with its reference
\newcommand{\static}[2]{\subsubsection*{\textcolor{Blue}{Static Class \textlabel{#1}{cls:#2}\index{#1}}}}
% creates the abstract class name with its reference
\newcommand{\abstractclass}[2]{\subsubsection*{\textcolor{Blue}{Abstract Class \textlabel{#1}{cls:#2}\index{#1}}}}
% creates a reference for all implemented interfaces
\newcounter{iref}
\newcommand{\refi}[1]{\def\do##1{\stepcounter{iref}\ifnumgreater{\value{iref}}{1}{, }{}\ref{##1}}\docsvlist{#1}}
\newcommand{\interfaces}[1]{
\begin{description}
\item[All Implemented Interfaces] \hfill \\
\refi{#1}
\end{description}
\setcounter{iref}{0}
}
% creates a reference for all direct subclasses
\newcounter{sref}
\newcommand{\reff}[1]{\def\do##1{\stepcounter{sref}\ifnumgreater{\value{sref}}{1}{, }{}\ref{##1}}\docsvlist{#1}}
\newcommand{\subclasses}[1]{
\begin{description}
\item[Direct Known Subclasses] \hfill \\
\reff{#1}
\end{description}
\setcounter{sref}{0}
}
% create centered dashed rule
\newcommand{\centerdash}{
\begin{center}
\hdashrule{14cm}{1pt}{1pt}
\end{center}
}
% to easily implement methods
\newcommand{\method}[3]{#1 & \textcolor{NavyBlue}{\textlabel{#2}{#3}}}
% creates the beginning of the method description table
\newcommand{\startmethodtable}{\hline\rowcolor{white}\textbf{Modifier and Type} & \textbf{Method and Description} \\ \hline}
% added, removed and minor changed methods
\newcommand{\newmethod}[3]{\rowcolor{green!10} + & #1 & #2 & #3}
\newcommand{\removedmethod}[3]{\rowcolor{red!20} -- & #1 & #2 & #3}
\newcommand{\alteredmethod}[3]{\rowcolor{blue!15} = & #1 & #2 & #3}
% ditto mark
%\newcommand{\ditto}[1][.4pt]{\xrfill{#1}~\textquotedbl~\xrfill{#1}}
\renewcommand{\textquotedbl}{\texttt{"}}
\newcommand{\dittomark}[1][1ex]{\xrfill[.7ex]{.4pt}~\rule{0pt}{#1}\textquotedbl~\xrfill[.7ex]{.4pt}}
\newcommand{\ditto}{\dittomark[\normalbaselineskip]}