% \iffalse
%<*gobble>
% $Id: pst-pdgr.dtx,v 2.9 2017/11/20 21:27:26 boris Exp $
%
% Copyright 2006, 2007, Boris Veytsman <borisv@lk.net>, Leila Akhmadeeva
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any 
% later version.
% The latest version of the license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of
% LaTeX version 2003/06/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Boris Veytsman
%
% This work consists of the file pst-pdgr.dtx and the
% derived files pst-pdgr.tex, pst-pdgr.sty, pst-pdgr.pdf. 
%
% \fi 
% \CheckSum{0}
%
% \changes{v0.1}{2006/04/18}{The interface is mostly done}
% \changes{v0.2}{2006/04/19}{Added new examples}
% \changes{v0.3}{2007/07/20}{Documentation update}
%
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~} 
%
%\iffalse
%    \begin{macrocode}
\documentclass{ltxdoc}
\usepackage{array}
\usepackage{url}
\usepackage{graphicx}
\usepackage{pst-pdgr}
\usepackage{pstricks-add}
% Taken from xkeyval.dtx
\makeatletter
\def\DescribeOption#1{\leavevmode\@bsphack
              \marginpar{\raggedleft\PrintDescribeOption{#1}}%
              \SpecialOptionIndex{#1}\@esphack\ignorespaces}
\def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
\def\SpecialOptionIndex#1{\@bsphack
    \index{#1\actualchar{\protect\ttfamily#1}
           (option)\encapchar usage}%
    \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
           usage}\@esphack}
\def\DescribeOptions#1{\leavevmode\@bsphack
  \marginpar{\raggedleft\strut\emph{options}%
  \@for\@tempa:=#1\do{%
    \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
  }}\@esphack\ignorespaces}
\makeatother
\PageIndex
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\begin{document}
  \DocInput{pst-pdgr.dtx}
