\documentclass{report}
\usepackage{hyperref}
% WARNING: THIS SHOULD BE MODIFIED DEPENDING ON THE LETTER/A4 SIZE
\oddsidemargin 0cm
\evensidemargin 0cm
\marginparsep 0cm
\marginparwidth 0cm
\parindent 0cm
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}


% Conditional define to determine if pdf output is used
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\pdfoutput=1
\pdftrue
\fi

\ifpdf
  \usepackage[pdftex]{graphicx}
\else
  \usepackage[dvips]{graphicx}
\fi

% Write Document information for pdflatex/pdftex
\ifpdf
\pdfinfo{
 /Author     (Pasdoc)
 /Title      ()
}
\fi


% definitons for warning and note tag
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbwarning}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=red,
 title={Warning:},
}
\newtcolorbox{tcbnote}{
 breakable,
 enhanced jigsaw,
 top=0pt,
 bottom=0pt,
 titlerule=0pt,
 bottomtitle=0pt,
 rightrule=0pt,
 toprule=0pt,
 bottomrule=0pt,
 colback=white,
 arc=0pt,
 outer arc=0pt,
 title style={white},
 fonttitle=\color{black}\bfseries,
 left=8pt,
 colframe=yellow,
 title={Note:},
}

\begin{document}
\label{toc}\tableofcontents
\newpage
% special variable used for calculating some widths.
\newlength{\tmplength}
\chapter{Unit ok{\_}if{\_}expressions}
\label{ok_if_expressions}
\index{ok{\_}if{\_}expressions}
\section{Description}
Testcase for various conditional directives, primarily {\$}if and {\$}elseif.
\section{Overview}
\begin{description}
\item[\texttt{Windows{\_}IFDEF}]
\item[\texttt{Windows{\_}IFDEF{\_}ELSE}]
\item[\texttt{Windows{\_}IF}]
\item[\texttt{Windows{\_}IF{\_}DEFINED{\_}ALT}]
\item[\texttt{OptionR{\_}IF}]
\item[\texttt{True{\_}IF}]
\item[\texttt{SizeOf{\_}IF}]
\item[\texttt{Declared{\_}IF}]
\item[\texttt{WindowsAsUnix{\_}IF{\_}EQUALS}]
\item[\texttt{POSIXAsUnix{\_}IF{\_}EQUALS}]
\item[\texttt{FpcAndUnix{\_}IF{\_}2}]
\item[\texttt{Always}]
\end{description}
\section{Functions and Procedures}
\ifpdf
\subsection*{\large{\textbf{Windows{\_}IFDEF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Windows{\_}IFDEF}
\fi
\label{ok_if_expressions-Windows_IFDEF}
\index{Windows{\_}IFDEF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Windows{\_}IFDEF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{Windows{\_}IFDEF{\_}ELSE}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Windows{\_}IFDEF{\_}ELSE}
\fi
\label{ok_if_expressions-Windows_IFDEF_ELSE}
\index{Windows{\_}IFDEF{\_}ELSE}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Windows{\_}IFDEF{\_}ELSE;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{Windows{\_}IF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Windows{\_}IF}
\fi
\label{ok_if_expressions-Windows_IF}
\index{Windows{\_}IF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Windows{\_}IF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{Windows{\_}IF{\_}DEFINED{\_}ALT}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Windows{\_}IF{\_}DEFINED{\_}ALT}
\fi
\label{ok_if_expressions-Windows_IF_DEFINED_ALT}
\index{Windows{\_}IF{\_}DEFINED{\_}ALT}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Windows{\_}IF{\_}DEFINED{\_}ALT;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{OptionR{\_}IF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{OptionR{\_}IF}
\fi
\label{ok_if_expressions-OptionR_IF}
\index{OptionR{\_}IF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure OptionR{\_}IF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{True{\_}IF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{True{\_}IF}
\fi
\label{ok_if_expressions-True_IF}
\index{True{\_}IF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure True{\_}IF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{SizeOf{\_}IF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{SizeOf{\_}IF}
\fi
\label{ok_if_expressions-SizeOf_IF}
\index{SizeOf{\_}IF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure SizeOf{\_}IF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{Declared{\_}IF}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Declared{\_}IF}
\fi
\label{ok_if_expressions-Declared_IF}
\index{Declared{\_}IF}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Declared{\_}IF;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{WindowsAsUnix{\_}IF{\_}EQUALS}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{WindowsAsUnix{\_}IF{\_}EQUALS}
\fi
\label{ok_if_expressions-WindowsAsUnix_IF_EQUALS}
\index{WindowsAsUnix{\_}IF{\_}EQUALS}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure WindowsAsUnix{\_}IF{\_}EQUALS;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{POSIXAsUnix{\_}IF{\_}EQUALS}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{POSIXAsUnix{\_}IF{\_}EQUALS}
\fi
\label{ok_if_expressions-POSIXAsUnix_IF_EQUALS}
\index{POSIXAsUnix{\_}IF{\_}EQUALS}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure POSIXAsUnix{\_}IF{\_}EQUALS;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{FpcAndUnix{\_}IF{\_}2}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{FpcAndUnix{\_}IF{\_}2}
\fi
\label{ok_if_expressions-FpcAndUnix_IF_2}
\index{FpcAndUnix{\_}IF{\_}2}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure FpcAndUnix{\_}IF{\_}2;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{Always}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{Always}
\fi
\label{ok_if_expressions-Always}
\index{Always}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{Description}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\item[\textbf{Declaration}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
procedure Always;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\end{document}
