forked from hpcugent/vsc_user_docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.tex
56 lines (49 loc) · 1.57 KB
/
macros.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
% use \macro instead of \newcommand so we automatically add a space
\usepackage{xspace}
\usepackage{etoolbox}
\newcounter{cnt}
\newcommand\textlist{}
\newcommand\settext[2]{%
\csdef{text#1}{#2}}
\newcommand\addtext[1]{%
\stepcounter{cnt}%
\csdef{text\thecnt}{#1}}
\newcommand\gettext[1]{%
\csuse{text#1}}
\newcounter{colnum}
\newcommand\maketabularrow[1]{%
\setcounter{colnum}{0}%
\whileboolexpr
{ test {\ifnumcomp{\value{colnum}}{<}{#1 - 1}} }%
{\stepcounter{colnum}\gettext{\thecolnum} & \gettext{\gettext{\thecolnum}} \\ \hline }
% Weird stuff with latex adding an empty row if we don't use the following way.
\stepcounter{colnum}\gettext{\thecolnum} & \gettext{\gettext{\thecolnum}}
}
\newcommand{\macro}[2]{\addtext{\string#1}\settext{\string#1}{\noexpand#2}\newcommand{#1}{#2\xspace}}
% Define some general macros
\ifwindows
\macro{\OS}{Windows}
\fi
\ifmac
\macro{\OS}{Mac}
\fi
\iflinux
\macro{\OS}{Linux}
\fi
% Import the Site specific macros
\inputsite{macros}
% General macro for extracting the jobnumber from the jobid
\macro{\jobnumber}{\BeforeSubString{.}{\jobid}}
\macro{\pbsserver}{\BehindSubString{.}{\jobid}}
% Macro for winscp/putty fingerprint allert
\macro{\firsttimeconnection}{
The first time you make a connection to the login node, a Security
Alert will appear and you will be asked to verify the authenticity of the
login node.
\ifgent
Make sure the fingerprint in the Alert matches \strong{\loginfingerprint}
\fi
\begin{center}
\includegraphics*[width=3.42in]{ch2-putty-verify-authenticity}
\end{center}
}