\end{document}
%    \end{macrocode}
%</gobble> 
% \fi
% \MakeShortVerb{|}
%
%\GetFileInfo{pst-pdgr.sty}
%\title{Creating Medical Pedigrees with PSTricks and \LaTeX.
%  \thanks{\copyright Boris Veytsman, Leila Akhmadeeva 2006, 2007}}
%\author{Boris Veytsman, \path{borisv@lk.net} \and Leila Akhmadeeva}
%\date{\filedate, \fileversion}
%\maketitle
%\begin{abstract}
%  A set of macros based on |PSTricks| to draw medical pedigrees
%  according to the recommendations for standardized human pedigree
%  nomenclature.  The drawing commands place the symbols on a
%  |pspicture| canvas.  An interface for making trees is also
%  provided.  The package can be used both with \LaTeX{} and
%  \PlainTeX.  A separate |Perl| program for generating \TeX{} files
%  from spreadsheets is provided elsewhere on |CTAN|.
%\end{abstract}
%
% \begin{center}
%     \begin{pspicture}(0,1)(7,7)
%     \rput(3,4){%
%       \pstree{\TpstPerson[female, obligatory, belowtext=Ann]{Ann}}{%
%         \def\psedge{\pstDescent}\psset{descarmA=1}
%         \pstree{\TpstPerson[male, affected, belowtext=John]{John}}{%
%           \TpstPerson[female, belowtext=Sue]{Sue}
%           \TpstPerson[male, belowtext=Paul]{Paul}
%           \TpstAbortion[affected, belowtext=male]{A1}
%           \pstree[thislevelsep=1.2]{\TpstPerson[male, 
%             belowtext=Peter, affected, proband]{Peter}}{%
%             \def\psedge{\ncline}
%             \TpstChildless[infertile]{C1}
%             }
%         }
%         \pstree{\TpstPerson[female, belowtext=Mary]{Mary}}{
%         \TpstPerson[female, belowtext=Joan]{Joan}
%         }
%       }
%     }
%     \pstRelationship[consanguinic]{Peter}{Joan}
%     \end{pspicture}
%  \end{center}
%   
% \clearpage
%
%\tableofcontents
%
% \clearpage
%
%\listoffigures
%\listoftables
% \clearpage
%
%\section{User Guide}
%\label{sec:user_guide}
% 
%
%\subsection{Introduction}
%\label{sec:intro}
%
% Medical pedigree is a very important tool for clinicians, genetic
% researchers and educators.  As stated
% in~\cite{PedigreeNomenclature95}, ``The construction of an accurate
% family pedigree is a fundamental component of a clinical genetic
% evaluation and of human genetic research.''  Unfortunately, up to
% now most geneticians make the pedigrees manually.  There are several
% programs for doing so (see a list at
% \url{http://www.kumc.edu/gec/prof/genecomp.html#pedigree}), but they
% are rather expensive, lack multilanguage support and the quality of
% typesetting is somewhat lacking.  This package tries to offer a
% \LaTeX-based solution for this problem.  It could be used with a
% companion \path{Perl} program \path{pedigree}~\cite{pedigree-perl},
% which converts databases of patients into a \LaTeX{} file.
%
% Note that there are ways to draw genealogical trees with
% |PSTricks|~\cite{PSTricks93}; see the beautiful ones at
% \url{http://www.tug.org/PSTricks/main.cgi?file=Examples/Genealogy/genealogy}.
% Unfortunately, medical pedigrees are often not \emph{trees}.
% Therefore we do not use tree approach throughout, but provide it as
% an alternative.   Our general approach is based on the use of
% nodes~\cite[Part~VII]{PSTricks93}.  Each person or entity is a node,
% and the lines are in fact |\ncline|s.  This provides a flexibility
% to draw complex pedigrees.
%
% Each node in the system \emph{must} have a name.  To prevent
% confusion with names of individuals, we call such name an \emph{id}.
% As usual in |PSTricks|, it is a sequence of letters and numbers
% starting with a letter.  This rule is very important; a name like 1
% or 1-1 can lead to mysterious PostScript errors.
%
% Our symbols follows the standard~\cite{PedigreeNomenclature95} with
% the exception that we do not implement showing several conditions
% on the same chart.
%
% To use the package, add the line
% \begin{verbatim}
% \usepackage{pst-pdgr}
% \end{verbatim}
% to a \LaTeX{} document or
% \begin{verbatim}
% \input pst-pdgr.tex
% \end{verbatim}
% to a \PlainTeX{} one.  Note that since this is a |PSTricks|
% package, you need to use \path{tex-dvips} path to compile your
% document.  If you need a PDF document, you can use \path{ps2pdf} or
% packages like \path{pst-pdf}, \path{ps4pdf}, \path{pstricks}.
%
% If you are using the package in a \LaTeX{} document, you have an
% added benefit of a local configuration file |pst-pdgr.cfg|.  Such
% file, if exists, will be read. It can be used to override package
% settings (use |\AtEndOfPackage| for this).
%
%
%
%\subsection{Global Settings}
%\label{sec:globals}
% 
% By default the size of each node is |0.5 unit|.  You can change
% the size by setting the value of  |unit| (1\,cm by default)
% with |\psset|
%
%\DescribeMacro{\affectedstyle}
%\DescribeMacro{\affectedbgcolor}
% By default the affected individual is drawn as a black node.  This
% could be changed by setting |\affectedstyle| and
% |\affectedbgcolor|, see Figure~\ref{fig:affectedstyle}.  
%\DescribeMacro{\affectedfgcolor}
% Sometimes we need to write something inside a node representing an
% affected individual.  An example in~\cite{PedigreeNomenclature95}
% changes in this situation the style from filled to hatched, which
% looks inconsistent.  We rather change the color of the foreground,
% as shown on Fig.~\ref{fig:affectedfgcolor}. 
%
% \begin{figure}
%   \centering
%   \begin{minipage}[t]{0.4\linewidth}
%     \centering
%       \begin{pspicture}(2,2)
%         \def\affectedbgcolor{blue}
%          \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
%       \end{pspicture}\leavevmode\\
%       \small
%     |\def\affectedbgcolor{%|\\
%       |blue}|
%   \end{minipage}
%   \begin{minipage}[t]{0.4\linewidth}
%     \centering
%       \begin{pspicture}(2,2)
%         \def\affectedstyle{fillstyle=hlines, hatchcolor=\affectedbgcolor}
%          \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
%       \end{pspicture}\leavevmode\\
%       \small
%       |\def\affectedstyle{fillstyle=%|\\
%         |hlines,hatchcolor=\affectedbgcolor}|
%   \end{minipage}
%   \caption{Setting Style of Affected Individuals}
%   \label{fig:affectedstyle}
% \end{figure}
%
% \begin{figure}
%   \centering
%   \begin{minipage}[t]{0.4\linewidth}
%     \centering
%       \begin{pspicture}(2,2)
%          \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
%          \rput(1,1){\expandafter\textcolor\expandafter{%
%              \affectedfgcolor}{\Huge 2}}
%       \end{pspicture}\leavevmode\\
%       \small
%     default
%   \end{minipage}
%   \begin{minipage}[t]{0.4\linewidth}
%     \centering
%       \begin{pspicture}(2,2)
%         \def\affectedfgcolor{green}
%          \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
%          \rput(1,1){\expandafter\textcolor\expandafter{%
%              \affectedfgcolor}{\Huge 2}}
%       \end{pspicture}
%       \small
%     |\def\affectedfgcolor{green}|
%   \end{minipage}
%   \caption{Use of Foreground Colors for Affected Individuals }
%   \label{fig:affectedfgcolor}
% \end{figure}
%
%
%\subsection{Node Drawing Commands}
%\label{sec:node_commands}
%
%
% The node drawing commands are based on the |\pnode| commands from
% |PSTricks|~\cite[Part~VII]{PSTricks93}.  It is the preferred command
% for drawing, for example, a ``marriage node'' (see the examples
% below).  It is useful to remember this when drawing complex
% pedigrees.  
%
%
%\subsubsection{One Person}
%\label{sec:person}
%
% \DescribeMacro{\pstPerson} The main command in the package is
% |\pstPerson|.  It draws one person, which is a |PSTricks| node.  It
% has the following structure: |\pstPerson|\oarg{options}\marg{id}.
% The parameter \meta{id} is the name of the node.  It can be used to
% make connections to the node (see below).
%
% There are many options to this command.  As other |PSTricks|
% options, the also can be set globally through |\psset| command.
%
% 
% \DescribeOptions{sex,condition,deceased,proband,adopted,evaluated}
% The first group of options describes the state of the person:  sex,
% condition with respect to the decease, whether the person is
% deceased, is a proband, was adopted and was evaluated.  These
% options are listed in Table~\ref{tab:person_state_opts}.  Some 
% options of this group can take only two values: |true| or |false|.
% For simplicity the clause |=true| can be omitted, so the clauses
% |adopted=true| and |adopted| are equivalent.  Two options: |sex| and
% |condition| can take several values each (geneticians consider three
% possibilities for sex: |male|, |female| and |unknown|).  Again for
% simplicity the clauses |sex=| and |condition=| can be omitted, so
% the invocations |sex=male| and |male| are equivalent, as well as
% |condition=asymptomatic| and |asymptomatic|.
%
% \DescribeOptions{insidetext,abovetext,belowtext,lefttext,righttext}
% The second group of options (Table~\ref{tab:person_text_opts}) is
% used to putting text comments inside the symbol, above it, below it
% or to the right or left to it.  The text will be typeset in a
% |PSTricks| LR-box~\cite{PSTricks93}; additional control over the
% text position can be achieved by using |\parbox| or \PlainTeX{}
% boxes. 
%
% \DescribeOptions{abovetextrp,belowtextrp,lefttextrp,righttextrp} 
% The third group of options (Table~\ref{tab:person_text_rp_opts}) is
% used to set the text position with respect to the node.  They set
% the reference point of the text.  They correspond to the usual
% notation: |r| being right, |l| being left, |t| being top, |b| being
% bottom and |B| being baseline.  The setting |={}| makes the
% reference point to be the center of the box.  Note that to prevent
% the text above and below the symbol to clash with the descent lines,
% the spaces of |2\pslinewidth| are added to the right and to the left
% of the symbol.
%
% Examples of usage of this command are shown in
% Table~\ref{tab:pstPerson}.
%
%
% \begin{table}
%   \centering
%   \begin{tabular}{l>{\raggedright\obeylines
%       }p{0.3\linewidth}lp{0.3\linewidth}}
%     \hline
%     Option  & Values  & Default  & Description \\
%     \hline
%     |sex| & |male|, |female|, |unknown| & |unknown| & Sex of the
%     person\\
%     |condition| & |normal|, |obligatory|, |asymptomatic|, |affected|
%     & |normal|  & The condition of the person\\
%     |deceased| & |true|, |false|  & |false|  & Whether the person is
%     deceased \\
%     |proband| & |true|, |false| & |false| & Whether the person is a
%     proband\\  
%     |adopted| & |true|, |false| & |false| & Whether the individual
%     is adopted \\
%     |evaluated|  & |true|, |false| & |false| & Whether a documented
%     evaluation took place\\
%     \hline
%   \end{tabular}
%   \caption{Options Showing State of a Person}
%   \label{tab:person_state_opts}
% \end{table}
%
%
%
% \begin{table}
%   \centering
%   \begin{tabular}{l>{\raggedright\obeylines
%       }llp{0.5\linewidth}}
%     \hline
%     Option  & Values  & Default  & Description \\
%     \hline
%     |insidetext| & String  & None & A text to be placed inside the
%     symbol (number of individuals, pregnancy, etc.)\\ 
%     |abovetext| & String  & None & A text to be placed above the
%     symbol (name, number, etc.)\\ 
%     |belowtext| & String  & None & A text to be placed below the
%     symbol (name, number, etc.)\\ 
%     |lefttext| & String  & None & A text to be placed to the left of the
%     symbol (name, number, etc.)\\ 
%     |righttext| & String  & None & A text to be placed to the right of the
%     symbol (name, number, etc.)\\ 
%     \hline
%   \end{tabular}
%   \caption{Options for Making Textual Comments}
%   \label{tab:person_text_opts}
% \end{table}
%
% \begin{table}
%   \centering
%   \begin{tabular}{l>{\raggedright\obeylines
%       }p{0.25\linewidth}lp{0.35\linewidth}}
%     \hline
%     Option  & Values  & Default  & Description \\
%     \hline
%     |abovetextrp| & Combination of |r| or |l| and |t|, |b| or |B|  &
%     |lB| & The reference point for the text above the symbol\\ 
%     |belowtextrp| & Combination of |r| or |l| and |t|, |b| or |B|  &
%     |lt| & The reference point for the text below the symbol\\ 
%     |lefttextrp| & Combination of |r| or |l| and |t|, |b| or |B|  &
%     |r| & The reference point for the text to the left the symbol\\ 
%     |righttextrp| & Combination of |r| or |l| and |t|, |b| or |B|  &
%     |l| & The reference point for the text to the right the symbol\\ 
%     \hline
%   \end{tabular}
%   \caption{Options for Setting Text Reference Point}
%   \label{tab:person_text_rp_opts}
% \end{table}
%
%
% \begin{table}
%   \centering
%     \def\arraystretch{1.5}
%     \begin{tabular}{>{\tt\bslash pstPerson[}p{0.6\textwidth}<{]\{P\}}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Result\rule{0.5cm}{0cm}\\
%       \hline
%       condition=asymptomatic &
%       \pstPerson[condition=asymptomatic]{A} \\
%       condition=affected, sex=male, evaluated &
%       \pstPerson[condition=affected,sex=male, evaluated]{A} \\
%       obligatory, female &
%       \pstPerson[obligatory, female]{A} \\
%       asymptomatic, male, proband &
%       \pstPerson[asymptomatic, male, proband]{A} \\
%       condition=obligatory, sex=male, deceased &
%       \pstPerson[condition=obligatory, sex=male, deceased]{A} \\
%       sex=female, adopted, condition=affected, abovetext=Jane &
%       \pstPerson[sex=female, adopted, condition=affected,
%       abovetext=Jane]{A} \\ 
%       sex=male, condition=affected, belowtext=20 yr, deceased &
%       \pstPerson[sex=male,  condition=affected, deceased,
%       belowtext=20 yr]{A} \\[5ex]
%       unknown, affected, righttext=\bslash
%       parbox\{1cm\}\{\bslash footnotesize A \bslash\bslash 1 w\} &
%       \pstPerson[unknown,  affected,
%       righttext=\parbox{1cm}{\footnotesize A\\1 w}]{A} \\
%       sex=male, insidetex=5 &
%       \pstPerson[sex=male,  insidetext=5]{A}\\
%       sex=female, condition=affected, insidetext=P &
%       \pstPerson[sex=female, condition=affected, insidetext=P]{A}\\
%       sex=female, affected, belowtext=\bslash
%       parbox\{1cm\}\{\bslash centering SB\bslash\bslash 2wks\}, deceased &
%       \pstPerson[sex=female,  affected, deceased,
%       belowtext=\parbox{1cm}{\centering SB\\ 2wks}]{A} \\[7ex]
%       \hline
%     \end{tabular}
%   \caption{Examples of Persons}
%   \label{tab:pstPerson}
% \end{table}
%
%
%\subsubsection{Pregnancy Not Carried To Term}
%\label{sec:abortion}
% 
% \DescribeMacro{\pstAbortion} 
% The command |\pstAbortion| is used to draw a pregnancy not carried
% to term: spontaneous abortions or terminated pregnancies.  The
% format of it the same as for the command |\pstPerson| (see
% Section~\ref{sec:person}): |\pstAbortion|\oarg{options}\marg{id}.
% However, many of options listed in Table~\ref{tab:person_state_opts} are
% silently ignored.  The only options meaningful for these nodes are
% |sex| and |condition| (only |normal| and |affected| values are
% possible).  All options listed in Table~\ref{tab:person_text_opts}
% and \ref{tab:person_text_rp_opts} are valid and have the same
% meaning as in Section~\ref{sec:person}. 
%
% \DescribeOption{sab} 
% The command has also an option |sab| with the values |true| or
% |false|.  If it is |true|, the pregnancy is a spontaneous abortion.
% Otherwise it is terminated.  Examples of usage of this command are
% shown in Table~\ref{tab:abortions}.
%
%
% \begin{table}
%   \centering
%     \def\arraystretch{2}
%     \begin{tabular}{>{\tt\bslash pstAbortion[}p{0.6\textwidth}<{]\{A\}}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Symbol\\
%       \hline
%         belowtext=male   & \rule{0cm}{1cm} \pstAbortion[belowtext=male]{A}\\
%         sab, righttext=1w &  \pstAbortion[sab, righttext=1w]{A}\\
%         affected &  \pstAbortion[affected]{A}\\
%       \hline
%     \end{tabular}
%   \caption{Examples of Abortion Symbols}
%   \label{tab:abortions}
% \end{table}
%
%\subsubsection{Childlessness and Infertility}
%\label{sec:childness}
% 
% The symbols for childlessness and infertility are listed under
% ``line definitions'' in~\cite{PedigreeNomenclature95}.  However, to
% make the placing the symbols on the chart more flexible, we assign
% nodes to them.  
%
% \DescribeMacro{\pstChildless} 
% The command for drawing these symbols
% has the same structure as the other node drawing commands:
% |\pstChildless}|\oarg{options}\marg{id}.  
% While all options listed in Table~\ref{tab:pstPerson} are valid, the
% only meaningful one is |belowtext|.  Note that the option
% |belowtextrp| is silently ignored:  the text is always centered
% below the infertility symbol.  
%
% \DescribeOption{infertile}
% There is one additional option
% |infertile|, which can have values |true| of |false|.  If it is
% |false|, the person (or relationship) is childless by choice (or by
% an unknown reason).  The clause |=true| can be omitted.
% 
%
% \begin{table}
%   \centering
%     \def\arraystretch{2}
%     \begin{tabular}{>{\tt\bslash pstChildless[}p{0.6\textwidth}<{]\{C\}}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Symbol\rule{0.5cm}{0cm}\\
%       \hline
%         belowtext=vasectomy   &
%         \pstChildless[belowtext=vasectomy]{A}\\
%         belowtext=anospermia, infertile   &
%         \pstChildless[belowtext=anospermia, infertile]{A}\\
%       \hline
%     \end{tabular}
%   \caption{Examples of Childlessness or Infertility Symbols}
%   \label{tab:childness}
% \end{table}
%
%
%
%\subsection{Connection Drawing Commands}
%\label{sec:lines}
%
% The connections in pedigrees are based on |\ncline| and friends.
% There are, however, some additional features for pedigree
% connections.  
%
%
%\subsubsection{Relationship}
%\label{sec:relationship}
%
%\DescribeMacro{\pstRelationship}
% Relationships are marriages or other unions.  The main command for
% drawing relationships is 
% |\pstRelationship|\oarg{options}\marg{nodeA}\marg{nodeB}.  It draws
% a relationship line between \marg{nodeA} and \marg{nodeB}.  Normal
% |PSTricks| options like |linestyle=dashed| can be used with the
% expected effect.
%
% \DescribeOptions{broken,consanguinic,descentnode,brokenpos,descentnodepos,rellinecmd}
% There are also several options specific for this command, listed in
% Table~\ref{tab:relationship_opts}. The options |broken| and
% |consanguinic| are self-explanatory.  The option |descentnode| is
% used, if we want the descent lines to start at a node on the
% relationship line.  The name of this descent node must satisfy the
% usual criteria for the node (see Section~\ref{sec:intro}).  The
% options |brokenpos| and |descentnodepos| determine, where on the
% relationship line the corresponding objects are placed.  The option
% |rellinecmd| allows to change the default straight line for the
% relationship to something else, like |ncbar|, |ncangle|, etc.
% Examples of this command use are shown in
% Table~\ref{tab:pstRelationship}
%
%
%
% \begin{table}
%   \centering
%   \begin{tabular}{l>{\raggedright\obeylines
%       }p{0.2\linewidth}lp{0.3\linewidth}}  
%     \hline
%     Option  & Values  & Default  & Description \\
%     \hline
%     |broken|  & |true|, |false|  & |false| & Whether the
%     relationship no longer exists\\
%     |consanguinic| & |true|, |false|  & |false|  & Whether the
%     relationship is consanguinic\\
%     |descentnode|  &  Node name  & None  & A node that will be used
%     to draw descent lines for the relationship \\
%     |brokenpos|  & A number between 0 and 1  & 0.3 & Where to put the
%     symbol for broken relationship on the line (as a fraction of the
%     line length)\\
%     |descentnodepos|  & A number &  0.5 & Where
%     to put the the descent node on the relationship line\\
%     |rellinecmd|  & Name  & |ncline|  & Name of the line drawing
%     command (without \textbackslash)\\
%     \hline
%   \end{tabular}
%   \caption{Options for Relationship Lines}
%   \label{tab:relationship_opts}
% \end{table}
%
% \begin{table}
%   \centering
%     \def\arraystretch{1.5}
%     \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Result\\
%       \hline
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{B\}\}
%         \bslash pstRelationship[broken]\{A\}\{B\}
%       &
%       \begin{pspicture}[shift=-1](3,1)
%         \rput(0.5,0.5){\pstPerson[male]{A}}
%         \rput(2.5,0.5){\pstPerson[female]{B}}
%         \pstRelationship[broken]{A}{B}
%       \end{pspicture}\\
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{B\}\}
%         \bslash pstRelationship[consanguinic]\{A\}\{B\}
%       &
%       \begin{pspicture}[shift=-1](3,1)
%         \rput(0.5,0.5){\pstPerson[male]{A}}
%         \rput(2.5,0.5){\pstPerson[female]{B}}
%         \pstRelationship[consanguinic]{A}{B}
%       \end{pspicture}\\
%         \bslash rput(0.5,1.5)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(2.5,1.5)\{\bslash pstPerson[female]\{B\}\}
%         \bslash rput(1.5,0.5)\{\bslash pstPerson[female]\{C\}\}
%         \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
%         \bslash ncline\{AB\}\{C\}
%       &
%       \begin{pspicture}[shift=-1](3,2)
%         \rput(0.5,1.5){\pstPerson[male]{A}}
%         \rput(2.5,1.5){\pstPerson[female]{B}}
%         \rput(1.5,0.5){\pstPerson[female]{C}}
%         \pstRelationship[descentnode=AB]{A}{B}
%         \ncline{AB}{C}
%       \end{pspicture}\\
%         \bslash rput(0.5,1.5)\{\bslash
%         pstPerson[male, belowtext=1-1]\{A\}\} 
%         \bslash rput(2.5,1.5)\{\bslash
%         pstPerson[affected, female, belowtext=1-2]\{B\}\} 
%         \bslash rput(1.5,0.6)\{\bslash pstPerson[male,
%         belowtext=2-1]\{C\}\} 
%         \bslash pstRelationship[descentnode=AB, rellinecmd=ncangle,
%         angleA=90, angleB=90, descentnodepos=1.5,
%         broken, brokenpos=1.2]\{A\}\{B\}
%         \bslash ncline\{AB\}\{C\}
%       &
%       \begin{pspicture}[shift=-1](3,3)
%         \rput(0.5,1.5){\pstPerson[male,belowtext=1-1]{A}}
%         \rput(2.5,1.5){\pstPerson[affected,female, belowtext=1-2]{B}}
%         \rput(1.5,0.6){\pstPerson[male, belowtext=2-1]{C}}
%         \pstRelationship[descentnode=AB, rellinecmd=ncangle,
%         angleA=90, angleB=90, descentnodepos=1.5,
%         broken, brokenpos=1.2]{A}{B}
%         \ncline{AB}{C}
%       \end{pspicture}\\
%       \hline
%     \end{tabular}
%   \caption{Examples of Relationships}
%   \label{tab:pstRelationship}
% \end{table}
%
%
%\subsubsection{Descent}
%\label{sec:pstDescent}
% 
% \changes{v0.3}{2007/06/24}{Added option descarmA}
% The paper~\cite{PedigreeNomenclature95} distinguishes between
% descent line and sibs line.  We, however, will call all segments of
% the line, joining a parent (or a descent node) and a child, the
% descent line.  \DescribeMacro{\pstDescent} The main command for
% showing parent-child relations is
% |\pstDescent|\oarg{options}\marg{Parent}\marg{Child}.  
% \DescribeOption{descarmA}
% \marginpar{New in v0.3}
% The descent line consists of three segments:  the vertical arm from the
% parent node,  the vertical arm from the child node and the
% horizontal segment connecting these arms.  When there are several
% sibs, the horizontal segments form the sibs line.  The length 
% |descarmA| is the length of the first segment.  By default it is 0.8
% (in |PSTricks| units), but it can be changed by the usual |\psset|
% command or in the option list of |\pstDescent|.  Note that it is
% calculated from the center of the node rather than from the node
% edge. 
% 
% Examples of |\pstDescent| are shown in Table~\ref{tab:pstDescent}.
% Note the |PSTricks| option |linestyle=dashed| used to show social
% parentage in the first example.
%
%
%
% \begin{table}
%   \centering
%     \def\arraystretch{1.5}
%     \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Result\\
%       \hline
%         \bslash rput(1.5,2)\{\bslash pstPerson[female]\{A\}\}
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[female, adopted]\{B\}\}
%         \bslash rput(1.5,0.5)\{\bslash pstPerson[male]\{C\}\}
%         \bslash rput(2.5,0.5)\{\bslash pstAbortion[female]\{D\}\}
%         \bslash pstDescent[linestyle=dashed]\{A\}\{B\}
%         \bslash pstDescent\{A\}\{C\}
%         \bslash pstDescent\{A\}\{D\}
%       &
%       \begin{pspicture}[shift=-1](3,2.5)
%         \rput(1.5,2){\pstPerson[female]{A}}
%         \rput(0.5,0.5){\pstPerson[female, adopted]{B}}
%         \rput(1.5,0.5){\pstPerson[male]{C}}
%         \rput(2.5,0.5){\pstAbortion[female]{D}}
%         \pstDescent[linestyle=dashed]{A}{B}
%         \pstDescent{A}{C}
%         \pstDescent{A}{D}
%       \end{pspicture}\\
%         \bslash psset\{descarmA=1\}
%         \bslash rput(0.5,2)\{\bslash pstPerson[male, belowtext=Fred]\{A\}\}
%         \bslash rput(2.5,2)\{\bslash pstPerson[female, obligatory, belowtext=Ginger]\{B\}\}
%         \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[male,asymptomatic, belowtext=John]\{C1\}\}
%         \bslash rput(1.5,0.5)\{\bslash pstPerson[female, belowtext=Mary]\{C2\}\}
%         \bslash rput(2.5,0.5)\{\bslash pstAbortion[sab, affected, belowtext=male]\{C3\}\}
%         \bslash pstDescent\{AB\}\{C1\}
%         \bslash pstDescent\{AB\}\{C2\}
%         \bslash pstDescent\{AB\}\{C3\}
%       &
%       \begin{pspicture}[shift=-1](0,-0.2)(3.5,2.5)
%         \psset{descarmA=1}
%         \rput(0.5,2){\pstPerson[male, belowtext=Fred]{A}}
%         \rput(2.5,2){\pstPerson[female, obligatory, belowtext=Ginger]{B}}
%         \pstRelationship[descentnode=AB]{A}{B}
%         \rput(0.5,0.5){\pstPerson[male,asymptomatic, belowtext=John]{C1}}
%         \rput(1.5,0.5){\pstPerson[female, belowtext=Mary]{C2}}
%         \rput(2.5,0.5){\pstAbortion[sab, affected, belowtext=male]{C3}}
%         \pstDescent{AB}{C1}
%         \pstDescent{AB}{C2}
%         \pstDescent{AB}{C3}
%       \end{pspicture}\\
%         \bslash rput(0.5,1.5)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(2.5,1.5)\{\bslash pstPerson[female]\{B\}\}
%         \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
%         \bslash rput(1.5,0.5)\{\bslash pstChildless[infertile, belowtext=anospermia]\{C\}\}
%         \bslash pstDescent\{AB\}\{C\}
%       &
%       \begin{pspicture}[shift=-1](0,-0.2)(3,2)
%         \rput(0.5,1.5){\pstPerson[male]{A}}
%         \rput(2.5,1.5){\pstPerson[female]{B}}
%         \pstRelationship[descentnode=AB]{A}{B}
%         \rput(1.5,0.5){\pstChildless[belowtext=anospermia, infertile]{C}}
%         \pstDescent{AB}{C}
%       \end{pspicture}\\
%       \hline
%     \end{tabular}
%   \caption{Examples of Descent Lines}
%   \label{tab:pstDescent}
% \end{table}
% 
%
%\subsubsection{Twins}
%\label{sec:pstTwins}
%
%
%
% \DescribeMacro{\pstTwins} A special care is needed when we talk
% about twins.  First, the user must define a \emph{twin node}: the
% node which is used as a nexus for twin lines.  Then the following
% command draws all the necessary
% lines: \\
% |\pstTwins|\oarg{options}\marg{Parent}\marg{TwinNode}\marg{LeftTwin}\marg{RightTwin}.
%
% \DescribeOptions{monozygotic,qzygotic,mzlinepos,addtwin}
% The options for this command are listed in
% Table~\ref{tab:twin_opts}.  The option |monozygotic| allows to show
% that the twins are monozygotic.  The actual position of the
% horizontal line is determined by the option |mzlinepos|.  If it is
% unknown, whether the twins are monozygotic or not, |qzygotic|
% options draws a question mark, as recommended
% by~\cite{PedigreeNomenclature95}.  Note that |mzlinepos| in this
% situation helps to position the question mark properly.  The option
% |addtwin| allows to draw pedigrees with more than two twins.  It can
% be repeated several times if necessary.  Examples of the usage of
% this command are shown in Table~\ref{tab:pstTwins}.
%
% \DescribeOption{descarmA}
% The first part of the |pstTwins| line has the same shape as
% |\pstDescent|.  The option |descarmA| has the same meaning, as for
% |\pstDescent|.  Therefore if there are both twins and non-twins, as
% in the first example in Table~\ref{tab:pstTwins}, the sibs segment
% is drawn correctly.
% 
% \begin{table}
%   \centering
%   \begin{tabular}{l>{\raggedright\obeylines
%       }p{0.2\linewidth}lp{0.3\linewidth}}  
%     \hline
%     Option  & Values  & Default  & Description \\
%     \hline
%     |monozygotic|  & |true|, |false|  & |false| & Whether the twins
%     are monozygotic\\
%     |qzygotic|  & |true|, |false|  & |false| & Whether the
%     monozygoticity of twins is questionable\\
%     |addtwin| & Twin node  & Node  & Additional twin node id if
%     there are more than two twins (this
%     option may be repeated)\\
%     |mzlinepos|  & A number &  0.5 & Where to put the horizontal
%     line for monozygotic twins (as a factor of the total line length)\\
%     \hline
%   \end{tabular}
%   \caption{Options for Twins Lines}
%   \label{tab:twin_opts}
% \end{table}
%
%
% \begin{table}
%   \centering
%     \def\arraystretch{1.5}
%     \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
%       \hline
%       \multicolumn{1}{l}{Command} & Result\\
%       \hline
%         \bslash rput(1.5,2)\{\bslash pstPerson[female]\{A\}\}
%         \bslash rput(1,1.1)\{\bslash pnode\{Twins\}\}
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{B\}\}
%         \bslash rput(1.5,0.5)\{\bslash pstPerson[male]\{C\}\}
%         \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{D\}\}
%         \bslash pstTwins[monozygotic]\{A\}\{Twins\}\{B\}\{C\}
%         \bslash pstDescent\{A\}\{D\}
%       &
%       \begin{pspicture}(3,2.5)
%         \rput(1.5,2){\pstPerson[female]{A}}
%         \rput(1,1.1){\pnode{Twins}}
%         \rput(0.5,0.5){\pstPerson[male]{B}}
%         \rput(1.5,0.5){\pstPerson[male]{C}}
%         \rput(2.5,0.5){\pstPerson[female]{D}}
%         \pstTwins[monozygotic]{A}{Twins}{B}{C}
%         \pstDescent{A}{D}
%       \end{pspicture}\\
%         \bslash rput(0.5,2)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(2.5,2)\{\bslash pstPerson[female]\{B\}\}
%         \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
%         \bslash rput(1.5,1.2)\{\bslash pnode\{Twins\}\}
%         \bslash rput(1,0.5)\{\bslash pstPerson[male]\{C1\}\}
%         \bslash rput(2,0.5)\{\bslash pstPerson[male]\{C2\}\}
%         \bslash pstTwins[qzygotic, mzlinepos=0.8]\{AB\}\{Twins\}\{C1\}\{C2\}
%       &
%       \begin{pspicture}(3,2.5)
%         \rput(0.5,2){\pstPerson[male]{A}}
%         \rput(2.5,2){\pstPerson[female]{B}}
%         \pstRelationship[descentnode=AB]{A}{B}
%         \rput(1.5,1.2){\pnode{Twins}}
%         \rput(1,0.5){\pstPerson[male]{C1}}
%         \rput(2,0.5){\pstPerson[male]{C2}}
%         \pstTwins[qzygotic, mzlinepos=0.8]{AB}{Twins}{C1}{C2}
%       \end{pspicture}\\
%         \bslash rput(1.5,2)\{\bslash pstPerson[male]\{A\}\}
%         \bslash rput(1.5,1.5)\{\bslash pnode\{Twins\}\}
%         \bslash rput(0.5,0.5)\{\bslash pstPerson[female]\{B\}\}
%         \bslash rput(1.2,0.5)\{\bslash pstPerson[female]\{C\}\}
%         \bslash rput(1.9,0.5)\{\bslash pstPerson[female]\{D\}\}
%         \bslash rput(2.6,0.5)\{\bslash pstPerson[female]\{E\}\}
%         \bslash pstTwins[descarmA=0.5, 
%         addtwin=C, addtwin=D]\{A\}\{Twins\}\{B\}\{E\}
%       &
%       \begin{pspicture}(3,2.5)
%         \rput(1.5,2){\pstPerson[male]{A}}
%         \rput(1.5,1.5){\pnode{Twins}}
%         \rput(0.5,0.5){\pstPerson[female]{B}}
%         \rput(1.2,0.5){\pstPerson[female]{C}}
%         \rput(1.9,0.5){\pstPerson[female]{D}}
%         \rput(2.6,0.5){\pstPerson[female]{E}}
%         \pstTwins[descarmA=0.5, addtwin=C, addtwin=D]{A}{Twins}{B}{E}
%       \end{pspicture}\\
%       \hline
%     \end{tabular}
%   \caption{Examples of Twins Lines}
%   \label{tab:pstTwins}
% \end{table}
% 
%
%
%\subsection{Making Trees}
%\label{sec:trees}
%
% As discussed above (Section~\ref{sec:intro}), the medical pedigrees
% are not necessary trees.  Even if they are, they are usually not
% simple layered trees.  Nevertheless sometimes pedigree can be
% represented as a layered tree.  For such cases we provide tree
% drawing commands.  See the discussion in~\cite{pedigree-perl} for
% more details.
%
% \DescribeMacro{\TpstPerson}
% \DescribeMacro{\TpstAbortion}
% \DescribeMacro{\TpstChildless}
% The macros |\TpstPerson|, |\TpstAbortion| and |\TpstChildless| have
% the same options and arguments as their ``normal'' counterparts.  You
% probably need to use command like
% \begin{verbatim}
% \def\psedge{\pstDescent}
% \psset{descarmA=1}
% \end{verbatim}
% in your code.  An example of us of such commands is shown on
% Figure~\ref{fig:example_tree}.  Note that the resulting figure is
% \emph{not} a tree!  The corresponding code is shown on
% Figure~\ref{fig:example_tree_code}. 
%
% \begin{figure}
%   \centering
%     \begin{pspicture}(0,1)(7,7)
%     \rput(3,4){%
%       \pstree{\TpstPerson[female, obligatory, belowtext=Ann]{Ann}}{%
%         \def\psedge{\pstDescent}\psset{descarmA=1}
%         \pstree{\TpstPerson[male, affected, belowtext=John]{John}}{%
%           \TpstPerson[female, belowtext=Sue]{Sue}
%           \TpstPerson[male, belowtext=Paul]{Paul}
%           \TpstAbortion[affected, belowtext=male]{A1}
%           \pstree[thislevelsep=1.2]{\TpstPerson[male, 
%             belowtext=Peter, affected, proband]{Peter}}{%
%             \def\psedge{\ncline}
%             \TpstChildless[infertile]{C1}
%             }
%         }
%         \pstree{\TpstPerson[female, belowtext=Mary]{Mary}}{
%         \TpstPerson[female, belowtext=Joan]{Joan}
%         }
%       }
%     }
%     \pstRelationship[consanguinic]{Peter}{Joan}
%     \end{pspicture}
%   \caption{Example of Using Tree-Making Commands}
%   \label{fig:example_tree}
% \end{figure}
%
% \begin{figure}
%   \centering
% \begin{verbatim}
%  \begin{pspicture}(0,1)(7,7)
%     \rput(3,4){%
%       \pstree{\TpstPerson[female, obligatory, belowtext=Ann]{Ann}}{%
%         \def\psedge{\pstDescent}\psset{descarmA=1}
%         \pstree{\TpstPerson[male, affected, belowtext=John]{John}}{%
%           \TpstPerson[female, belowtext=Sue]{Sue}
%           \TpstPerson[male, belowtext=Paul]{Paul}
%           \TpstAbortion[affected, belowtext=male]{A1}
%           \pstree[thislevelsep=1.2]{\TpstPerson[male, 
%             belowtext=Peter, affected, proband]{Peter}}{%
%             \def\psedge{\ncline}
%             \TpstChildless[infertile]{C1}
%             }
%         }
%         \pstree{\TpstPerson[female, belowtext=Mary]{Mary}}{
%         \TpstPerson[female, belowtext=Joan]{Joan}
%         }
%       }
%     }
%     \pstRelationship[consanguinic]{Peter}{Joan}
%  \end{pspicture}
% \end{verbatim}
%   \caption{Code Producing Figure~\ref{fig:example_tree}}
%   \label{fig:example_tree_code}
% \end{figure}
%
%
%
%\subsection{More Examples}
%\label{sec:examples}
%
% A number of examples were listed above.  Here we show even more
% examples of complex pedigrees.
%
% On Figure~\ref{fig:example_PROMM} we show an example of a pedigree
% from~\cite{Harper01:MDBook}.  The corresponding code is listed on
% Figure~\ref{fig:example_PROMM_code}. 
%
% \begin{figure}
%   \centering
%   \begin{pspicture}(6,6)
%     \psset{belowtextrp=t, descarmA=1}
%     \rput(2.5,5.5){\pstPerson[male, deceased, belowtext=I:1]{I:1}}
%     \rput(3.5,5.5){\pstPerson[female, deceased, belowtext=I:2]{I:2}}
%     \pstRelationship[descentnode=I:1_2]{I:1}{I:2}
%     \rput(1,3.5){\pstPerson[female, affected, belowtext=II:1]{II:1}}
%     \pstDescent{I:1_2}{II:1}
%     \rput(2,3.5){\pstPerson[male, belowtext=II:2]{II:2}}
%     \pstRelationship[descentnode=II:1_2]{II:1}{II:2}
%     \rput(3.5,3.5){\pstPerson[male, affected, belowtext=II:3]{II:3}}
%     \pstDescent{I:1_2}{II:3}
%     \rput(4.5,3.5){\pstPerson[female, belowtext=II:4]{II:4}}
%     \pstRelationship[descentnode=II:3_4]{II:3}{II:4}
%     \rput(5.5,3.5){\pstPerson[female, affected, deceased, proband,
%       belowtext=II:5]{II:5}}
%     \pstDescent{I:1_2}{II:5}
%     \rput(0.5,1.5){\pstPerson[female, belowtext=III:1]{III:1}}
%     \pstDescent{II:1_2}{III:1}
%     \rput(1.5,1.5){\pstPerson[female, belowtext=III:2]{III:2}}
%     \pstDescent{II:1_2}{III:2}
%     \rput(2.5,1.5){\pstPerson[female, deceased,
%       belowtext=\parbox{2cm}{\centering III:3\\4/52}]{III:3}} 
%     \pstDescent{II:1_2}{III:3}
%     \rput(3.5,1.5){\pstPerson[female, affected,
%       belowtext=III:4]{III:4}} 
%     \pstDescent{II:3_4}{III:4}
%     \rput(4.5,1.5){\pstPerson[male, insidetext=?,
%       belowtext=III:5]{III:5}} 
%     \pstDescent{II:3_4}{III:5}
%   \end{pspicture}
%   \caption{Example of a Pedigree of a Family With PROMM
%   From~\cite[p.~48]{Harper01:MDBook}} 
%   \label{fig:example_PROMM}
% \end{figure}
%
%
% \begin{figure}
%   \centering
% \begin{verbatim}
%   \begin{pspicture}(6,6)
%     \psset{belowtextrp=t, descarmA=1}
%     \rput(2.5,5.5){\pstPerson[male, deceased, belowtext=I:1]{I:1}}
%     \rput(3.5,5.5){\pstPerson[female, deceased, belowtext=I:2]{I:2}}
%     \pstRelationship[descentnode=I:1_2]{I:1}{I:2}
%     \rput(1,3.5){\pstPerson[female, affected, belowtext=II:1]{II:1}}
%     \pstDescent{I:1_2}{II:1}
%     \rput(2,3.5){\pstPerson[male, belowtext=II:2]{II:2}}
%     \pstRelationship[descentnode=II:1_2]{II:1}{II:2}
%     \rput(3.5,3.5){\pstPerson[male, affected, belowtext=II:3]{II:3}}
%     \pstDescent{I:1_2}{II:3}
%     \rput(4.5,3.5){\pstPerson[female, belowtext=II:4]{II:4}}
%     \pstRelationship[descentnode=II:3_4]{II:3}{II:4}
%     \rput(5.5,3.5){\pstPerson[female, affected, deceased, proband,
%       belowtext=II:5]{II:5}}
%     \pstDescent{I:1_2}{II:5}
%     \rput(0.5,1.5){\pstPerson[female, belowtext=III:1]{III:1}}
%     \pstDescent{II:1_2}{III:1}
%     \rput(1.5,1.5){\pstPerson[female, belowtext=III:2]{III:2}}
%     \pstDescent{II:1_2}{III:2}
%     \rput(2.5,1.5){\pstPerson[female, deceased,
%       belowtext=\parbox{2cm}{\centering III:3\\4/52}]{III:3}} 
%     \pstDescent{II:1_2}{III:3}
%     \rput(3.5,1.5){\pstPerson[female, affected,
%       belowtext=III:4]{III:4}} 
%     \pstDescent{II:3_4}{III:4}
%     \rput(4.5,1.5){\pstPerson[male, insidetext=?,
%       belowtext=III:5]{III:5}} 
%     \pstDescent{II:3_4}{III:5}
%   \end{pspicture}
% \end{verbatim}
%   \caption{Code Producing Figure~\ref{fig:example_PROMM}}
%   \label{fig:example_PROMM_code}
% \end{figure}
%
%
% A very complex pedigree is used as an example
% in~\cite{PedigreeNomenclature95}.  On
% Figure~\ref{fig:complex_example} we reproduce this pedigree. The
% corresponding code is shown on
% Figures~\ref{fig:complex_example_codeI},
% \ref{fig:complex_example_codeII} and~\ref{fig:complex_example_codeIII}.
%
% \begin{figure}
%   \centering
%   \rotatebox{90}{
%       \begin{pspicture}(0.7,0)(21.3,9)
%         \psset{descarmA=1.1, hatchsep=1.5pt}
%         \rput(3.5,8){Ethnic Background}
%         \rput(18.5,8){Ethnic Background}
%         \rput(3.5,7.6){\rnode[b]{OType1}{O'Type}}
%         \rput(18.5,7.5){\pnode{Origin2}}
%         \rput(6.5,7.5){\rnode{Quest1}{?}}
%         \rput(1,6.5){\Huge I}
%         \rput(1.5,6.5){\pstPerson[male, belowtext=1]{I1}}
%         \rput(2.5,6.5){\pstPerson[female, obligatory, belowtext=2]{I2}}
%         \rput(3.5,6.5){\pstPerson[male, belowtext=3]{I3}}
%         \rput(4.5,6.5){\pstPerson[male, belowtext=4]{I4}}
%         \rput(5.5,6.5){\pstPerson[male, belowtext=5]{I5}}
%         \rput(6.5,6.5){\pstPerson[female, affected,
%             belowtext=6]{I6}}
%         \rput(2,7.2){\pnode{Twins1}}
%         \rput(4,7.2){\pnode{Twins2}}
%         \pstTwins[descarmA=0]{OType1}{Twins1}{I1}{I2}
%         \pstTwins[qzygotic, descarmA=0, mzlinepos=0.8]{OType1}{Twins2}{I3}{I4}
%         \pstDescent[descarmA=0]{OType1}{I5}
%         \pstDescent[descarmA=0]{Quest1}{I6}
%         \pstRelationship[descentnode=I5I6]{I5}{I6}
%         \rput(1.5,5.5){\pstChildless{CI1}}
%         \ncline{I1}{CI1}
%         \rput(13.5,6.5){\pstPerson[male, deceased, belowtextrp=t,
%              belowtext=\parbox{2cm}{\centering d. 72 y\\7}]{I7}}
%         \rput(15.5,6.5){\pstPerson[female, deceased, belowtextrp=t,
%              belowtext=\parbox{2cm}{\centering d. 70 y\\8}]{I8}}
%         \pstRelationship[descentnode=I7I8]{I7}{I8}
%         \rput(21,6.5){\pstPerson[insidetext=5, belowtext=9--14,
%            belowtextrp=rt]{I9}}
%         \pstDescent[descarmA=0]{Origin2}{I8}
%         \pstDescent[descarmA=0]{Origin2}{I9}
%         \rput(1,4.5){\Huge II}
%         \rput(2.5,4.5){\pstPerson[male, affected, belowtext=1,
%              abovetext=Proto, abovetextrp=rB]{II1}} 
%         \pstDescent{I2}{II1}
%         \rput(4.5,4.5){\pstPerson[female, asymptomatic,
%             belowtext=\parbox{3cm}{32 y\\
%             $E_3-$\\$E_4+$(45n/18n)\\2}, abovetext={Sterrie},
%             abovetextrp=rB, evaluated]{II2}}  
%         \pstDescent{I5I6}{II2}
%         \pstRelationship[consanguinic, descentnode=II1II2]{II1}{II2}
%         \rput(5.5,5.2){\rnode{Quest2}{?}}
%         \rput(5.5,4.5){\pstPerson[female, insidetext=D,
%             belowtext=3]{II3}}
%         \ncline{Quest2}{II3}
%         \rput(6.5,5.2){\rnode{Quest3}{?}}
%         \rput(6.5,4.5){\pstPerson[male, insidetext=D,
%             belowtext=4]{II4}}
%         \ncline{Quest3}{II4}
%         \rput(7.5,4.5){\pstPerson[female, belowtext=5]{II5}}
%         \rput(8.5,4.5){\pstPerson[male, abovetext=Gary, abovetextrp=rB,
%            belowtext=\parbox{2cm}{36 y\\$E_3-$\\6},
%            evaluated]{II6}} 
%         \rput(9.5,4.5){\pstPerson[male, abovetext={Gene},
%            belowtext=\parbox{2cm}{36 y\\$E_3-$\\7},
%            evaluated]{II7}} 
%         \rput(9,5.2){\pnode{Twins3}}
%         \pstTwins[monozygotic]{I5I6}{Twins3}{II6}{II7}
%         \pstRelationship{II5}{II6}
%         \rput(7.5,5.7){O'Type}
%         \rput(11.5,4.5){\pstPerson[female, proband,
%             belowtext=\parbox{1cm}{35 y\\8}, abovetext=Feene]{II8}}
%         \pstRelationship[descentnode=II7II8]{II7}{II8}
%         \rput(13.5,4.5){\pstPerson[male, belowtext=9]{II9}}
%         \pstRelationship[broken, descentnode=II8II9,
%              descentnodepos=0.85]{II8}{II9} 
%         \rput(16,4.5){\pstPerson[abovetext=Stacey, female,
%             abovetextrp=rB, 
%             belowtext=\parbox{1cm}{33y\\ 10}]{II10}}
%         \def\affectedstyle{fillstyle=crosshatch}
%         \rput(17,4.5){\pstPerson[male, affected, abovetext=Sam,
%             belowtext=\parbox{3cm}{31 y\\ $E_2+$\\
%             11}, hatchsep=3pt]{II11}}
%         \rput(17,3.6){\pstChildless[infertile]{C2}}
%         \ncline{II11}{C2}
%         \rput(18,4.5){\pstPerson[male, obligatory,
%             abovetext=Donald, 
%             belowtext=\parbox{3cm}{29 y\\ $E_2+$ \\
%             12}]{II12}}
%         \pstDescent{I7I8}{II8}
%         \pstDescent{I7I8}{II10}
%         \pstDescent{I7I8}{II11}
%         \pstDescent{I7I8}{II12}
%         \rput(19,4.5){\pstPerson[female, belowtext=13]{II13}}
%         \pstRelationship[descentnode=II12II13]{II12}{II13}
%         \rput(20,4.5){\pstPerson[female, insidetext=S, 
%             belowtext=14]{II14}}
%         \rput(21,4.5){\pstPerson[insidetext=n]{II15}}
%         \pstDescent{I9}{II15}
%         \rput(1,2.5){\Huge III}
%         \rput(3,2.5){\pstPerson[male, adopted, belowtext=1]{III1}}
%         \rput(4,2.5){\pstPerson[insidetext=P, belowtext=2]{III2}}
%         \pstDescent[linestyle=dashed]{II1II2}{III1}
%         \pstDescent{II1II2}{III2}
%         \ncline{II3}{III2}
%         \rput(7.5,2.5){\pstPerson[insidetext=P,
%              belowtext=\parbox{2cm}{6 wk\\3}]{III3}}
%         \pstDescent{II5}{III3}
%         \ncline{II4}{III3}
%         \def\affectedstyle{fillstyle=vlines}
%         \rput(10,2.5){\pstAbortion[affected, 
%             belowtext=\parbox{2cm}{\centering 
%               female\\18wk\\$E_1+$(tri 21)\\4},
%               belowtextrp=t]{III4}}
%           \rput(11,2.5){\pstPerson[insidetext=P,
%               belowtext=\parbox{1cm}{16wk\\5}]{III5}}
%         \pstDescent{II7II8}{III4}
%         \pstDescent{II7II8}{III5}
%         \rput(12,2.5){\pstAbortion[belowtext=6]{III6}}
%         \rput(13,2.5){\pstAbortion[sab, belowtextrp=t,
%               belowtext=\parbox{2cm}{\centering female\\19 wk\\
%               7}]{III7}}
%         \rput(14,2.5){\pstPerson[adopted, male,
%               belowtext=\parbox{1cm}{10 y\\ 8}]{III8}}
%         \pstDescent{II8II9}{III6}
%         \pstDescent{II8II9}{III7}
%         \pstDescent{II8II9}{III8}
%         \ncline[linestyle=dashed]{II10}{III8}
%         \rput(15,2.5){\pstAbortion[sab, belowtext=9]{III9}}
%         \def\affectedstyle{fillstyle=hlines}
%         \rput(16,2.5){\pstAbortion[sab, belowtextrp=t, affected, 
%             belowtext=\parbox{2cm}{\centering male\\ 20 wk\\ $E_1+$
%             (tri 18)\\ 10}]{III10}}
%         \rput(17,2.5){\pstPerson[deceased, female,
%             belowtext=\parbox{1cm}{\centering SB\\32 wk\\
%             11}]{III11}}
%         \pstDescent{II10}{III9}
%         \pstDescent{II10}{III10}
%         \pstDescent{II10}{III11}
%         \rput(20,2.5){\pstPerson[insidetext=P, 
%             belowtext=12]{III12}}
%         \pstDescent{II14}{III12}
%         \ncline{II12II13}{III12}
%       \end{pspicture}
%   }
%   \caption{A Complex Pedigree From~\cite{PedigreeNomenclature95}}
%   \label{fig:complex_example}
% \end{figure}
%
%
% \begin{figure}
%   \centering
% \begin{verbatim}
%         \psset{descarmA=1.1, hatchsep=1.5pt}
%         \rput(3.5,8){Ethnic Background}
%         \rput(18.5,8){Ethnic Background}
%         \rput(3.5,7.5){\rnode{OType1}{O'Type}}
%         \rput(18.5,7.5){\pnode{Origin2}}
%         \rput(6.5,7.5){\rnode{Quest1}{?}}
%         \rput(1,6.5){\Huge I}
%         \rput(1.5,6.5){\pstPerson[male, belowtext=1]{I1}}
%         \rput(2.5,6.5){\pstPerson[female, obligatory, belowtext=2]{I2}}
%         \rput(3.5,6.5){\pstPerson[male, belowtext=3]{I3}}
%         \rput(4.5,6.5){\pstPerson[male, belowtext=4]{I4}}
%         \rput(5.5,6.5){\pstPerson[male, belowtext=5]{I5}}
%         \rput(6.5,6.5){\pstPerson[female, affected,
%             belowtext=6]{I6}}
%         \rput(2,7.2){\pnode{Twins1}}
%         \rput(4,7.2){\pnode{Twins2}}
%         \pstTwins[descarmA=0]{OType1}{Twins1}{I1}{I2}
%         \pstTwins[qzygotic, descarmA=0, mzlinepos=0.8]{OType1}{Twins2}{I3}{I4}
%         \pstDescent[descarmA=0]{OType1}{I5}
%         \pstDescent[descarmA=0]{Quest1}{I6}
%         \pstRelationship[descentnode=I5I6]{I5}{I6}
%         \rput(1.5,5.5){\pstChildless{CI1}}
%         \ncline{I1}{CI1}
%         \rput(13.5,6.5){\pstPerson[male, deceased, belowtextrp=t,
%              belowtext=\parbox{2cm}{\centering d. 72 y\\7}]{I7}}
%         \rput(15.5,6.5){\pstPerson[female, deceased, belowtextrp=t,
%              belowtext=\parbox{2cm}{\centering d. 70 y\\8}]{I8}}
%         \pstRelationship[descentnode=I7I8]{I7}{I8}
%         \rput(21,6.5){\pstPerson[insidetext=5, belowtext=9--14,
%            belowtextrp=rt]{I9}}
%         \pstDescent[descarmA=0]{Origin2}{I8}
%         \pstDescent[descarmA=0]{Origin2}{I9}
% \end{verbatim}
%   \caption{Code for Figure~\ref{fig:complex_example}:  Generation I}
%   \label{fig:complex_example_codeI}
% \end{figure}
%
% \begin{figure}
%   \centering
% \begin{verbatim}
%         \rput(1,4.5){\Huge II}
%         \rput(2.5,4.5){\pstPerson[male, affected, belowtext=1,
%              abovetext=Proto, abovetextrp=rB]{II1}} 
%         \pstDescent{I2}{II1}
%         \rput(4.5,4.5){\pstPerson[female, asymptomatic,
%             belowtext=\parbox{3cm}{32 y\\
%             $E_3-$\\$E_4+$(45n/18n)\\2}, abovetext={Sterrie},
%             abovetextrp=rB, evaluated]{II2}}  
%         \pstDescent{I5I6}{II2}
%         \pstRelationship[consanguinic, descentnode=II1II2]{II1}{II2}
%         \rput(5.5,5.2){\rnode{Quest2}{?}}
%         \rput(5.5,4.5){\pstPerson[female, insidetext=D,
%             belowtext=3]{II3}}
%         \ncline{Quest2}{II3}
%         \rput(6.5,5.2){\rnode{Quest3}{?}}
%         \rput(6.5,4.5){\pstPerson[male, insidetext=D,
%             belowtext=4]{II4}}
%         \ncline{Quest3}{II4}
%         \rput(7.5,4.5){\pstPerson[female, belowtext=5]{II5}}
%         \rput(8.5,4.5){\pstPerson[male, abovetext=Gary, abovetextrp=rB,
%            belowtext=\parbox{2cm}{36 y\\$E_3-$\\6},
%            evaluated]{II6}} 
%         \rput(9.5,4.5){\pstPerson[male, abovetext={Gene},
%            belowtext=\parbox{2cm}{36 y\\$E_3-$\\7},
%            evaluated]{II7}} 
%         \rput(9,5.2){\pnode{Twins3}}
%         \pstTwins[monozygotic]{I5I6}{Twins3}{II6}{II7}
%         \pstRelationship{II5}{II6}
%         \rput(7.5,5.7){O'Type}
%         \rput(11.5,4.5){\pstPerson[female, proband,
%             belowtext=\parbox{1cm}{35 y\\8}, abovetext=Feene]{II8}}
%         \pstRelationship[descentnode=II7II8]{II7}{II8}
%         \rput(13.5,4.5){\pstPerson[male, belowtext=9]{II9}}
%         \pstRelationship[broken, descentnode=II8II9,
%              descentnodepos=0.85]{II8}{II9} 
%         \rput(16,4.5){\pstPerson[abovetext=Stacey, female,
%             abovetextrp=rB, 
%             belowtext=\parbox{1cm}{33y\\ 10}]{II10}}
%         \def\affectedstyle{fillstyle=crosshatch}
%         \rput(17,4.5){\pstPerson[male, affected, abovetext=Sam,
%             belowtext=\parbox{3cm}{31 y\\ $E_2+$\\
%             11}, hatchsep=3pt]{II11}}
%         \rput(17,3.6){\pstChildless[infertile]{C2}}
%         \ncline{II11}{C2}
%         \rput(18,4.5){\pstPerson[male, obligatory,
%             abovetext=Donald, 
%             belowtext=\parbox{3cm}{29 y\\ $E_2+$ \\
%             12}]{II12}}
%         \pstDescent{I7I8}{II8}
%         \pstDescent{I7I8}{II10}
%         \pstDescent{I7I8}{II11}
%         \pstDescent{I7I8}{II12}
%         \rput(19,4.5){\pstPerson[female, belowtext=13]{II13}}
%         \pstRelationship[descentnode=II12II13]{II12}{II13}
%         \rput(20,4.5){\pstPerson[female, insidetext=S, 
%             belowtext=14]{II14}}
%         \rput(21,4.5){\pstPerson[insidetext=n]{II15}}
%         \pstDescent{I9}{II15}
% \end{verbatim}
%   \caption{Code for Figure~\ref{fig:complex_example}:  Generation II}
%   \label{fig:complex_example_codeII}
% \end{figure}
%
% \begin{figure}
%   \centering
% \begin{verbatim}
%         \rput(1,2.5){\Huge III}
%         \rput(3,2.5){\pstPerson[male, adopted, belowtext=1]{III1}}
%         \rput(4,2.5){\pstPerson[insidetext=P, belowtext=2]{III2}}
%         \pstDescent[linestyle=dashed]{II1II2}{III1}
%         \pstDescent{II1II2}{III2}
%         \ncline{II3}{III2}
%         \rput(7.5,2.5){\pstPerson[insidetext=P,
%              belowtext=\parbox{2cm}{6 wk\\3}]{III3}}
%         \pstDescent{II5}{III3}
%         \ncline{II4}{III3}
%         \def\affectedstyle{fillstyle=vlines}
%         \rput(10,2.5){\pstAbortion[affected, 
%             belowtext=\parbox{2cm}{\centering 
%               female\\18wk\\$E_1+$(tri 21)\\4},
%               belowtextrp=t]{III4}}
%           \rput(11,2.5){\pstPerson[insidetext=P,
%               belowtext=\parbox{1cm}{16wk\\5}]{III5}}
%         \pstDescent{II7II8}{III4}
%         \pstDescent{II7II8}{III5}
%         \rput(12,2.5){\pstAbortion[belowtext=6]{III6}}
%         \rput(13,2.5){\pstAbortion[sab, belowtextrp=t,
%               belowtext=\parbox{2cm}{\centering female\\19 wk\\
%               7}]{III7}}
%         \rput(14,2.5){\pstPerson[adopted, male,
%               belowtext=\parbox{1cm}{10 y\\ 8}]{III8}}
%         \pstDescent{II8II9}{III6}
%         \pstDescent{II8II9}{III7}
%         \pstDescent{II8II9}{III8}
%         \ncline[linestyle=dashed]{II10}{III8}
%         \rput(15,2.5){\pstAbortion[sab, belowtext=9]{III9}}
%         \def\affectedstyle{fillstyle=hlines}
%         \rput(16,2.5){\pstAbortion[sab, belowtextrp=t, affected, 
%             belowtext=\parbox{2cm}{\centering male\\ 20 wk\\ $E_1+$
%             (tri 18)\\ 10}]{III10}}
%         \rput(17,2.5){\pstPerson[deceased, female,
%             belowtext=\parbox{1cm}{\centering SB\\32 wk\\
%             11}]{III11}}
%         \pstDescent{II10}{III9}
%         \pstDescent{II10}{III10}
%         \pstDescent{II10}{III11}
%         \rput(20,2.5){\pstPerson[insidetext=P, 
%             belowtext=12]{III12}}
%         \pstDescent{II14}{III12}
%         \ncline{II12II13}{III12}
% \end{verbatim}
%   \caption{Code for Figure~\ref{fig:complex_example}:  Generation III}
%   \label{fig:complex_example_codeIII}
% \end{figure}
%\clearpage
%
%
%\StopEventually{%
%  \clearpage
%  \section{Acknowledgements}
%  The authors are grateful to Herbert Vo\ss{} for help with
%  |PSTricks| code.  The support of \TeX{} User Group is gratefully
%  acknowledged.  One of the authors (LA) was supported by Russian
%  Foundation for Fundamental Research (travel grant 06-04-58811),
%  Russian Federation President Council for Grants Supporting Young
%  Scientists and Flagship Science Schools (grant MD-4245.2006.7)
%
%  \bibliography{pst-pdgr}
%  \bibliographystyle{plain}
%}
%
%\section{Implementation}
%\label{sec:implementation}
%
%
%
%\subsection{Identification and Setting Up}
%\label{sec:identification}
%
%
%Traditionally |PSTricks| works in two regimes:  the \LaTeX one and
%the plain one.  Probably it is a good idea to keep this
%tradition. Therefore we will use a \TeX{} file \path{pst-pdgr.tex}
%and a \LaTeX file \path{pst-pdgr.sty}.  They have different means of
%preserving from loading twice and identification.  
%
% \begin{macro}{\PSTPedigreeLoaded}
% A \TeX{} guard |\PSTPedigreeLoaded| prevents the double loading
% of the file:
%    \begin{macrocode}
%<*tex>
\csname PSTPedigreeLoaded\endcsname
\let\PSTPedigreeLoaded\endinput
%</tex>
%    \end{macrocode}
% \end{macro}
%
%Now we can start real identification.  Note the difference between
%the ways a \LaTeX{} style, a \LaTeX{} configuration file and a \TeX{}
%file announce itself
%    \begin{macrocode}
%<latex>\NeedsTeXFormat{LaTeX2e}
%<latex>\ProvidesPackage{pst-pdgr}
%<cfg>\ProvidesFile{pst-pdgr.cfg}
%<tex>\message{
[2017/11/20 v0.4 Medical Pedigree with PSTricks]
%<tex>}
%    \end{macrocode}
%
% The \LaTeX{} style is in fact just a wrapper: it calls the
% configuration file, and then the \TeX file, which does the real
% work:
%    \begin{macrocode}
%<*latex>
\RequirePackage{pstricks}%
\InputIfFileExists{pst-pdgr.cfg}{%
  \typeout{Loading configuration file pst-pdgr.cfg}}{%
  \typeout{Configuration file pst-pdgr.cfg is not found}}
\input{pst-pdgr.tex}
%</latex>
%    \end{macrocode}
%
% Now we are dealing (almost) exclusively with \TeX.
%    \begin{macrocode}
%<*tex>
%    \end{macrocode}
%
% Check the packages we use  are loaded:
%    \begin{macrocode}
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTreeLoaded\endinput\else\input pst-tree.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
%    \end{macrocode}
%
% We set up that |@| symbol:
%    \begin{macrocode}
\catcode`\@=11\relax
%    \end{macrocode}
% and set up keys for our package
%    \begin{macrocode}
\pst@addfams{pst-pdgr}
%    \end{macrocode}
%
%\subsection{Global Parameters}
%\label{sec:impl_globals}
%
% These macros define the way affected individuals are drawn
% \begin{macro}{\affectedbgcolor}
% The background color:
%    \begin{macrocode}
\def\affectedbgcolor{gray}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\affectedfgcolor}
% The foreground color for the text:
%    \begin{macrocode}
\def\affectedfgcolor{white}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\affectedstyle}
%   And the style:
%    \begin{macrocode}
\def\affectedstyle{fillstyle=solid, fillcolor=\affectedbgcolor}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@intxtcolor}
% Normally the color of the inside text for normal persons is the
% current color:
%    \begin{macrocode}
\def\pst@pdgr@instxtcolor{\relax}
%    \end{macrocode}
% \end{macro}
%
%
%
%\subsection{Options}
%\label{sec:impl_opts}
%
% Here we define the option for the commands and their action.
%
%
%\subsubsection{Choice Options}
%\label{sec:impl_choice}
%
% This groups of options sets a key from a given set of choices.
% \begin{macro}{\pst@pdgr@sex}
%   First, the sex of the person.  The numbers 0, 1 and 2 correspond
%   to the sequence in the alternatives list
%    \begin{macrocode}
\def\pst@pdgr@sex{0}
\define@choicekey[psset]{pst-pdgr}{sex}[\pst@pdgr@temp \pst@pdgr@sex]{%
  unknown,male,female}[unknown]{}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@condition}
%   Next, the condition of the person.  The numbers again correspond
%   to the sequence in the alternatives list
%    \begin{macrocode}
\def\pst@pdgr@condition{0}
\define@choicekey[psset]{pst-pdgr}{%
  condition}[\pst@pdgr@temp \pst@pdgr@condition]{%
  normal,obligatory,asymptomatic,affected}[normal]{}
%    \end{macrocode}
% \end{macro}
%
% A bunch of shortcuts
%    \begin{macrocode}
\define@key[psset]{pst-pdgr}{unknown}[]{\psset{sex=unknown}}
\define@key[psset]{pst-pdgr}{male}[]{\psset{sex=male}}
\define@key[psset]{pst-pdgr}{female}[]{\psset{sex=female}}
\define@key[psset]{pst-pdgr}{normal}[]{\psset{condition=normal}}
\define@key[psset]{pst-pdgr}{obligatory}[]{\psset{condition=obligatory}}
\define@key[psset]{pst-pdgr}{asymptomatic}[]{\psset{condition=asymptomatic}}
\define@key[psset]{pst-pdgr}{affected}[]{\psset{condition=affected}}
%    \end{macrocode}
%
%
%
%\subsubsection{Boolean Options}
%\label{sec:impl_bool}
%
% True or false options.  
%
%
% \begin{macro}{\pst@pdgr@defineboolkey}
%   We use use our own version of definition of boolean keys, rather
%   than the one provided by |xkeyval|.
%    \begin{macrocode}
\def\pst@pdgr@defineboolkey#1{%
\expandafter\newif\csname ifpst@pdgr@#1\endcsname%
\csname pst@pdgr@#1false\endcsname%
\define@key[psset]{pst-pdgr}{#1}[true]{%
  \@nameuse{pst@pdgr@#1##1}}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\ifpst@pdgr@deceased}
% Whether the individual is deceased:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{deceased}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@proband}
% Whether the individual is a proband:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{proband}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@adopted}
% Whether the individual is adopted:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{adopted}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@evaluated}
% Whether the individual is evaluated:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{evaluated}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@sab}
% Whether the abortion is SAB:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{sab}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@infertile}
% Whether the individual or relationship is infertile:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{infertile}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@broken}
% Whether the relationship is broken:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{broken}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@consanguinic}
% Whether the relationship is consanguinic:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{consanguinic}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@monozygotic}
% Whether the twins are monozygotic:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{monozygotic}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ifpst@pdgr@qzygotic}
% Whether the are questionably monozygotic:
%    \begin{macrocode}
\pst@pdgr@defineboolkey{qzygotic}
%    \end{macrocode}
% \end{macro}
% 
%
%
%
%\subsubsection{String Options}
%\label{sec:impl_string}
%
% Options setting up strings.
%
%  
% \begin{macro}{\pst@pdgr@insidetext}
% Text inside the symbol
%    \begin{macrocode}
\def\pst@pdgr@insidetext{}%
\define@key[psset]{pst-pdgr}{insidetext}{%
  \def\pst@pdgr@insidetext{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@belowtext}
% Text below the symbol
%    \begin{macrocode}
\def\pst@pdgr@belowtext{}%
\define@key[psset]{pst-pdgr}{belowtext}{%
  \def\pst@pdgr@belowtext{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@abovetext}
% Text above the symbol
%    \begin{macrocode}
\def\pst@pdgr@abovetext{}%
\define@key[psset]{pst-pdgr}{abovetext}{%
  \def\pst@pdgr@abovetext{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@lefttext}
% Text to the left of the symbol
%    \begin{macrocode}
\def\pst@pdgr@lefttext{}%
\define@key[psset]{pst-pdgr}{lefttext}{%
  \def\pst@pdgr@lefttext{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@righttext}
% Text to the right of the symbol
%    \begin{macrocode}
\def\pst@pdgr@righttext{}%
\define@key[psset]{pst-pdgr}{righttext}{%
  \def\pst@pdgr@righttext{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@descentnode}
% Name of the descent node
%    \begin{macrocode}
\def\pst@pdgr@descentnode{}%
\define@key[psset]{pst-pdgr}{descentnode}{%
  \def\pst@pdgr@descentnode{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@rellinecmd}
% Command to draw relationship lines:
%    \begin{macrocode}
\def\pst@pdgr@rellinecmd{\ncline}%
\define@key[psset]{pst-pdgr}{rellinecmd}{%
  \def\pst@pdgr@rellinecmd{\@nameuse{#1}}}%
%    \end{macrocode}
% \end{macro}
%
% A number of text positioning commands.
% \begin{macro}{\pst@pdgr@abovetextrp}
% The command to set the reference position for the text above the
% symbol.
%    \begin{macrocode}
\def\pst@pdgr@abovetextrp{lB}%
\define@key[psset]{pst-pdgr}{abovetextrp}{%
  \def\pst@pdgr@abovetextrp{#1}}%
%    \end{macrocode}
%   \changes{v0.2}{2006/04/18}{Added the command}
% \end{macro}
% \begin{macro}{\pst@pdgr@belowtextrp}
% The command to set the reference position for the text below the
% symbol.
%    \begin{macrocode}
\def\pst@pdgr@belowtextrp{lt}%
\define@key[psset]{pst-pdgr}{belowtextrp}{%
  \def\pst@pdgr@belowtextrp{#1}}%
%    \end{macrocode}
%   \changes{v0.2}{2006/04/18}{Added the command}
% \end{macro}
% \begin{macro}{\pst@pdgr@lefttextrp}
% The command to set the reference position for the text to the left
% of the symbol.
%    \begin{macrocode}
\def\pst@pdgr@lefttextrp{r}%
\define@key[psset]{pst-pdgr}{lefttextrp}{%
  \def\pst@pdgr@lefttextrp{#1}}%
%    \end{macrocode}
%   \changes{v0.2}{2006/04/18}{Added the command}
% \end{macro}
% \begin{macro}{\pst@pdgr@righttextrp}
% The command to set the reference position for the text to the right
% of the symbol.
%    \begin{macrocode}
\def\pst@pdgr@righttextrp{l}%
\define@key[psset]{pst-pdgr}{righttextrp}{%
  \def\pst@pdgr@righttextrp{#1}}%
%    \end{macrocode}
%   \changes{v0.2}{2006/04/18}{Added the command}
% \end{macro}
%
% The option |addtwin| for |\pstTwin| command is special.  Since it
% can be repeated, we want it to be executed immediately.  We store
% the name of the descentnode in |\pst@pdgr@tempnode|
%    \begin{macrocode}
\define@key[psset]{pst-pdgr}{addtwin}{\ncline{\pst@pdgr@tempnode}{#1}}%
\define@key[psset]{pst-pdgr}{descentnode}{%
  \def\pst@pdgr@descentnode{#1}}%
%    \end{macrocode}
%
%
%
%\subsubsection{Numerical Options}
%\label{sec:impl_opts_num}
%
% The options to set up numerical values.
%
%
% \begin{macro}{\psk@descarmA}
% \changes{v0.3}{2007/06/24}{Introduced new length}
%   The length of the arm A on the |\pstDescent| line.
%    \begin{macrocode}
\newdimen\psk@descarmA%
\define@key[psset]{pst-pdgr}{descarmA}{\pssetlength\psk@descarmA{#1}}%
\psset{descarmA=0.8}% 
%    \end{macrocode}
%   
% \end{macro}
%
%
% \begin{macro}{\pst@pdgr@descentnodepos}
% The position of the descent node on the relationship line
%    \begin{macrocode}
\def\pst@pdgr@descentnodepos{0.5}
\define@key[psset]{pst-pdgr}{descentnodepos}{%
  \pst@checknum{#1}\pst@pdgr@descentnodepos%
  \ifdim\pst@pdgr@descentnodepos \p@<\z@
  \def\pst@pdgr@descentnodepos{0.5}%
  \@pstrickserr{Bad `descentnodepos' value: `#1'. Must be >0}\@ehpa%
  \fi}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@brokenpos}
% The position of the broken line symbol on the relationship line
%    \begin{macrocode}
\def\pst@pdgr@brokenpos{0.3}
\define@key[psset]{pst-pdgr}{brokenpos}{%
  \pst@checknum{#1}\pst@pdgr@brokenpos%
  \ifdim\pst@pdgr@brokenpos \p@<\z@
  \def\pst@pdgr@brokenpos{0.3}%
  \@pstrickserr{Bad `brokenpos' value: `#1'. Must be >0}\@ehpa%
  \fi}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pst@pdgr@mzlinepos}
% The position of the monozygotic line or question mark on the twins
% line: 
%    \begin{macrocode}
\def\pst@pdgr@mzlinepos{0.5}
\define@key[psset]{pst-pdgr}{mzlinepos}{%
  \pst@checknum{#1}\pst@pdgr@mzlinepos%
  \ifdim\pst@pdgr@mzlinepos \p@<\z@%
    \def\pst@pdgr@mzlinepos{0.5}%
    \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be >0}\@ehpa%
  \fi%
  \ifdim\pst@pdgr@mzlinepos \p@>\p@\relax%
    \def\pst@pdgr@mzlinepos{0.5}%
    \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be <1}\@ehpa%
  \fi}%
%    \end{macrocode}
% \end{macro}
%
%
%
%
%\subsection{Drawing A Person}
%\label{sec:impl_pstPerson}
%
% And now the main macro.
%
% \begin{macro}{\pstPerson}
%   First, the standard processing of optional parameter
%    \begin{macrocode}
\def\pstPerson{\@ifnextchar[{\pstPerson@i}{\pstPerson@i[]}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstPerson@i}
%   And now we are ready for a real work.  Actually we create a
%   |rnode| and put everything inside.  We add a |\pspicture| for the
%   node to have non-zero size.
%    \begin{macrocode}
\def\pstPerson@i[#1]#2{%
  \rnode{#2}{%
   \psset{arrows=-, linestyle=solid}%
   \psset{#1}%
    \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.25)%
%    \end{macrocode}
% Condition processing. 
%    \begin{macrocode}
     \ifcase\pst@pdgr@condition\relax  % Nothing to do if normal
     \or  % obligatory
       \psdot(0,0)%
     \or % asymptomatic
       \qline(0,0.25)(0,-0.25)%
     \or % affected
        \expandafter\psset\expandafter{\affectedstyle}%
        \def\pst@pdgr@instxtcolor{\csname\affectedfgcolor\endcsname}%
     \fi%
%    \end{macrocode}
% The actual drawing
%    \begin{macrocode}
     \ifcase\pst@pdgr@sex\relax  % First, unknown sex.  A diamond 
         \pspolygon(0,0.25)(0.25,0)(0,-0.25)(-0.25,0)%
      \or  % Male.  A square with side 0.5
         \pspolygon(-0.25,-0.25)(-0.25,0.25)(0.25,0.25)(0.25,-0.25)%
      \or  % Female.  A circle with radius 0.25
          \pscircle{0.25}%
      \fi%
%    \end{macrocode}
% Necessary for next
%    \begin{macrocode}
      \psset{fillstyle=none}%
%    \end{macrocode}
%
% Deceased or not?
%    \begin{macrocode}
     \ifpst@pdgr@deceased%
        \qline(-0.33,-0.33)(0.33,0.33)%
      \fi%
%    \end{macrocode}
% Proband or not?
%    \begin{macrocode}
     \ifpst@pdgr@proband%
        \psline[arrows=->](-0.55,-0.55)(-0.29,-0.29)%
     \fi%
%    \end{macrocode}
% Adopted or not?
%    \begin{macrocode}
     \ifpst@pdgr@adopted%
       \psline(-0.25,-0.35)(-0.35,-0.35)(-0.35,0.35)(-0.25,0.35)%
       \psline(0.25,-0.35)(0.35,-0.35)(0.35,0.35)(0.25,0.35)%
     \fi%
%    \end{macrocode}
% \changes{v0.2}{2006/04/18}{Slightly increased brackets for the ``adopted''
%   symbol} 
% Evaluated or not?
%    \begin{macrocode}
     \ifpst@pdgr@evaluated%
        \rput(0.4,-0.4){$\ast$}%
      \fi%
%    \end{macrocode}
%
% Now a bunch of text putting commands
%    \begin{macrocode}
     \ifx\pst@pdgr@abovetext\@empty\relax\else%
        \rput[\pst@pdgr@abovetextrp](0,0.4){%
          \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[\pst@pdgr@belowtextrp](0,-0.4){%
          \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@righttext\@empty\relax\else%
        \rput[\pst@pdgr@righttextrp](0.4,0){\pst@pdgr@righttext}%
     \fi%
     \ifx\pst@pdgr@lefttext\@empty\relax\else%
        \rput[\pst@pdgr@lefttextrp](-0.4,0){\pst@pdgr@lefttext}%
     \fi%
%    \end{macrocode}
% Inside text is a bit more difficult since we want to be able to
% do reverse video if necessary
%    \begin{macrocode}
     \ifx\pst@pdgr@insidetext\@empty\relax\else%
        \rput(0,0){\pst@pdgr@instxtcolor\pst@pdgr@insidetext}%
     \fi%
     \endpspicture%
}}%
%    \end{macrocode}
% \changes{v0.2}{2006/04/18}{Changed text positioning}
% \end{macro}
%
%
%\subsection{Drawing A Terminated Pregnancy}
%\label{sec:impl_pstAbortion}
%
% \begin{macro}{\pstAbortion}
%   First, the standard processing of optional parameter
%    \begin{macrocode}
\def\pstAbortion{\@ifnextchar[{\pstAbortion@i}{\pstAbortion@i[]}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstAbortion@i}
%   And the actual macro:
%    \begin{macrocode}
\def\pstAbortion@i[#1]#2{%
  \rnode{#2}{%
    \psset{arrows=-, linestyle=solid}%
    \psset{#1}%
%    \end{macrocode}
%
% The standard~\cite{PedigreeNomenclature95} requires the lines for
% the terminated pregnancies to be shorter than for the normal ones.
% A way to do this is to make the node \emph{higher}:
%    \begin{macrocode}
     \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.5)%
%    \end{macrocode}
%
%
% Condition processing:
%    \begin{macrocode}
     \ifcase\pst@pdgr@condition\relax  % Nothing to do if normal
     \or  \relax % Nothing to do if obligatory
     \or \relax  % Nothing to do if asymptomatic
     \or % affected
        \expandafter\psset\expandafter{\affectedstyle}%
     \fi%
%    \end{macrocode}
%
% If this is a terminated pregnancy, we use the same symbol as for
% |deceased|:
%    \begin{macrocode}
    \ifpst@pdgr@sab\relax\else%
       \qline(-0.25,0.1)(0.25,0.6)%
     \fi%
%    \end{macrocode}
%  
%  The actual drawing
%    \begin{macrocode}
    \pspolygon(-0.25,0.25)(0,0.5)(0.25,0.25)
%    \end{macrocode}
%
% And text putting commands
%    \begin{macrocode}
     \ifx\pst@pdgr@abovetext\@empty\relax\else%
        \rput[\pst@pdgr@abovetextrp](0,0.65){%
          \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[\pst@pdgr@belowtextrp](0,0.1){%
          \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@righttext\@empty\relax\else%
        \rput[\pst@pdgr@righttextrp](0.4,0.35){\pst@pdgr@righttext}%
     \fi%
     \ifx\pst@pdgr@lefttext\@empty\relax\else%
        \rput[\pst@pdgr@lefttextrp](-0.4,0.35){\pst@pdgr@lefttext}%
     \fi%
     \endpspicture%
}}%
%    \end{macrocode}
% \changes{v0.2}{2006/04/18}{Changed text positioning}
% \end{macro}
%
%
%\subsection{Drawing A Childlessness Symbol}
%\label{sec:impl_childless}
%
% \begin{macro}{\pstChildless}
%   Again, the standard processing of optional parameter
%    \begin{macrocode}
\def\pstChildless{\@ifnextchar[{\pstChildless@i}{\pstChildless@i[]}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstChildless@i}
%   And the actual macro:
%    \begin{macrocode}
\def\pstChildless@i[#1]#2{%
  \rnode{#2}{%
    \psset{arrows=-, linestyle=solid}%
    \psset{#1}%
%    \end{macrocode}
% The actual drawing depends on the |infertile| option.  If it is
% true, we want a double line (an non-zero height).  Otherwise this is
% a single line with zero height:
%    \begin{macrocode}
    \ifpst@pdgr@infertile  % double line
      \pspicture[shift=-0.05](-0.2,-0.05)(0.2,0.05)%
        \qline(-0.2,-0.05)(0.2,-0.05)%
         \qline(-0.2,0.05)(0.2,0.05)%
      \endpspicture%
    \else  % single line
      \qline(-0.2,0)(0.2,0)%
    \fi%
%    \end{macrocode}
% And the text below the symbol:
%    \begin{macrocode}
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[t](0,-0.2){\pst@pdgr@belowtext}%
     \fi%
}}%
%    \end{macrocode}
%
% \end{macro}
%
%\subsection{Drawing A Relationship Line}
%\label{sec:impl_pstRelationship}
%
% \begin{macro}{\pstRelationship}
%   The |\pstRelationship| command can have both optional and
%   non-optional parameters:
%    \begin{macrocode}
\def\pstRelationship{\@ifnextchar[{%
    \pstRelationship@i}{\pstRelationship@i[]}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstRelationship@i}
%   The actual macro:
%    \begin{macrocode}
\def\pstRelationship@i[#1]#2#3{%
  \begingroup%
  \psset{arrows=-, linestyle=solid, nodesep=0.7\pslinewidth}%
  \psset{#1}%
%    \end{macrocode}
% A consanguinic relationship is shown by a double line:
%    \begin{macrocode}
   \ifpst@pdgr@consanguinic%
      \psset{doubleline=true}%
   \else%
      \psset{doubleline=false}%
   \fi%
%    \end{macrocode}
% The actual drawing
%    \begin{macrocode}
   \pst@pdgr@rellinecmd{#2}{#3}%
%    \end{macrocode}
% The broken relationships are shown using  //:
%    \begin{macrocode}
    \ifpst@pdgr@broken%
         \lput(\pst@pdgr@brokenpos){/\kern-0.7ex/}%
    \fi%
%    \end{macrocode}
% And the descent node
%    \begin{macrocode}
     \ifx\pst@pdgr@descentnode\@empty\relax%
     \else%
         \lput(\pst@pdgr@descentnodepos){\pnode{\pst@pdgr@descentnode}}%
      \fi%
      \endgroup%
}%    
%    \end{macrocode}
%
% \end{macro}
%
%\subsection{Drawing a Descent Line}
%\label{sec:impl_pstDescent}
%
% \begin{macro}{\ncAngles}
% \changes{v0.3}{2007/06/24}{Introduced the macro}
% In the new version of pst-node.tex (1.00 and up) |\ncangles| has the
% option |pcRef| for the arm lengths to be calculated from the node
% center.  Unfortunately at this time we cannot be sure the users have
% the new version.
%
% This macro is from Herbert Vo\ss{}
% (\url{http://www.tug.org/mail-archives/pstricks/2007/004608.html})
%    \begin{macrocode}
\def\ncAngles{\pst@object{ncAngles}}
\def\ncAngles@i{\check@arrow{\ncAngles@ii}}
\def\ncAngles@ii#1#2{%
  \nc@object{Open}{#1}{#2}{1.5}{\ncAngles@iii \tx@NCAngles}}
%
\def\ncAngles@iii{%
  tx@Dict begin \psline@iii pop end
  /AngleA \psk@angleA def
  /AngleB \psk@angleB def
  /ArmA \psk@armA GetEdgeA yA yA1 sub dup mul xA xA1 sub dup mul add
sqrt sub def
  /ArmB \psk@armB def
  /ArmTypeA \psk@armtypeA def
  /ArmTypeB \psk@armtypeB def }      
%    \end{macrocode}
% 
%   
% \end{macro}
%
% \begin{macro}{\pstDescent}
% \changes{v0.3}{2007/06/24}{Rewrote using new code from Herbert Vo\ss}
%   The standard option processing command:
%    \begin{macrocode}
\def\pstDescent{\@ifnextchar[{\pstDescent@i}{\pstDescent@i[]}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstDescent@i}
%   The actual macro.  Note that we want to set |armA| \emph{after}
%   processing user input, but all other options are processed after
%   standard ones.
%    \begin{macrocode}
\def\pstDescent@i[#1]#2#3{%
  \begingroup%
  \psset{arrows=-, linestyle=solid, angleA=-90, %
         angleB=90, armB=0}%
  \psset{#1}%
  \psset{armA=\psk@descarmA}%
  \ncAngles{#2}{#3}%
  \endgroup}%
%    \end{macrocode}
% \end{macro}
%
%
%
%\subsection{Drawing Twins}
%\label{sec:impl_pstTwins}
%
% \begin{macro}{\pstTwins}
%   The standard option processing command:
%    \begin{macrocode}
\def\pstTwins{\@ifnextchar[{\pstTwins@i}{\pstTwins@i[]}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\pstTwins@i}
%   The actual macro.  Note that we need to keep the twin node in
%   |\pst@pdgr@tempnode| to correctly process |addtwin|.
%    \begin{macrocode}
\def\pstTwins@i[#1]#2#3#4#5{%
  \begingroup%
  \def\pst@pdgr@tempnode{#3}
  \psset{arrows=-, linestyle=solid, angleA=90, %
         angleB=-90}%
  \psset{#1}%
%    \end{macrocode}
% The descent line from the parent to the twin node
%    \begin{macrocode}
  \pstDescent{#2}{#3}%
%    \end{macrocode}
% And the twin lines and nodes
%    \begin{macrocode}
  \ncline{#3}{#4}%
  \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeA}}%
  \ncline{#3}{#5}%
  \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeB}}%
%    \end{macrocode}
% The monozygotic or qzygotic line
%    \begin{macrocode}
  \ifpst@pdgr@monozygotic%
     \ncline{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
  \else%
      \ifpst@pdgr@qzygotic%
         \ncline[linestyle=none]{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
         \lput(0.5){?}%
      \fi%
  \fi%
  \endgroup}%
%    \end{macrocode}
%
%
% \end{macro}
%
%
%\subsection{Tree Making Commands}
%\label{sec:impl_trees}
%
% \begin{macro}{\pst@pdgr@makeTcommand}
%   The general macro to create a tree command from the normal command
%    \begin{macrocode}
\def\pst@pdgr@makeTcommand#1{%
  \@namedef{T#1}{%
    \@ifnextchar[{\@nameuse{T#1@i}}{\@nameuse{T#1@i}[]}}%
  \@namedef{T#1@i}[##1]##2{%
      \Tr{\@nameuse{#1@i}[##1]{##2}}}}%
%    \end{macrocode}
% \end{macro}
%
% And the macros
% \begin{macro}{\TpstPerson}
% Drawing a person
%    \begin{macrocode}
\pst@pdgr@makeTcommand{pstPerson}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\TpstAbortion}
% Drawing an abortion
%    \begin{macrocode}
\pst@pdgr@makeTcommand{pstAbortion}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\TpstChildless}
% Drawing a childlessness symbol
%    \begin{macrocode}
\pst@pdgr@makeTcommand{pstChildless}%
%    \end{macrocode}
% \end{macro}
%
%\subsection{Finishing Touch}
%\label{sec:finish}
%
%
%    \begin{macrocode}
%</tex>
%    \end{macrocode}
%\Finale
% 
%\clearpage
%\PrintChanges
%\clearpage
%\PrintIndex
%
\endinput