\makeatletter

\newcommand\proc{\texttt{/proc}}
\newcommand\cron{\texttt{cron}}
\newcommand\syscall[1]{\texttt{#1(2)}}
\newcommand\id[1]{\texttt{#1}}


% Section Model

{\catcode`_=\active\gdef\fixunderscore{\catcode`_=\active\def_{\_}}}
{\catcode`\^^I=\active\gdef\fixtab#1{\catcode`\^^I=\active\def^^I{#1}}}
{\catcode`\^^M=\active\gdef\fixnewline{\catcode`\^^M=\active\def^^M{\\}}}
{\xdef\star{$*$}\catcode`*=\active\gdef\fixstar{\catcode`*=\active\def*{\llap{\star\thinspace}}}}

\newenvironment{struct}[1]
  {%
   \medskip
   %\noindent
   \fixunderscore
   \fixstar
   \fixnewline
   \parskip=0pt%
   \sffamily
   \fixtab{&}\begin{tabular}{>{\hfill}m{2em}>{\bfseries}ll>{\itshape}p{3in}}%
   \mcol3{\typename{Struct #1} $\{$}%
  }
  {%
   \mcol3{$\}$}%
   \end{tabular}%
   \medskip
  }
\newcommand\persistent{\mcol2{\textsc{Persistent properties}}}
\newcommand\runtime{\mcol2{\textsc{Runtime properties}}}
\newcommand\typename[1]{\textbf{#1}}
\newcommand\comment[1]{// \textit{#1}}
\newcommand\key{\llap{{$\rightarrow$}}}
\newcommand\mcol[2]{\multicolumn{#1}{l}{#2}}


% Chapter Implementation

\newcommand\confkey[1]{\texttt{#1}}
\newcommand\opt[1]{\texttt{--#1}}
\newcommand\file[1]{\texttt{#1}}
\newcommand\sig[1]{\texttt{SIG#1}}
\newcommand\confkeydoc[4]{\textbf{\confkey{#1}:}\newline
	\textbf{Type:} #2\newline
	\ifx#3\relax\else
	\textbf{Unit:} #3\newline
	\fi
	\textbf{Default value:} #4\par}


% Chapter Algorithms

\renewcommand{\algorithmiccomment}[1]{\comment{#1}}
\renewcommand\P[1]{\Pr\left(#1\right)}

\newcommand\starts{\mbox{ starts}}
\newcommand\isread{\mbox{ is read}}
\newcommand\needed{\mbox{ is needed}}
\newcommand\notneeded{\mbox{ is not needed}}

%\newcommand\member[1]{\mbox{\textit{#1}}}
\newcommand\member[1]{#1}
\let\m\member

\newcommand\running{\member{running}}
\newcommand\markovs{\member{markovs}}
\newcommand\maps{\member{maps}}
\newcommand\state{\member{state}}
\renewcommand\a{\member{a}}
\renewcommand\b{\member{b}}
\newcommand\incore{\member{p\_incore}}
\newcommand\exes{\member{exes}}
\renewcommand\path{\member{path}}

\def\ind#1{[{#1}]}
\def\indd#1#2{[#1][#2]}

\makeatother
