\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{\_}sorting}
\label{ok_sorting}
\index{ok{\_}sorting}
\section{Description}
Test unit to test various {-}{-}sort settings.
\section{Overview}
\begin{description}
\item[\texttt{\begin{ttfamily}TMyClass\end{ttfamily} Class}]
\item[\texttt{\begin{ttfamily}TMyRecord\end{ttfamily} Record}]
\item[\texttt{\begin{ttfamily}ZZZClass\end{ttfamily} Class}]
\item[\texttt{\begin{ttfamily}AAAClass\end{ttfamily} Class}]
\end{description}
\begin{description}
\item[\texttt{ZZZProc}]
\item[\texttt{AAAProc}]
\end{description}
\section{Classes, Interfaces, Objects and Records}
\ifpdf
\subsection*{\large{\textbf{TMyClass Class}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{TMyClass Class}
\fi
\label{ok_sorting.TMyClass}
\index{TMyClass}
\subsubsection*{\large{\textbf{Hierarchy}}\normalsize\hspace{1ex}\hfill}
TMyClass {$>$} TObject
%%%%Description
\subsubsection*{\large{\textbf{Properties}}\normalsize\hspace{1ex}\hfill}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{ZZZProp}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\label{ok_sorting.TMyClass-ZZZProp}
\index{ZZZProp}
\item[\textbf{ZZZProp}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public property ZZZProp;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \label{ok_sorting.TMyClass-AAAProp}
\index{AAAProp}
\item[\textbf{AAAProp}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public property AAAProp;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \end{list}
\subsubsection*{\large{\textbf{Fields}}\normalsize\hspace{1ex}\hfill}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{ZZZField}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\label{ok_sorting.TMyClass-ZZZField}
\index{ZZZField}
\item[\textbf{ZZZField}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public ZZZField: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \label{ok_sorting.TMyClass-AAAField}
\index{AAAField}
\item[\textbf{AAAField}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public AAAField: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \end{list}
\subsubsection*{\large{\textbf{Methods}}\normalsize\hspace{1ex}\hfill}
\paragraph*{ZZZMethod}\hspace*{\fill}

\label{ok_sorting.TMyClass-ZZZMethod}
\index{ZZZMethod}
\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}
public procedure ZZZMethod;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\paragraph*{AAAMethod}\hspace*{\fill}

\label{ok_sorting.TMyClass-AAAMethod}
\index{AAAMethod}
\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}
public procedure AAAMethod;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{TMyRecord Record}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{TMyRecord Record}
\fi
\label{ok_sorting.TMyRecord}
\index{TMyRecord}
%%%%Description
\subsubsection*{\large{\textbf{Fields}}\normalsize\hspace{1ex}\hfill}
\begin{list}{}{
\settowidth{\tmplength}{\textbf{ZZZField}}
\setlength{\itemindent}{0cm}
\setlength{\listparindent}{0cm}
\setlength{\leftmargin}{\evensidemargin}
\addtolength{\leftmargin}{\tmplength}
\settowidth{\labelsep}{X}
\addtolength{\leftmargin}{\labelsep}
\setlength{\labelwidth}{\tmplength}
}
\label{ok_sorting.TMyRecord-ZZZField}
\index{ZZZField}
\item[\textbf{ZZZField}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public ZZZField: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \label{ok_sorting.TMyRecord-AAAField}
\index{AAAField}
\item[\textbf{AAAField}\hfill]
\ifpdf
\begin{flushleft}
\fi
\begin{ttfamily}
public AAAField: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi


\par  \end{list}
\ifpdf
\subsection*{\large{\textbf{ZZZClass Class}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{ZZZClass Class}
\fi
\label{ok_sorting.ZZZClass}
\index{ZZZClass}
\subsubsection*{\large{\textbf{Hierarchy}}\normalsize\hspace{1ex}\hfill}
ZZZClass {$>$} TObject
%%%%Description
\ifpdf
\subsection*{\large{\textbf{AAAClass Class}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{AAAClass Class}
\fi
\label{ok_sorting.AAAClass}
\index{AAAClass}
\subsubsection*{\large{\textbf{Hierarchy}}\normalsize\hspace{1ex}\hfill}
AAAClass {$>$} TObject
%%%%Description
\section{Functions and Procedures}
\ifpdf
\subsection*{\large{\textbf{ZZZProc}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{ZZZProc}
\fi
\label{ok_sorting-ZZZProc}
\index{ZZZProc}
\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 ZZZProc;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{AAAProc}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{AAAProc}
\fi
\label{ok_sorting-AAAProc}
\index{AAAProc}
\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 AAAProc;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\section{Types}
\ifpdf
\subsection*{\large{\textbf{ZZZType}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{ZZZType}
\fi
\label{ok_sorting-ZZZType}
\index{ZZZType}
\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}
ZZZType = Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{AAAType}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{AAAType}
\fi
\label{ok_sorting-AAAType}
\index{AAAType}
\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}
AAAType = Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\section{Constants}
\ifpdf
\subsection*{\large{\textbf{ZZZConst}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{ZZZConst}
\fi
\label{ok_sorting-ZZZConst}
\index{ZZZConst}
\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}
ZZZConst = 1;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{AAAConst}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{AAAConst}
\fi
\label{ok_sorting-AAAConst}
\index{AAAConst}
\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}
AAAConst = 2;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\section{Variables}
\ifpdf
\subsection*{\large{\textbf{ZZZVar}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{ZZZVar}
\fi
\label{ok_sorting-ZZZVar}
\index{ZZZVar}
\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}
ZZZVar: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\ifpdf
\subsection*{\large{\textbf{AAAVar}}\normalsize\hspace{1ex}\hrulefill}
\else
\subsection*{AAAVar}
\fi
\label{ok_sorting-AAAVar}
\index{AAAVar}
\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}
AAAVar: Integer;\end{ttfamily}

\ifpdf
\end{flushleft}
\fi

\end{list}
\end{document}
