3 % $Id: pst-pdgr.dtx,v 1.43 2006/05/16 22:16:43 boris Exp $
5 % Copyright 2006, Boris Veytsman <borisv@lk.net>, Leila Akhmadeeva
6 % This work may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either
8 % version 1.3 of this license or (at your option) any
10 % The latest version of the license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3 or later is part of all distributions of
13 % LaTeX version 2003/06/01 or later.
15 % This work has the LPPL maintenance status `maintained'.
17 % The Current Maintainer of this work is Boris Veytsman
19 % This work consists of the file pst-pdgr.dtx and the
20 % derived files pst-pdgr.tex, pst-pdgr.sty, pst-pdgr.pdf.
25 % \changes{v0.1}{2006/04/18}{The interface is mostly done}
26 % \changes{v0.2}{2006/04/19}{Added new examples}
30 %% {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
31 %% 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
32 %% Digits \0\1\2\3\4\5\6\7\8\9
33 %% Exclamation \! Double quote \" Hash (number) \#
34 %% Dollar \$ Percent \% Ampersand \&
35 %% Acute accent \' Left paren \( Right paren \)
36 %% Asterisk \* Plus \+ Comma \,
37 %% Minus \- Point \. Solidus \/
38 %% Colon \: Semicolon \; Less than \<
39 %% Equals \= Greater than \> Question mark \?
40 %% Commercial at \@ Left bracket \[ Backslash \\
41 %% Right bracket \] Circumflex \^ Underscore \_
42 %% Grave accent \` Left brace \{ Vertical bar \|
43 %% Right brace \} Tilde \~}
47 \documentclass{ltxdoc}
52 \usepackage{pstricks-add}
53 % Taken from xkeyval.dtx
55 \def\DescribeOption#1{\leavevmode\@bsphack
56 \marginpar{\raggedleft\PrintDescribeOption{#1}}%
57 \SpecialOptionIndex{#1}\@esphack\ignorespaces}
58 \def\PrintDescribeOption#1{\strut\emph{option}\\\MacroFont #1\ }
59 \def\SpecialOptionIndex#1{\@bsphack
60 \index{#1\actualchar{\protect\ttfamily#1}
61 (option)\encapchar usage}%
62 \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar
64 \def\DescribeOptions#1{\leavevmode\@bsphack
65 \marginpar{\raggedleft\strut\emph{options}%
67 \\\strut\MacroFont\@tempa\SpecialOptionIndex\@tempa
68 }}\@esphack\ignorespaces}
70 \DoNotIndex{\@Alph,\@alph,\@arabic,\@badmath}
71 \DoNotIndex{\@centercr}
72 \DoNotIndex{\@empty,\@ignoretrue}
74 \DoNotIndex{\@M,\@minus,\@ne,\@plus}
75 \DoNotIndex{\\,\addtolength}
77 \DoNotIndex{\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
79 \DoNotIndex{\cdot,\cr,\day,\DeclareOption}
80 \DoNotIndex{\def,\DocInput,\documentclass}
81 \DoNotIndex{\DoNotIndex,\egroup,\ifx,\else,\fi,\endtrivlist}
82 \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
83 \DoNotIndex{\endlist,\everycr,\ExecuteOptions}
84 \DoNotIndex{\filedate,\filename,\fileversion}
85 \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
86 \DoNotIndex{\hsize,\hskip,\hspace,\hss,\ifcase,\or,\fi}
87 \DoNotIndex{\ifvmode,\fi,\ifnum,\fi,\input}
88 \DoNotIndex{\kern,\leavevmode,\let,\leftmark}
89 \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark}
90 \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
91 \DoNotIndex{\NeedsTeXFormat,\newdimen}
92 \DoNotIndex{\newpage,\nobreak,\noindent,\number}
94 \DoNotIndex{\pagestyle,\par}
95 \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
96 \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
97 \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
98 \DoNotIndex{\rightmargin,\rlap,\rmfamily}
99 \DoNotIndex{\setbox,\setcounter,\setlength}
100 \DoNotIndex{\skip,\slshape,\space}
101 \DoNotIndex{\trivlist,\typeout,\tw@}
102 \DoNotIndex{\vskip,\vspace,\year,\z@}
104 \DoNotIndex{\@ptsize,\@sptoken,\addtocounter,\afterassignment}
105 \DoNotIndex{\AtEndOfPackage,\baselineskip,\boxmaxdepth,\clearpage}
106 \DoNotIndex{\clubpenalty,\csname,\CurrentOption,\DeclareRobustCommand}
107 \DoNotIndex{\eject,\endcsname,\evensidemargin,\expandafter}
108 \DoNotIndex{\footnotesize,\footskip,\fromaddress,\futurelet}
109 \DoNotIndex{\headheight,\headsep,\hfuzz,\ignorespaces}
110 \DoNotIndex{\InputIfFileExists,\large,\lineskip,\loop}
111 \DoNotIndex{\MakeUppercase,\MessageBreak,\mbox,\multiply}
112 \DoNotIndex{\newcount,\newif,\newlength,\newtoks,\nolinebreak}
113 \DoNotIndex{\nopagebreak,\normalfont,\normalsize,\null,\newline}
114 \DoNotIndex{\oddsidemargin,\PackageError,\PackageInfo}
115 \DoNotIndex{\paperheight,\paperwidth,\parbox,\parindent}
116 \DoNotIndex{\PassOptionsToPackage,\ProvidesPackage,\RequirePackage}
117 \DoNotIndex{\rule,\selectfont,\sffamily,\sloppy,\small,\spaceskip}
118 \DoNotIndex{\stepcounter,\textheight,\textwidth,\the,\topmargin}
119 \DoNotIndex{\unhbox,\voidb@x,\vsize,\vfuzz,\widowpenalty,\xspaceskip}
120 \DoNotIndex{\AtBeginDocument,\AtEndDocument}
121 \DoNotIndex{\endinput,\ProvidesFile,\message,\catcode,\@}
122 \DoNotIndex{\PSTricksLoaded,\PSTXKeyLoaded,\PSTnodesLoaded,\PSTreeLoaded}
123 \DoNotIndex{\pst@addfams,\define@key,\define@choicekey,\pssetlength}
124 \DoNotIndex{\@nameuse,\@namedef,\psset,\rnode,\@ifnextchar,\pscircle}
125 \DoNotIndex{\psdot,\pscircle,\pspolygon,\qline,\rput,\psline,\psframe}
126 \DoNotIndex{\@pstrickserr,\@ehpa,\pst@checknum,\lput,\ncline,\pspicture}
127 \DoNotIndex{\ncangle,\pnode,\pspicture,\endpspicture,\Tr}
128 \DoNotIndex{\ifdim,\fi}
134 \DocInput{pst-pdgr.dtx}
141 %\GetFileInfo{pst-pdgr.sty}
142 %\title{Creating Medical Pedigree with PSTricks and \LaTeX.
143 % \thanks{\copyright Boris Veytsman, Leila Akhmadeeva 2006}}
144 %\author{Boris Veytsman, \path{borisv@lk.net} \and Leila Akhmadeeva}
145 %\date{\filedate, \fileversion}
148 % A set of macros based on |PSTricks| to draw medical pedigrees
149 % according to the recommendations for standardized human pedigree
150 % nomenclature. The drawing commands place the symbols on a
151 % |pspicture| canvas. An interface for making trees is also
152 % provided. The package can be used both with \LaTeX{} and
153 % \PlainTeX. A separate |Perl| program for generating \TeX{} files
154 % from spreadsheets is provided elsewhere on |CTAN|.
167 %\section{User Guide}
168 %\label{sec:user_guide}
171 %\subsection{Introduction}
174 % Medical pedigree is a very important tool for clinicians, genetic
175 % researchers and educators. As stated
176 % in~\cite{PedigreeNomenclature95}, ``The construction of an accurate
177 % family pedigree is a fundamental component of a clinical genetic
178 % evaluation and of human genetic research.'' Unfortunately, up to
179 % now most geneticians make the pedigrees manually. There are several
180 % programs for doing so (see a list at
181 % \url{http://www.kumc.edu/gec/prof/genecomp.html#pedigree}), but they
182 % are rather expensive, lack multilanguage support and the quality of
183 % typesetting is somewhat lacking. This package tries to offer a
184 % \LaTeX-based solution for this problem. It could be used with a
185 % companion \path{Perl} program \path{pedigree}~\cite{pedigree-perl},
186 % which converts databases of patients into a \LaTeX{} file.
188 % Note that there are ways to draw genealogical trees with
189 % |PSTricks|~\cite{PSTricks93}; see the beautiful ones at
190 % \url{http://www.tug.org/PSTricks/main.cgi?file=Examples/Genealogy/genealogy}.
191 % Unfortunately, medical pedigrees are often not \emph{trees}.
192 % Therefore we do not use tree approach throughout, but provide it as
193 % an alternative. Our general approach is based on the use of
194 % nodes~\cite[Part~VII]{PSTricks93}. Each person or entity is a node,
195 % and the lines are in fact |\ncline|s. This provides a flexibility
196 % to draw complex pedigrees.
198 % Each node in the system \emph{must} have a name. To prevent
199 % confusion with names of individuals, we call such name an \emph{id}.
200 % As usual in |PSTricks|, it is a sequence of letters and numbers
201 % starting with a letter. This rule is very important; a name like 1
202 % or 1-1 can lead to mysterious PostScript errors.
204 % Our symbols follows the standard~\cite{PedigreeNomenclature95} with
205 % the exception that we do not implement showing several conditions
208 % To use the package, add the line
210 % \usepackage{pst-pdgr}
212 % to a \LaTeX{} document or
214 % \input pst-pdgr.tex
216 % to a \PlainTeX{} one. Note that since this is a |PSTricks|
217 % package, you need to use \path{tex-dvips} path to compile your
218 % document. If you need a PDF document, you can use \path{ps2pdf} or
219 % packages like \path{pst-pdf}, \path{ps4pdf}, \path{pstricks}.
221 % If you are using the package in a \LaTeX{} document, you have an
222 % added benefit of a local configuration file |pst-pdgr.cfg|. Such
223 % file, if exists, will be read. It can be used to override package
224 % settings (use |\AtEndOfPackage| for this).
228 %\subsection{Global Settings}
231 % By default the size of each node is |0.5 unit|. You can change
232 % the size by setting the value of |unit| (1\,cm by default)
235 %\DescribeMacro{\affectedstyle}
236 %\DescribeMacro{\affectedbgcolor}
237 % By default the affected individual is drawn as a black node. This
238 % could be changed by setting |\affectedstyle| and
239 % |\affectedbgcolor|, see Figure~\ref{fig:affectedstyle}.
240 %\DescribeMacro{\affectedfgcolor}
241 % Sometimes we need to write something inside a node representing an
242 % affected individual. An example in~\cite{PedigreeNomenclature95}
243 % changes in this situation the style from filled to hatched, which
244 % looks inconsistent. We rather change the color of the foreground,
245 % as shown on Fig.~\ref{fig:affectedfgcolor}.
249 % \begin{minipage}[t]{0.4\linewidth}
251 % \begin{pspicture}(2,2)
252 % \def\affectedbgcolor{blue}
253 % \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
254 % \end{pspicture}\leavevmode\\
256 % |\def\affectedbgcolor{%|\\
259 % \begin{minipage}[t]{0.4\linewidth}
261 % \begin{pspicture}(2,2)
262 % \def\affectedstyle{fillstyle=hlines, hatchcolor=\affectedbgcolor}
263 % \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
264 % \end{pspicture}\leavevmode\\
266 % |\def\affectedstyle{fillstyle=%|\\
267 % |hlines,hatchcolor=\affectedbgcolor}|
269 % \caption{Setting Style of Affected Individuals}
270 % \label{fig:affectedstyle}
275 % \begin{minipage}[t]{0.4\linewidth}
277 % \begin{pspicture}(2,2)
278 % \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
279 % \rput(1,1){\expandafter\textcolor\expandafter{%
280 % \affectedfgcolor}{\Huge 2}}
281 % \end{pspicture}\leavevmode\\
285 % \begin{minipage}[t]{0.4\linewidth}
287 % \begin{pspicture}(2,2)
288 % \def\affectedfgcolor{green}
289 % \expandafter\pscircle\expandafter[\affectedstyle](1,1){1}
290 % \rput(1,1){\expandafter\textcolor\expandafter{%
291 % \affectedfgcolor}{\Huge 2}}
294 % |\def\affectedfgcolor{green}|
296 % \caption{Use of Foreground Colors for Affected Individuals }
297 % \label{fig:affectedfgcolor}
301 %\subsection{Node Drawing Commands}
302 %\label{sec:node_commands}
305 % The node drawing commands are based on the |\pnode| commands from
306 % |PSTricks|~\cite[Part~VII]{PSTricks93}. It is the preferred command
307 % for drawing, for example, a ``marriage node'' (see the examples
308 % below). It is useful to remember this when drawing complex
312 %\subsubsection{One Person}
315 % \DescribeMacro{\pstPerson} The main command in the package is
316 % |\pstPerson|. It draws one person, which is a |PSTricks| node. It
317 % has the following structure: |\pstPerson|\oarg{options}\marg{id}.
318 % The parameter \meta{id} is the name of the node. It can be used to
319 % make connections to the node (see below).
321 % There are many options to this command. As other |PSTricks|
322 % options, the also can be set globally through |\psset| command.
325 % \DescribeOptions{sex,condition,deceased,proband,adopted,evaluated}
326 % The first group of options describes the state of the person: sex,
327 % condition with respect to the decease, whether the person is
328 % deceased, is a proband, was adopted and was evaluated. These
329 % options are listed in Table~\ref{tab:person_state_opts}. Some
330 % options of this group can take only two values: |true| or |false|.
331 % For simplicity the clause |=true| can be omitted, so the clauses
332 % |adopted=true| and |adopted| are equivalent. Two options: |sex| and
333 % |condition| can take several values each (geneticians consider three
334 % possibilities for sex: |male|, |female| and |unknown|). Again for
335 % simplicity the clauses |sex=| and |condition=| can be omitted, so
336 % the invocations |sex=male| and |male| are equivalent, as well as
337 % |condition=asymptomatic| and |asymptomatic|.
339 % \DescribeOptions{insidetext,abovetext,belowtext,lefttext,righttext}
340 % The second group of options (Table~\ref{tab:person_text_opts}) is
341 % used to putting text comments inside the symbol, above it, below it
342 % or to the right or left to it. The text will be typeset in a
343 % |PSTricks| LR-box~\cite{PSTricks93}; additional control over the
344 % text position can be achieved by using |\parbox| or \PlainTeX{}
347 % \DescribeOptions{abovetextrp,belowtextrp,lefttextrp,righttextrp}
348 % The third group of options (Table~\ref{tab:person_text_rp_opts}) is
349 % used to set the text position with respect to the node. They set
350 % the reference point of the text. They correspond to the usual
351 % notation: |r| being right, |l| being left, |t| being top, |b| being
352 % bottom and |B| being baseline. The setting |={}| makes the
353 % reference point to be the center of the box. Note that to prevent
354 % the text above and below the symbol to clash with the descent lines,
355 % the spaces of |2\pslinewidth| are added to the right and to the left
358 % Examples of usage of this command are shown in
359 % Table~\ref{tab:pstPerson}.
364 % \begin{tabular}{l>{\raggedright\obeylines
365 % }p{0.3\linewidth}lp{0.3\linewidth}}
367 % Option & Values & Default & Description \\
369 % |sex| & |male|, |female|, |unknown| & |unknown| & Sex of the
371 % |condition| & |normal|, |obligatory|, |asymptomatic|, |affected|
372 % & |normal| & The condition of the person\\
373 % |deceased| & |true|, |false| & |false| & Whether the person is
375 % |proband| & |true|, |false| & |false| & Whether the person is a
377 % |adopted| & |true|, |false| & |false| & Whether the individual
379 % |evaluated| & |true|, |false| & |false| & Whether a documented
380 % evaluation took place\\
383 % \caption{Options Showing State of a Person}
384 % \label{tab:person_state_opts}
391 % \begin{tabular}{l>{\raggedright\obeylines
392 % }llp{0.5\linewidth}}
394 % Option & Values & Default & Description \\
396 % |insidetext| & String & None & A text to be placed inside the
397 % symbol (number of individuals, pregnancy, etc.)\\
398 % |abovetext| & String & None & A text to be placed above the
399 % symbol (name, number, etc.)\\
400 % |belowtext| & String & None & A text to be placed below the
401 % symbol (name, number, etc.)\\
402 % |lefttext| & String & None & A text to be placed to the left of the
403 % symbol (name, number, etc.)\\
404 % |righttext| & String & None & A text to be placed to the right of the
405 % symbol (name, number, etc.)\\
408 % \caption{Options for Making Textual Comments}
409 % \label{tab:person_text_opts}
414 % \begin{tabular}{l>{\raggedright\obeylines
415 % }p{0.25\linewidth}lp{0.35\linewidth}}
417 % Option & Values & Default & Description \\
419 % |abovetextrp| & Combination of |r| or |l| and |t|, |b| or |B| &
420 % |lB| & The reference point for the text above the symbol\\
421 % |belowtextrp| & Combination of |r| or |l| and |t|, |b| or |B| &
422 % |lt| & The reference point for the text below the symbol\\
423 % |lefttextrp| & Combination of |r| or |l| and |t|, |b| or |B| &
424 % |r| & The reference point for the text to the left the symbol\\
425 % |righttextrp| & Combination of |r| or |l| and |t|, |b| or |B| &
426 % |l| & The reference point for the text to the right the symbol\\
429 % \caption{Options for Setting Text Reference Point}
430 % \label{tab:person_text_rp_opts}
436 % \def\arraystretch{1.5}
437 % \begin{tabular}{>{\tt\bslash pstPerson[}p{0.6\textwidth}<{]\{P\}}c}
439 % \multicolumn{1}{l}{Command} & Result\rule{0.5cm}{0cm}\\
441 % condition=asymptomatic &
442 % \pstPerson[condition=asymptomatic]{A} \\
443 % condition=affected, sex=male, evaluated &
444 % \pstPerson[condition=affected,sex=male, evaluated]{A} \\
445 % obligatory, female &
446 % \pstPerson[obligatory, female]{A} \\
447 % asymptomatic, male, proband &
448 % \pstPerson[asymptomatic, male, proband]{A} \\
449 % condition=obligatory, sex=male, deceased &
450 % \pstPerson[condition=obligatory, sex=male, deceased]{A} \\
451 % sex=female, adopted, condition=affected, abovetext=Jane &
452 % \pstPerson[sex=female, adopted, condition=affected,
453 % abovetext=Jane]{A} \\
454 % sex=male, condition=affected, belowtext=20 yr, deceased &
455 % \pstPerson[sex=male, condition=affected, deceased,
456 % belowtext=20 yr]{A} \\[5ex]
457 % unknown, affected, righttext=\bslash
458 % parbox\{1cm\}\{\bslash footnotesize A \bslash\bslash 1 w\} &
459 % \pstPerson[unknown, affected,
460 % righttext=\parbox{1cm}{\footnotesize A\\1 w}]{A} \\
461 % sex=male, insidetex=5 &
462 % \pstPerson[sex=male, insidetext=5]{A}\\
463 % sex=female, condition=affected, insidetext=P &
464 % \pstPerson[sex=female, condition=affected, insidetext=P]{A}\\
465 % sex=female, affected, belowtext=\bslash
466 % parbox\{1cm\}\{\bslash centering SB\bslash\bslash 2wks\}, deceased &
467 % \pstPerson[sex=female, affected, deceased,
468 % belowtext=\parbox{1cm}{\centering SB\\ 2wks}]{A} \\[7ex]
471 % \caption{Examples of Persons}
472 % \label{tab:pstPerson}
476 %\subsubsection{Pregnancy Not Carried To Term}
477 %\label{sec:abortion}
479 % \DescribeMacro{\pstAbortion}
480 % The command |\pstAbortion| is used to draw a pregnancy not carried
481 % to term: spontaneous abortions or terminated pregnancies. The
482 % format of it the same as for the command |\pstPerson| (see
483 % Section~\ref{sec:person}): |\pstAbortion|\oarg{options}\marg{id}.
484 % However, many of options listed in Table~\ref{tab:person_state_opts} are
485 % silently ignored. The only options meaningful for these nodes are
486 % |sex| and |condition| (only |normal| and |affected| values are
487 % possible). All options listed in Table~\ref{tab:person_text_opts}
488 % and \ref{tab:person_text_rp_opts} are valid and have the same
489 % meaning as in Section~\ref{sec:person}.
491 % \DescribeOption{sab}
492 % The command has also an option |sab| with the values |true| or
493 % |false|. If it is |true|, the pregnancy is a spontaneous abortion.
494 % Otherwise it is terminated. Examples of usage of this command are
495 % shown in Table~\ref{tab:abortions}.
500 % \def\arraystretch{2}
501 % \begin{tabular}{>{\tt\bslash pstAbortion[}p{0.6\textwidth}<{]\{A\}}c}
503 % \multicolumn{1}{l}{Command} & Symbol\\
505 % belowtext=male & \rule{0cm}{1cm} \pstAbortion[belowtext=male]{A}\\
506 % sab, righttext=1w & \pstAbortion[sab, righttext=1w]{A}\\
507 % affected & \pstAbortion[affected]{A}\\
510 % \caption{Examples of Abortion Symbols}
511 % \label{tab:abortions}
514 %\subsubsection{Childlessness and Infertility}
515 %\label{sec:childness}
517 % The symbols for childlessness and infertility are listed under
518 % ``line definitions'' in~\cite{PedigreeNomenclature95}. However, to
519 % make the placing the symbols on the chart more flexible, we assign
522 % \DescribeMacro{\pstChildless}
523 % The command for drawing these symbols
524 % has the same structure as the other node drawing commands:
525 % |\pstChildless}|\oarg{options}\marg{id}.
526 % While all options listed in Table~\ref{tab:pstPerson} are valid, the
527 % only meaningful one is |belowtext|. Note that the option
528 % |belowtextrp| is silently ignored: the text is always centered
529 % below the infertility symbol.
531 % \DescribeOption{infertile}
532 % There is one additional option
533 % |infertile|, which can have values |true| of |false|. If it is
534 % |false|, the person (or relationship) is childless by choice (or by
535 % an unknown reason). The clause |=true| can be omitted.
540 % \def\arraystretch{2}
541 % \begin{tabular}{>{\tt\bslash pstChildless[}p{0.6\textwidth}<{]\{C\}}c}
543 % \multicolumn{1}{l}{Command} & Symbol\rule{0.5cm}{0cm}\\
545 % belowtext=vasectomy &
546 % \pstChildless[belowtext=vasectomy]{A}\\
547 % belowtext=anospermia, infertile &
548 % \pstChildless[belowtext=anospermia, infertile]{A}\\
551 % \caption{Examples of Childlessness or Infertility Symbols}
552 % \label{tab:childness}
557 %\subsection{Connection Drawing Commands}
560 % The connections in pedigrees are based on |\ncline| and friends.
561 % There are, however, some additional features for pedigree
565 %\subsubsection{Relationship}
566 %\label{sec:relationship}
568 %\DescribeMacro{\pstRelationship}
569 % Relationships are marriages or other unions. The main command for
570 % drawing relationships is
571 % |\pstRelationship|\oarg{options}\marg{nodeA}\marg{nodeB}. It draws
572 % a relationship line between \marg{nodeA} and \marg{nodeB}. Normal
573 % |PSTricks| options like |linestyle=dashed| can be used with the
576 % \DescribeOptions{broken,consanguinic,descentnode,brokenpos,descentnodepos,rellinecmd}
577 % There are also several options specific for this command, listed in
578 % Table~\ref{tab:relationship_opts}. The options |broken| and
579 % |consanguinic| are self-explanatory. The option |descentnode| is
580 % used, if we want the descent lines to start at a node on the
581 % relationship line. The name of this descent node must satisfy the
582 % usual criteria for the node (see Section~\ref{sec:intro}). The
583 % options |brokenpos| and |descentnodepos| determine, where on the
584 % relationship line the corresponding objects are placed. The option
585 % |rellinecmd| allows to change the default straight line for the
586 % relationship to something else, like |ncbar|, |ncangle|, etc.
587 % Examples of this command use are shown in
588 % Table~\ref{tab:pstRelationship}
594 % \begin{tabular}{l>{\raggedright\obeylines
595 % }p{0.2\linewidth}lp{0.3\linewidth}}
597 % Option & Values & Default & Description \\
599 % |broken| & |true|, |false| & |false| & Whether the
600 % relationship no longer exists\\
601 % |consanguinic| & |true|, |false| & |false| & Whether the
602 % relationship is consanguinic\\
603 % |descentnode| & Node name & None & A node that will be used
604 % to draw descent lines for the relationship \\
605 % |brokenpos| & A number between 0 and 1 & 0.3 & Where to put the
606 % symbol for broken relationship on the line (as a fraction of the
608 % |descentnodepos| & A number & 0.5 & Where
609 % to put the the descent node on the relationship line\\
610 % |rellinecmd| & Name & |ncline| & Name of the line drawing
611 % command (without \textbackslash)\\
614 % \caption{Options for Relationship Lines}
615 % \label{tab:relationship_opts}
620 % \def\arraystretch{1.5}
621 % \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
623 % \multicolumn{1}{l}{Command} & Result\\
625 % \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{A\}\}
626 % \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{B\}\}
627 % \bslash pstRelationship[broken]\{A\}\{B\}
629 % \begin{pspicture}[shift=-1](3,1)
630 % \rput(0.5,0.5){\pstPerson[male]{A}}
631 % \rput(2.5,0.5){\pstPerson[female]{B}}
632 % \pstRelationship[broken]{A}{B}
634 % \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{A\}\}
635 % \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{B\}\}
636 % \bslash pstRelationship[consanguinic]\{A\}\{B\}
638 % \begin{pspicture}[shift=-1](3,1)
639 % \rput(0.5,0.5){\pstPerson[male]{A}}
640 % \rput(2.5,0.5){\pstPerson[female]{B}}
641 % \pstRelationship[consanguinic]{A}{B}
643 % \bslash rput(0.5,1.5)\{\bslash pstPerson[male]\{A\}\}
644 % \bslash rput(2.5,1.5)\{\bslash pstPerson[female]\{B\}\}
645 % \bslash rput(1.5,0.5)\{\bslash pstPerson[female]\{C\}\}
646 % \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
647 % \bslash ncline\{AB\}\{C\}
649 % \begin{pspicture}[shift=-1](3,2)
650 % \rput(0.5,1.5){\pstPerson[male]{A}}
651 % \rput(2.5,1.5){\pstPerson[female]{B}}
652 % \rput(1.5,0.5){\pstPerson[female]{C}}
653 % \pstRelationship[descentnode=AB]{A}{B}
656 % \bslash rput(0.5,1.5)\{\bslash
657 % pstPerson[male, belowtext=1-1]\{A\}\}
658 % \bslash rput(2.5,1.5)\{\bslash
659 % pstPerson[affected, female, belowtext=1-2]\{B\}\}
660 % \bslash rput(1.5,0.6)\{\bslash pstPerson[male,
661 % belowtext=2-1]\{C\}\}
662 % \bslash pstRelationship[descentnode=AB, rellinecmd=ncangle,
663 % angleA=90, angleB=90, descentnodepos=1.5,
664 % broken, brokenpos=1.2]\{A\}\{B\}
665 % \bslash ncline\{AB\}\{C\}
667 % \begin{pspicture}[shift=-1](3,3)
668 % \rput(0.5,1.5){\pstPerson[male,belowtext=1-1]{A}}
669 % \rput(2.5,1.5){\pstPerson[affected,female, belowtext=1-2]{B}}
670 % \rput(1.5,0.6){\pstPerson[male, belowtext=2-1]{C}}
671 % \pstRelationship[descentnode=AB, rellinecmd=ncangle,
672 % angleA=90, angleB=90, descentnodepos=1.5,
673 % broken, brokenpos=1.2]{A}{B}
678 % \caption{Examples of Relationships}
679 % \label{tab:pstRelationship}
683 %\subsubsection{Descent}
684 %\label{sec:pstDescent}
686 % The paper~\cite{PedigreeNomenclature95} distinguishes between
687 % descent line and sibs line. We, however, will call all segments of
688 % the line, joining a parent (or a descent node) and a child the
689 % descent line. \DescribeMacro{\pstDescent} The main command for
690 % showing parent-child relations is
691 % |\pstDescent|\oarg{options}\marg{Parent}\marg{Child}. It has no
692 % special options, but the usual |\PSTricks| options for lines are
693 % valid. The most important option is |armB|: the length of the
694 % segment between the parent node and the sib line. Note that to make
695 % the sib line straight the actual direction of the |\ncangle| used by
696 % |\pstRelationship| internally is \emph{reversed}: from \marg{Child}
697 % to \marg{Parent}. Examples of this command are shown in
698 % Table~\ref{tab:pstDescent}. Note the option |linestyle=dashed| used
699 % to show social parentage in the first example.
705 % \def\arraystretch{1.5}
706 % \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
708 % \multicolumn{1}{l}{Command} & Result\\
710 % \bslash rput(1.5,2)\{\bslash pstPerson[female]\{A\}\}
711 % \bslash rput(0.5,0.5)\{\bslash pstPerson[female, adopted]\{B\}\}
712 % \bslash rput(1.5,0.5)\{\bslash pstPerson[male]\{C\}\}
713 % \bslash rput(2.5,0.5)\{\bslash pstAbortion[female]\{D\}\}
714 % \bslash pstDescent[linestyle=dashed]\{A\}\{B\}
715 % \bslash pstDescent\{A\}\{C\}
716 % \bslash pstDescent\{A\}\{D\}
718 % \begin{pspicture}[shift=-1](3,2.5)
719 % \rput(1.5,2){\pstPerson[female]{A}}
720 % \rput(0.5,0.5){\pstPerson[female, adopted]{B}}
721 % \rput(1.5,0.5){\pstPerson[male]{C}}
722 % \rput(2.5,0.5){\pstAbortion[female]{D}}
723 % \pstDescent[linestyle=dashed]{A}{B}
727 % \bslash psset\{armB=1\}
728 % \bslash rput(0.5,2)\{\bslash pstPerson[male, belowtext=Fred]\{A\}\}
729 % \bslash rput(2.5,2)\{\bslash pstPerson[female, obligatory, belowtext=Ginger]\{B\}\}
730 % \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
731 % \bslash rput(0.5,0.5)\{\bslash pstPerson[male,asymptomatic, belowtext=John]\{C1\}\}
732 % \bslash rput(1.5,0.5)\{\bslash pstPerson[female, belowtext=Mary]\{C2\}\}
733 % \bslash rput(2.5,0.5)\{\bslash pstAbortion[sab, affected, belowtext=male]\{C3\}\}
734 % \bslash pstDescent\{AB\}\{C1\}
735 % \bslash pstDescent\{AB\}\{C2\}
736 % \bslash pstDescent\{AB\}\{C3\}
738 % \begin{pspicture}[shift=-1](0,-0.2)(3.5,2.5)
740 % \rput(0.5,2){\pstPerson[male, belowtext=Fred]{A}}
741 % \rput(2.5,2){\pstPerson[female, obligatory, belowtext=Ginger]{B}}
742 % \pstRelationship[descentnode=AB]{A}{B}
743 % \rput(0.5,0.5){\pstPerson[male,asymptomatic, belowtext=John]{C1}}
744 % \rput(1.5,0.5){\pstPerson[female, belowtext=Mary]{C2}}
745 % \rput(2.5,0.5){\pstAbortion[sab, affected, belowtext=male]{C3}}
746 % \pstDescent{AB}{C1}
747 % \pstDescent{AB}{C2}
748 % \pstDescent{AB}{C3}
750 % \bslash rput(0.5,1.5)\{\bslash pstPerson[male]\{A\}\}
751 % \bslash rput(2.5,1.5)\{\bslash pstPerson[female]\{B\}\}
752 % \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
753 % \bslash rput(1.5,0.5)\{\bslash pstChildless[infertile, belowtext=anospermia]\{C\}\}
754 % \bslash pstDescent\{AB\}\{C\}
756 % \begin{pspicture}[shift=-1](0,-0.2)(3,2)
757 % \rput(0.5,1.5){\pstPerson[male]{A}}
758 % \rput(2.5,1.5){\pstPerson[female]{B}}
759 % \pstRelationship[descentnode=AB]{A}{B}
760 % \rput(1.5,0.5){\pstChildless[belowtext=anospermia, infertile]{C}}
765 % \caption{Examples of Descent Lines}
766 % \label{tab:pstDescent}
770 %\subsubsection{Twins}
771 %\label{sec:pstTwins}
775 % \DescribeMacro{\pstTwins} A special care is needed when we talk
776 % about twins. First, the user must define a \emph{twin node}: the
777 % node which is used as a nexus for twin lines. Then the following
778 % command draws all the necessary
780 % |\pstTwins|\oarg{options}\marg{Parent}\marg{TwinNode}\marg{LeftTwin}\marg{RightTwin}.
782 % \DescribeOptions{monozygotic,qzygotic,mzlinepos,addtwins}
783 % The options for this command are listed in
784 % Table~\ref{tab:twin_opts}. The option |monozygotic| allows to show
785 % that the twins are monozygotic. The actual position of the
786 % horizontal line is determined by the option |mzlinepos|. If it is
787 % unknown, whether the twins are monozygotic or not, |qzygotic|
788 % options draws a question mark, as recommended
789 % by~\cite{PedigreeNomenclature95}. Note that |mzlinepos| in this
790 % situation helps to position the question mark properly. The option
791 % |addtwin| allows to draw pedigrees with more than two twins. It can
792 % be repeated several times if necessary. Examples of the usage of
793 % this command are shown in Table~\ref{tab:pstTwins}.
797 % \begin{tabular}{l>{\raggedright\obeylines
798 % }p{0.2\linewidth}lp{0.3\linewidth}}
800 % Option & Values & Default & Description \\
802 % |monozygotic| & |true|, |false| & |false| & Whether the twins
804 % |qzygotic| & |true|, |false| & |false| & Whether the
805 % monozygoticity of twins is questionable\\
806 % |addtwin| & Twin node & Node & Additional twin node id if
807 % there are more than two twins (this
808 % option may be repeated)\\
809 % |mzlinepos| & A number & 0.5 & Where to put the horizontal
810 % line for monozygotic twins (as a factor of the total line length)\\
813 % \caption{Options for Twins Lines}
814 % \label{tab:twin_opts}
820 % \def\arraystretch{1.5}
821 % \begin{tabular}{>{\tt\raggedright\obeylines }b{0.6\textwidth}c}
823 % \multicolumn{1}{l}{Command} & Result\\
825 % \bslash rput(1.5,2)\{\bslash pstPerson[female]\{A\}\}
826 % \bslash rput(1,1.1)\{\bslash pnode\{Twins\}\}
827 % \bslash rput(0.5,0.5)\{\bslash pstPerson[male]\{B\}\}
828 % \bslash rput(1.5,0.5)\{\bslash pstPerson[male]\{C\}\}
829 % \bslash rput(2.5,0.5)\{\bslash pstPerson[female]\{D\}\}
830 % \bslash pstTwins[monozygotic]\{A\}\{Twins\}\{B\}\{C\}
831 % \bslash pstDescent\{A\}\{D\}
833 % \begin{pspicture}(3,2.5)
834 % \rput(1.5,2){\pstPerson[female]{A}}
835 % \rput(1,1.1){\pnode{Twins}}
836 % \rput(0.5,0.5){\pstPerson[male]{B}}
837 % \rput(1.5,0.5){\pstPerson[male]{C}}
838 % \rput(2.5,0.5){\pstPerson[female]{D}}
839 % \pstTwins[monozygotic]{A}{Twins}{B}{C}
842 % \bslash rput(0.5,2)\{\bslash pstPerson[male]\{A\}\}
843 % \bslash rput(2.5,2)\{\bslash pstPerson[female]\{B\}\}
844 % \bslash pstRelationship[descentnode=AB]\{A\}\{B\}
845 % \bslash rput(1.5,1.2)\{\bslash pnode\{Twins\}\}
846 % \bslash rput(1,0.5)\{\bslash pstPerson[male]\{C1\}\}
847 % \bslash rput(2,0.5)\{\bslash pstPerson[male]\{C2\}\}
848 % \bslash pstTwins[qzygotic, mzlinepos=0.8]\{AB\}\{Twins\}\{C1\}\{C2\}
850 % \begin{pspicture}(3,2.5)
851 % \rput(0.5,2){\pstPerson[male]{A}}
852 % \rput(2.5,2){\pstPerson[female]{B}}
853 % \pstRelationship[descentnode=AB]{A}{B}
854 % \rput(1.5,1.2){\pnode{Twins}}
855 % \rput(1,0.5){\pstPerson[male]{C1}}
856 % \rput(2,0.5){\pstPerson[male]{C2}}
857 % \pstTwins[qzygotic, mzlinepos=0.8]{AB}{Twins}{C1}{C2}
859 % \bslash rput(1.5,2)\{\bslash pstPerson[male]\{A\}\}
860 % \bslash rput(1.5,1.5)\{\bslash pnode\{Twins\}\}
861 % \bslash rput(0.5,0.5)\{\bslash pstPerson[female]\{B\}\}
862 % \bslash rput(1.2,0.5)\{\bslash pstPerson[female]\{C\}\}
863 % \bslash rput(1.9,0.5)\{\bslash pstPerson[female]\{D\}\}
864 % \bslash rput(2.6,0.5)\{\bslash pstPerson[female]\{E\}\}
865 % \bslash pstTwins[addtwin=C, addtwin=D]\{A\}\{Twins\}\{B\}\{E\}
867 % \begin{pspicture}(3,2.5)
868 % \rput(1.5,2){\pstPerson[male]{A}}
869 % \rput(1.5,1.5){\pnode{Twins}}
870 % \rput(0.5,0.5){\pstPerson[female]{B}}
871 % \rput(1.2,0.5){\pstPerson[female]{C}}
872 % \rput(1.9,0.5){\pstPerson[female]{D}}
873 % \rput(2.6,0.5){\pstPerson[female]{E}}
874 % \pstTwins[addtwin=C, addtwin=D]{A}{Twins}{B}{E}
878 % \caption{Examples of Twins Lines}
879 % \label{tab:pstTwins}
884 %\subsection{Making Trees}
887 % As discussed above (Section~\ref{sec:intro}), the medical pedigrees
888 % are not necessary trees. Even if they are, they are usually not
889 % simple layered trees. Nevertheless sometimes pedigree can be
890 % represented as a layered tree. For such cases we provide tree
891 % drawing commands. See the discussion in~\cite{pedigree-perl} for
894 % \DescribeMacro{\TpstPerson}
895 % \DescribeMacro{\TpstAbortion}
896 % \DescribeMacro{\TpstChildless}
897 % The macros |\TpstPerson|, |\TpstAbortion| and |\TpstChildless| have
898 % the same options and arguments as their ``normal'' counterparts. You
899 % probably need to use command like
901 % \def\psedge{\pstDescent}
904 % in your code. An example of us of such commands is shown on
905 % Figure~\ref{fig:example_tree}. Note that the resulting figure is
906 % \emph{not} a tree! The corresponding code is shown on
907 % Figure~\ref{fig:example_tree_code}.
911 % \begin{pspicture}(0,1)(7,7)
913 % \pstree{\TpstPerson[female, obligatory, belowtext=Ann]{Ann}}{%
914 % \def\psedge{\pstDescent}\psset{armB=1}
915 % \pstree{\TpstPerson[male, affected, belowtext=John]{John}}{%
916 % \TpstPerson[female, belowtext=Sue]{Sue}
917 % \TpstPerson[male, belowtext=Paul]{Paul}
918 % \TpstAbortion[affected, belowtext=male]{A1}
919 % \pstree[thislevelsep=1.2]{\TpstPerson[male,
920 % belowtext=Peter, affected, proband]{Peter}}{%
921 % \def\psedge{\ncline}
922 % \TpstChildless[infertile]{C1}
925 % \pstree{\TpstPerson[female, belowtext=Mary]{Mary}}{
926 % \TpstPerson[female, belowtext=Joan]{Joan}
930 % \pstRelationship[consanguinic]{Peter}{Joan}
932 % \caption{Example of Using Tree-Making Commands}
933 % \label{fig:example_tree}
939 % \begin{pspicture}(0,1)(7,7)
941 % \pstree{\TpstPerson[female, obligatory, belowtext=Ann]{Ann}}{%
942 % \def\psedge{\pstDescent}\psset{armB=1}
943 % \pstree{\TpstPerson[male, affected, belowtext=John]{John}}{%
944 % \TpstPerson[female, belowtext=Sue]{Sue}
945 % \TpstPerson[male, belowtext=Paul]{Paul}
946 % \TpstAbortion[affected, belowtext=male]{A1}
947 % \pstree[thislevelsep=1.2]{\TpstPerson[male,
948 % belowtext=Peter, affected, proband]{Peter}}{%
949 % \def\psedge{\ncline}
950 % \TpstChildless[infertile]{C1}
953 % \pstree{\TpstPerson[female, belowtext=Mary]{Mary}}{
954 % \TpstPerson[female, belowtext=Joan]{Joan}
958 % \pstRelationship[consanguinic]{Peter}{Joan}
961 % \caption{Code Producing Figure~\ref{fig:example_tree}}
962 % \label{fig:example_tree_code}
967 %\subsection{More Examples}
968 %\label{sec:examples}
970 % A number of examples were listed above. Here we show even more
971 % examples of complex pedigrees.
973 % On Figure~\ref{fig:example_PROMM} we show an example of a pedigree
974 % from~\cite{Harper01:MDBook}. The corresponding code is listed on
975 % Figure~\ref{fig:example_PROMM_code}.
979 % \begin{pspicture}(6,6)
980 % \psset{belowtextrp=t, armB=1}
981 % \rput(2.5,5.5){\pstPerson[male, deceased, belowtext=I:1]{I:1}}
982 % \rput(3.5,5.5){\pstPerson[female, deceased, belowtext=I:2]{I:2}}
983 % \pstRelationship[descentnode=I:1_2]{I:1}{I:2}
984 % \rput(1,3.5){\pstPerson[female, affected, belowtext=II:1]{II:1}}
985 % \pstDescent{I:1_2}{II:1}
986 % \rput(2,3.5){\pstPerson[male, belowtext=II:2]{II:2}}
987 % \pstRelationship[descentnode=II:1_2]{II:1}{II:2}
988 % \rput(3.5,3.5){\pstPerson[male, affected, belowtext=II:3]{II:3}}
989 % \pstDescent{I:1_2}{II:3}
990 % \rput(4.5,3.5){\pstPerson[female, belowtext=II:4]{II:4}}
991 % \pstRelationship[descentnode=II:3_4]{II:3}{II:4}
992 % \rput(5.5,3.5){\pstPerson[female, affected, deceased, proband,
993 % belowtext=II:5]{II:5}}
994 % \pstDescent{I:1_2}{II:5}
995 % \rput(0.5,1.5){\pstPerson[female, belowtext=III:1]{III:1}}
996 % \pstDescent{II:1_2}{III:1}
997 % \rput(1.5,1.5){\pstPerson[female, belowtext=III:2]{III:2}}
998 % \pstDescent{II:1_2}{III:2}
999 % \rput(2.5,1.5){\pstPerson[female, deceased,
1000 % belowtext=\parbox{2cm}{\centering III:3\\4/52}]{III:3}}
1001 % \pstDescent{II:1_2}{III:3}
1002 % \rput(3.5,1.5){\pstPerson[female, affected,
1003 % belowtext=III:4]{III:4}}
1004 % \pstDescent{II:3_4}{III:4}
1005 % \rput(4.5,1.5){\pstPerson[male, insidetext=?,
1006 % belowtext=III:5]{III:5}}
1007 % \pstDescent{II:3_4}{III:5}
1009 % \caption{Example of a Pedigree of a Family With PROMM
1010 % From~\cite[p.~48]{Harper01:MDBook}}
1011 % \label{fig:example_PROMM}
1018 % \begin{pspicture}(6,6)
1019 % \psset{belowtextrp=t, armB=1}
1020 % \rput(2.5,5.5){\pstPerson[male, deceased, belowtext=I:1]{I:1}}
1021 % \rput(3.5,5.5){\pstPerson[female, deceased, belowtext=I:2]{I:2}}
1022 % \pstRelationship[descentnode=I:1_2]{I:1}{I:2}
1023 % \rput(1,3.5){\pstPerson[female, affected, belowtext=II:1]{II:1}}
1024 % \pstDescent{I:1_2}{II:1}
1025 % \rput(2,3.5){\pstPerson[male, belowtext=II:2]{II:2}}
1026 % \pstRelationship[descentnode=II:1_2]{II:1}{II:2}
1027 % \rput(3.5,3.5){\pstPerson[male, affected, belowtext=II:3]{II:3}}
1028 % \pstDescent{I:1_2}{II:3}
1029 % \rput(4.5,3.5){\pstPerson[female, belowtext=II:4]{II:4}}
1030 % \pstRelationship[descentnode=II:3_4]{II:3}{II:4}
1031 % \rput(5.5,3.5){\pstPerson[female, affected, deceased, proband,
1032 % belowtext=II:5]{II:5}}
1033 % \pstDescent{I:1_2}{II:5}
1034 % \rput(0.5,1.5){\pstPerson[female, belowtext=III:1]{III:1}}
1035 % \pstDescent{II:1_2}{III:1}
1036 % \rput(1.5,1.5){\pstPerson[female, belowtext=III:2]{III:2}}
1037 % \pstDescent{II:1_2}{III:2}
1038 % \rput(2.5,1.5){\pstPerson[female, deceased,
1039 % belowtext=\parbox{2cm}{\centering III:3\\4/52}]{III:3}}
1040 % \pstDescent{II:1_2}{III:3}
1041 % \rput(3.5,1.5){\pstPerson[female, affected,
1042 % belowtext=III:4]{III:4}}
1043 % \pstDescent{II:3_4}{III:4}
1044 % \rput(4.5,1.5){\pstPerson[male, insidetext=?,
1045 % belowtext=III:5]{III:5}}
1046 % \pstDescent{II:3_4}{III:5}
1049 % \caption{Code Producing Figure~\ref{fig:example_PROMM}}
1050 % \label{fig:example_PROMM_code}
1054 % A very complex pedigree is used as an example
1055 % in~\cite{PedigreeNomenclature95}. On
1056 % Figure~\ref{fig:complex_example} we reproduce this pedigree. The
1057 % corresponding code is shown on
1058 % Figures~\ref{fig:complex_example_codeI},
1059 % \ref{fig:complex_example_codeII} and~\ref{fig:complex_example_codeIII}.
1064 % \begin{pspicture}(0.7,0)(21.3,9)
1065 % \psset{armB=1.1, hatchsep=1.5pt}
1066 % \rput(3.5,8){Ethnic Background}
1067 % \rput(18.5,8){Ethnic Background}
1068 % \rput(3.5,7.5){\rnode{OType1}{O'Type}}
1069 % \rput(18.5,7.5){\pnode{Origin2}}
1070 % \rput(6.5,7.5){\rnode{Quest1}{?}}
1071 % \rput(1,6.5){\Huge I}
1072 % \rput(1.5,6.5){\pstPerson[male, belowtext=1]{I1}}
1073 % \rput(2.5,6.5){\pstPerson[female, obligatory, belowtext=2]{I2}}
1074 % \rput(3.5,6.5){\pstPerson[male, belowtext=3]{I3}}
1075 % \rput(4.5,6.5){\pstPerson[male, belowtext=4]{I4}}
1076 % \rput(5.5,6.5){\pstPerson[male, belowtext=5]{I5}}
1077 % \rput(6.5,6.5){\pstPerson[female, affected,
1079 % \rput(2,7.2){\pnode{Twins1}}
1080 % \rput(4,7.2){\pnode{Twins2}}
1081 % \pstTwins[armB=0]{OType1}{Twins1}{I1}{I2}
1082 % \pstTwins[qzygotic, armB=0, mzlinepos=0.8]{OType1}{Twins2}{I3}{I4}
1083 % \pstDescent[armB=0]{OType1}{I5}
1084 % \pstDescent[armB=0]{Quest1}{I6}
1085 % \pstRelationship[descentnode=I5I6]{I5}{I6}
1086 % \rput(1.5,5.5){\pstChildless{CI1}}
1088 % \rput(13.5,6.5){\pstPerson[male, deceased, belowtextrp=t,
1089 % belowtext=\parbox{2cm}{\centering d. 72 y\\7}]{I7}}
1090 % \rput(15.5,6.5){\pstPerson[female, deceased, belowtextrp=t,
1091 % belowtext=\parbox{2cm}{\centering d. 70 y\\8}]{I8}}
1092 % \pstRelationship[descentnode=I7I8]{I7}{I8}
1093 % \rput(21,6.5){\pstPerson[insidetext=5, belowtext=9--14,
1094 % belowtextrp=rt]{I9}}
1095 % \pstDescent[armB=0]{Origin2}{I8}
1096 % \pstDescent[armB=0]{Origin2}{I9}
1097 % \rput(1,4.5){\Huge II}
1098 % \rput(2.5,4.5){\pstPerson[male, affected, belowtext=1,
1099 % abovetext=Proto, abovetextrp=rB]{II1}}
1100 % \pstDescent{I2}{II1}
1101 % \rput(4.5,4.5){\pstPerson[female, asymptomatic,
1102 % belowtext=\parbox{3cm}{32 y\\
1103 % $E_3-$\\$E_4+$(45n/18n)\\2}, abovetext={Sterrie},
1104 % abovetextrp=rB, evaluated]{II2}}
1105 % \pstDescent{I5I6}{II2}
1106 % \pstRelationship[consanguinic, descentnode=II1II2]{II1}{II2}
1107 % \rput(5.5,5.2){\rnode{Quest2}{?}}
1108 % \rput(5.5,4.5){\pstPerson[female, insidetext=D,
1109 % belowtext=3]{II3}}
1110 % \ncline{Quest2}{II3}
1111 % \rput(6.5,5.2){\rnode{Quest3}{?}}
1112 % \rput(6.5,4.5){\pstPerson[male, insidetext=D,
1113 % belowtext=4]{II4}}
1114 % \ncline{Quest3}{II4}
1115 % \rput(7.5,4.5){\pstPerson[female, belowtext=5]{II5}}
1116 % \rput(8.5,4.5){\pstPerson[male, abovetext=Gary, abovetextrp=rB,
1117 % belowtext=\parbox{2cm}{36 y\\$E_3-$\\6},
1119 % \rput(9.5,4.5){\pstPerson[male, abovetext={Gene},
1120 % belowtext=\parbox{2cm}{36 y\\$E_3-$\\7},
1122 % \rput(9,5.2){\pnode{Twins3}}
1123 % \pstTwins[monozygotic]{I5I6}{Twins3}{II6}{II7}
1124 % \pstRelationship{II5}{II6}
1125 % \rput(7.5,5.7){O'Type}
1126 % \rput(11.5,4.5){\pstPerson[female, proband,
1127 % belowtext=\parbox{1cm}{35 y\\8}, abovetext=Feene]{II8}}
1128 % \pstRelationship[descentnode=II7II8]{II7}{II8}
1129 % \rput(13.5,4.5){\pstPerson[male, belowtext=9]{II9}}
1130 % \pstRelationship[broken, descentnode=II8II9,
1131 % descentnodepos=0.85]{II8}{II9}
1132 % \rput(16,4.5){\pstPerson[abovetext=Stacey, female,
1134 % belowtext=\parbox{1cm}{33y\\ 10}]{II10}}
1135 % \def\affectedstyle{fillstyle=crosshatch}
1136 % \rput(17,4.5){\pstPerson[male, affected, abovetext=Sam,
1137 % belowtext=\parbox{3cm}{31 y\\ $E_2+$\\
1138 % 11}, hatchsep=3pt]{II11}}
1139 % \rput(17,3.5){\pstChildless[infertile]{C2}}
1141 % \rput(18,4.5){\pstPerson[male, obligatory,
1143 % belowtext=\parbox{3cm}{29 y\\ $E_2+$ \\
1145 % \pstDescent{I7I8}{II8}
1146 % \pstDescent{I7I8}{II10}
1147 % \pstDescent{I7I8}{II11}
1148 % \pstDescent{I7I8}{II12}
1149 % \rput(19,4.5){\pstPerson[female, belowtext=13]{II13}}
1150 % \pstRelationship[descentnode=II12II13]{II12}{II13}
1151 % \rput(20,4.5){\pstPerson[female, insidetext=S,
1152 % belowtext=14]{II14}}
1153 % \rput(21,4.5){\pstPerson[insidetext=n]{II15}}
1154 % \pstDescent{I9}{II15}
1155 % \rput(1,2.5){\Huge III}
1156 % \rput(3,2.5){\pstPerson[male, adopted, belowtext=1]{III1}}
1157 % \rput(4,2.5){\pstPerson[insidetext=P, belowtext=2]{III2}}
1158 % \pstDescent[linestyle=dashed]{II1II2}{III1}
1159 % \pstDescent{II1II2}{III2}
1160 % \ncline{II3}{III2}
1161 % \rput(7.5,2.5){\pstPerson[insidetext=P,
1162 % belowtext=\parbox{2cm}{6 wk\\3}]{III3}}
1163 % \pstDescent{II5}{III3}
1164 % \ncline{II4}{III3}
1165 % \def\affectedstyle{fillstyle=vlines}
1166 % \rput(10,2.5){\pstAbortion[affected,
1167 % belowtext=\parbox{2cm}{\centering
1168 % female\\18wk\\$E_1+$(tri 21)\\4},
1169 % belowtextrp=t]{III4}}
1170 % \rput(11,2.5){\pstPerson[insidetext=P,
1171 % belowtext=\parbox{1cm}{16wk\\5}]{III5}}
1172 % \pstDescent{II7II8}{III4}
1173 % \pstDescent{II7II8}{III5}
1174 % \rput(12,2.5){\pstAbortion[belowtext=6]{III6}}
1175 % \rput(13,2.5){\pstAbortion[sab, belowtextrp=t,
1176 % belowtext=\parbox{2cm}{\centering female\\19 wk\\
1178 % \rput(14,2.5){\pstPerson[adopted, male,
1179 % belowtext=\parbox{1cm}{10 y\\ 8}]{III8}}
1180 % \pstDescent{II8II9}{III6}
1181 % \pstDescent{II8II9}{III7}
1182 % \pstDescent{II8II9}{III8}
1183 % \ncline[linestyle=dashed]{II10}{III8}
1184 % \rput(15,2.5){\pstAbortion[sab, belowtext=9]{III9}}
1185 % \def\affectedstyle{fillstyle=hlines}
1186 % \rput(16,2.5){\pstAbortion[sab, belowtextrp=t, affected,
1187 % belowtext=\parbox{2cm}{\centering male\\ 20 wk\\ $E_1+$
1188 % (tri 18)\\ 10}]{III10}}
1189 % \rput(17,2.5){\pstPerson[deceased, female,
1190 % belowtext=\parbox{1cm}{\centering SB\\32 wk\\
1192 % \pstDescent{II10}{III9}
1193 % \pstDescent{II10}{III10}
1194 % \pstDescent{II10}{III11}
1195 % \rput(20,2.5){\pstPerson[insidetext=P,
1196 % belowtext=12]{III12}}
1197 % \pstDescent{II14}{III12}
1198 % \ncline{II12II13}{III12}
1201 % \caption{A Complex Pedigree From~\cite{PedigreeNomenclature95}}
1202 % \label{fig:complex_example}
1209 % \psset{armB=1.1, hatchsep=1.5pt}
1210 % \rput(3.5,8){Ethnic Background}
1211 % \rput(18.5,8){Ethnic Background}
1212 % \rput(3.5,7.5){\rnode{OType1}{O'Type}}
1213 % \rput(18.5,7.5){\pnode{Origin2}}
1214 % \rput(6.5,7.5){\rnode{Quest1}{?}}
1215 % \rput(1,6.5){\Huge I}
1216 % \rput(1.5,6.5){\pstPerson[male, belowtext=1]{I1}}
1217 % \rput(2.5,6.5){\pstPerson[female, obligatory, belowtext=2]{I2}}
1218 % \rput(3.5,6.5){\pstPerson[male, belowtext=3]{I3}}
1219 % \rput(4.5,6.5){\pstPerson[male, belowtext=4]{I4}}
1220 % \rput(5.5,6.5){\pstPerson[male, belowtext=5]{I5}}
1221 % \rput(6.5,6.5){\pstPerson[female, affected,
1223 % \rput(2,7.2){\pnode{Twins1}}
1224 % \rput(4,7.2){\pnode{Twins2}}
1225 % \pstTwins[armB=0]{OType1}{Twins1}{I1}{I2}
1226 % \pstTwins[qzygotic, armB=0, mzlinepos=0.8]{OType1}{Twins2}{I3}{I4}
1227 % \pstDescent[armB=0]{OType1}{I5}
1228 % \pstDescent[armB=0]{Quest1}{I6}
1229 % \pstRelationship[descentnode=I5I6]{I5}{I6}
1230 % \rput(1.5,5.5){\pstChildless{CI1}}
1232 % \rput(13.5,6.5){\pstPerson[male, deceased, belowtextrp=t,
1233 % belowtext=\parbox{2cm}{\centering d. 72 y\\7}]{I7}}
1234 % \rput(15.5,6.5){\pstPerson[female, deceased, belowtextrp=t,
1235 % belowtext=\parbox{2cm}{\centering d. 70 y\\8}]{I8}}
1236 % \pstRelationship[descentnode=I7I8]{I7}{I8}
1237 % \rput(21,6.5){\pstPerson[insidetext=5, belowtext=9--14,
1238 % belowtextrp=rt]{I9}}
1239 % \pstDescent[armB=0]{Origin2}{I8}
1240 % \pstDescent[armB=0]{Origin2}{I9}
1242 % \caption{Code for Figure~\ref{fig:complex_example}: Generation I}
1243 % \label{fig:complex_example_codeI}
1249 % \rput(1,4.5){\Huge II}
1250 % \rput(2.5,4.5){\pstPerson[male, affected, belowtext=1,
1251 % abovetext=Proto, abovetextrp=rB]{II1}}
1252 % \pstDescent{I2}{II1}
1253 % \rput(4.5,4.5){\pstPerson[female, asymptomatic,
1254 % belowtext=\parbox{3cm}{32 y\\
1255 % $E_3-$\\$E_4+$(45n/18n)\\2}, abovetext={Sterrie},
1256 % abovetextrp=rB, evaluated]{II2}}
1257 % \pstDescent{I5I6}{II2}
1258 % \pstRelationship[consanguinic, descentnode=II1II2]{II1}{II2}
1259 % \rput(5.5,5.2){\rnode{Quest2}{?}}
1260 % \rput(5.5,4.5){\pstPerson[female, insidetext=D,
1261 % belowtext=3]{II3}}
1262 % \ncline{Quest2}{II3}
1263 % \rput(6.5,5.2){\rnode{Quest3}{?}}
1264 % \rput(6.5,4.5){\pstPerson[male, insidetext=D,
1265 % belowtext=4]{II4}}
1266 % \ncline{Quest3}{II4}
1267 % \rput(7.5,4.5){\pstPerson[female, belowtext=5]{II5}}
1268 % \rput(8.5,4.5){\pstPerson[male, abovetext=Gary, abovetextrp=rB,
1269 % belowtext=\parbox{2cm}{36 y\\$E_3-$\\6},
1271 % \rput(9.5,4.5){\pstPerson[male, abovetext={Gene},
1272 % belowtext=\parbox{2cm}{36 y\\$E_3-$\\7},
1274 % \rput(9,5.2){\pnode{Twins3}}
1275 % \pstTwins[monozygotic]{I5I6}{Twins3}{II6}{II7}
1276 % \pstRelationship{II5}{II6}
1277 % \rput(7.5,5.7){O'Type}
1278 % \rput(11.5,4.5){\pstPerson[female, proband,
1279 % belowtext=\parbox{1cm}{35 y\\8}, abovetext=Feene]{II8}}
1280 % \pstRelationship[descentnode=II7II8]{II7}{II8}
1281 % \rput(13.5,4.5){\pstPerson[male, belowtext=9]{II9}}
1282 % \pstRelationship[broken, descentnode=II8II9,
1283 % descentnodepos=0.85]{II8}{II9}
1284 % \rput(16,4.5){\pstPerson[abovetext=Stacey, female,
1286 % belowtext=\parbox{1cm}{33y\\ 10}]{II10}}
1287 % \def\affectedstyle{fillstyle=crosshatch}
1288 % \rput(17,4.5){\pstPerson[male, affected, abovetext=Sam,
1289 % belowtext=\parbox{3cm}{31 y\\ $E_2+$\\
1290 % 11}, hatchsep=3pt]{II11}}
1291 % \rput(17,3.5){\pstChildless[infertile]{C2}}
1293 % \rput(18,4.5){\pstPerson[male, obligatory,
1295 % belowtext=\parbox{3cm}{29 y\\ $E_2+$ \\
1297 % \pstDescent{I7I8}{II8}
1298 % \pstDescent{I7I8}{II10}
1299 % \pstDescent{I7I8}{II11}
1300 % \pstDescent{I7I8}{II12}
1301 % \rput(19,4.5){\pstPerson[female, belowtext=13]{II13}}
1302 % \pstRelationship[descentnode=II12II13]{II12}{II13}
1303 % \rput(20,4.5){\pstPerson[female, insidetext=S,
1304 % belowtext=14]{II14}}
1305 % \rput(21,4.5){\pstPerson[insidetext=n]{II15}}
1306 % \pstDescent{I9}{II15}
1308 % \caption{Code for Figure~\ref{fig:complex_example}: Generation II}
1309 % \label{fig:complex_example_codeII}
1315 % \rput(1,2.5){\Huge III}
1316 % \rput(3,2.5){\pstPerson[male, adopted, belowtext=1]{III1}}
1317 % \rput(4,2.5){\pstPerson[insidetext=P, belowtext=2]{III2}}
1318 % \pstDescent[linestyle=dashed]{II1II2}{III1}
1319 % \pstDescent{II1II2}{III2}
1320 % \ncline{II3}{III2}
1321 % \rput(7.5,2.5){\pstPerson[insidetext=P,
1322 % belowtext=\parbox{2cm}{6 wk\\3}]{III3}}
1323 % \pstDescent{II5}{III3}
1324 % \ncline{II4}{III3}
1325 % \def\affectedstyle{fillstyle=vlines}
1326 % \rput(10,2.5){\pstAbortion[affected,
1327 % belowtext=\parbox{2cm}{\centering
1328 % female\\18wk\\$E_1+$(tri 21)\\4},
1329 % belowtextrp=t]{III4}}
1330 % \rput(11,2.5){\pstPerson[insidetext=P,
1331 % belowtext=\parbox{1cm}{16wk\\5}]{III5}}
1332 % \pstDescent{II7II8}{III4}
1333 % \pstDescent{II7II8}{III5}
1334 % \rput(12,2.5){\pstAbortion[belowtext=6]{III6}}
1335 % \rput(13,2.5){\pstAbortion[sab, belowtextrp=t,
1336 % belowtext=\parbox{2cm}{\centering female\\19 wk\\
1338 % \rput(14,2.5){\pstPerson[adopted, male,
1339 % belowtext=\parbox{1cm}{10 y\\ 8}]{III8}}
1340 % \pstDescent{II8II9}{III6}
1341 % \pstDescent{II8II9}{III7}
1342 % \pstDescent{II8II9}{III8}
1343 % \ncline[linestyle=dashed]{II10}{III8}
1344 % \rput(15,2.5){\pstAbortion[sab, belowtext=9]{III9}}
1345 % \def\affectedstyle{fillstyle=hlines}
1346 % \rput(16,2.5){\pstAbortion[sab, belowtextrp=t, affected,
1347 % belowtext=\parbox{2cm}{\centering male\\ 20 wk\\ $E_1+$
1348 % (tri 18)\\ 10}]{III10}}
1349 % \rput(17,2.5){\pstPerson[deceased, female,
1350 % belowtext=\parbox{1cm}{\centering SB\\32 wk\\
1352 % \pstDescent{II10}{III9}
1353 % \pstDescent{II10}{III10}
1354 % \pstDescent{II10}{III11}
1355 % \rput(20,2.5){\pstPerson[insidetext=P,
1356 % belowtext=12]{III12}}
1357 % \pstDescent{II14}{III12}
1358 % \ncline{II12II13}{III12}
1360 % \caption{Code for Figure~\ref{fig:complex_example}: Generation III}
1361 % \label{fig:complex_example_codeIII}
1368 %\section{Implementation}
1369 %\label{sec:implementation}
1373 %\subsection{Identification and Setting Up}
1374 %\label{sec:identification}
1377 %Traditionally |PSTricks| works in two regimes: the \LaTeX one and
1378 %the plain one. Probably it is a good idea to keep this
1379 %tradition. Therefore we will use a \TeX{} file \path{pst-pdgr.tex}
1380 %and a \LaTeX file \path{pst-pdgr.sty}. They have different means of
1381 %preserving from loading twice and identification.
1383 % \begin{macro}{\PSTPedigreeLoaded}
1384 % A \TeX{} guard |\PSTPedigreeLoaded| prevents the double loading
1388 \csname PSTPedigreeLoaded\endcsname
1389 \let\PSTPedigreeLoaded\endinput
1394 %Now we can start real identification. Note the difference between
1395 %the ways a \LaTeX{} style, a \LaTeX{} configuration file and a \TeX{}
1396 %file announce itself
1398 %<latex>\NeedsTeXFormat{LaTeX2e}
1399 %<latex>\ProvidesPackage{pst-pdgr}
1400 %<cfg>\ProvidesFile{pst-pdgr.cfg}
1402 [2006/04/18 v0.2a Medical Pedigree with PSTricks]
1406 % The \LaTeX{} style is in fact just a wrapper: it calls the
1407 % configuration file, and then the \TeX file, which does the real
1411 \InputIfFileExists{pst-pdgr.cfg}{%
1412 \typeout{Loading configuration file pst-pdgr.cfg}}{%
1413 \typeout{Configuration file pst-pdgr.cfg is not found}}
1414 \input{pst-pdgr.tex}
1418 % Now we are dealing (almost) exclusively with \TeX.
1423 % Check the packages we use are loaded:
1425 \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
1426 \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
1427 \ifx\PSTreeLoaded\endinput\else\input pst-tree.tex\fi
1428 \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
1431 % We set up that |@| symbol:
1433 \catcode`\@=11\relax
1435 % and set up keys for our package
1437 \pst@addfams{pst-pdgr}
1440 %\subsection{Global Parameters}
1441 %\label{sec:impl_globals}
1443 % These macros define the way affected individuals are drawn
1444 % \begin{macro}{\affectedbgcolor}
1445 % The background color:
1447 \def\affectedbgcolor{gray}
1450 % \begin{macro}{\affectedfgcolor}
1451 % The foreground color for the text:
1453 \def\affectedfgcolor{white}
1456 % \begin{macro}{\affectedstyle}
1459 \def\affectedstyle{fillstyle=solid, fillcolor=\affectedbgcolor}
1462 % \begin{macro}{\pst@pdgr@intxtcolor}
1463 % Normally the color of the inside text for normal persons is the
1466 \def\pst@pdgr@instxtcolor{\relax}
1472 %\subsection{Options}
1473 %\label{sec:impl_opts}
1475 % Here we define the option for the commands and their action.
1478 %\subsubsection{Choice Options}
1479 %\label{sec:impl_choice}
1481 % This groups of options sets a key from a given set of choices.
1482 % \begin{macro}{\pst@pdgr@sex}
1483 % First, the sex of the person. The numbers 0, 1 and 2 correspond
1484 % to the sequence in the alternatives list
1486 \def\pst@pdgr@sex{0}
1487 \define@choicekey[psset]{pst-pdgr}{sex}[\pst@pdgr@temp \pst@pdgr@sex]{%
1488 unknown,male,female}[unknown]{}
1491 % \begin{macro}{\pst@pdgr@condition}
1492 % Next, the condition of the person. The numbers again correspond
1493 % to the sequence in the alternatives list
1495 \def\pst@pdgr@condition{0}
1496 \define@choicekey[psset]{pst-pdgr}{%
1497 condition}[\pst@pdgr@temp \pst@pdgr@condition]{%
1498 normal,obligatory,asymptomatic,affected}[normal]{}
1502 % A bunch of shortcuts
1504 \define@key[psset]{pst-pdgr}{unknown}[]{\psset{sex=unknown}}
1505 \define@key[psset]{pst-pdgr}{male}[]{\psset{sex=male}}
1506 \define@key[psset]{pst-pdgr}{female}[]{\psset{sex=female}}
1507 \define@key[psset]{pst-pdgr}{normal}[]{\psset{condition=normal}}
1508 \define@key[psset]{pst-pdgr}{obligatory}[]{\psset{condition=obligatory}}
1509 \define@key[psset]{pst-pdgr}{asymptomatic}[]{\psset{condition=asymptomatic}}
1510 \define@key[psset]{pst-pdgr}{affected}[]{\psset{condition=affected}}
1515 %\subsubsection{Boolean Options}
1516 %\label{sec:impl_bool}
1518 % True or false options.
1521 % \begin{macro}{\pst@pdgr@defineboolkey}
1522 % We use use our own version of definition of boolean keys, rather
1523 % than the one provided by |xkeyval|.
1525 \def\pst@pdgr@defineboolkey#1{%
1526 \expandafter\newif\csname ifpst@pdgr@#1\endcsname%
1527 \csname pst@pdgr@#1false\endcsname%
1528 \define@key[psset]{pst-pdgr}{#1}[true]{%
1529 \@nameuse{pst@pdgr@#1##1}}}
1534 % \begin{macro}{\ifpst@pdgr@deceased}
1535 % Whether the individual is deceased:
1537 \pst@pdgr@defineboolkey{deceased}
1540 % \begin{macro}{\ifpst@pdgr@proband}
1541 % Whether the individual is a proband:
1543 \pst@pdgr@defineboolkey{proband}
1546 % \begin{macro}{\ifpst@pdgr@adopted}
1547 % Whether the individual is adopted:
1549 \pst@pdgr@defineboolkey{adopted}
1552 % \begin{macro}{\ifpst@pdgr@evaluated}
1553 % Whether the individual is evaluated:
1555 \pst@pdgr@defineboolkey{evaluated}
1558 % \begin{macro}{\ifpst@pdgr@sab}
1559 % Whether the abortion is SAB:
1561 \pst@pdgr@defineboolkey{sab}
1564 % \begin{macro}{\ifpst@pdgr@infertile}
1565 % Whether the individual or relationship is infertile:
1567 \pst@pdgr@defineboolkey{infertile}
1570 % \begin{macro}{\ifpst@pdgr@broken}
1571 % Whether the relationship is broken:
1573 \pst@pdgr@defineboolkey{broken}
1576 % \begin{macro}{\ifpst@pdgr@consanguinic}
1577 % Whether the relationship is consanguinic:
1579 \pst@pdgr@defineboolkey{consanguinic}
1582 % \begin{macro}{\ifpst@pdgr@monozygotic}
1583 % Whether the twins are monozygotic:
1585 \pst@pdgr@defineboolkey{monozygotic}
1588 % \begin{macro}{\ifpst@pdgr@qzygotic}
1589 % Whether the are questionably monozygotic:
1591 \pst@pdgr@defineboolkey{qzygotic}
1598 %\subsubsection{String Options}
1599 %\label{sec:impl_string}
1601 % Options setting up strings.
1604 % \begin{macro}{\pst@pdgr@insidetext}
1605 % Text inside the symbol
1607 \def\pst@pdgr@insidetext{}%
1608 \define@key[psset]{pst-pdgr}{insidetext}{%
1609 \def\pst@pdgr@insidetext{#1}}%
1612 % \begin{macro}{\pst@pdgr@belowtext}
1613 % Text below the symbol
1615 \def\pst@pdgr@belowtext{}%
1616 \define@key[psset]{pst-pdgr}{belowtext}{%
1617 \def\pst@pdgr@belowtext{#1}}%
1620 % \begin{macro}{\pst@pdgr@abovetext}
1621 % Text above the symbol
1623 \def\pst@pdgr@abovetext{}%
1624 \define@key[psset]{pst-pdgr}{abovetext}{%
1625 \def\pst@pdgr@abovetext{#1}}%
1628 % \begin{macro}{\pst@pdgr@lefttext}
1629 % Text to the left of the symbol
1631 \def\pst@pdgr@lefttext{}%
1632 \define@key[psset]{pst-pdgr}{lefttext}{%
1633 \def\pst@pdgr@lefttext{#1}}%
1636 % \begin{macro}{\pst@pdgr@righttext}
1637 % Text to the right of the symbol
1639 \def\pst@pdgr@righttext{}%
1640 \define@key[psset]{pst-pdgr}{righttext}{%
1641 \def\pst@pdgr@righttext{#1}}%
1644 % \begin{macro}{\pst@pdgr@descentnode}
1645 % Name of the descent node
1647 \def\pst@pdgr@descentnode{}%
1648 \define@key[psset]{pst-pdgr}{descentnode}{%
1649 \def\pst@pdgr@descentnode{#1}}%
1652 % \begin{macro}{\pst@pdgr@rellinecmd}
1653 % Command to draw relationship lines:
1655 \def\pst@pdgr@rellinecmd{\ncline}%
1656 \define@key[psset]{pst-pdgr}{rellinecmd}{%
1657 \def\pst@pdgr@rellinecmd{\@nameuse{#1}}}%
1661 % A number of text positioning commands.
1662 % \begin{macro}{\pst@pdgr@abovetextrp}
1663 % The command to set the reference position for the text above the
1666 \def\pst@pdgr@abovetextrp{lB}%
1667 \define@key[psset]{pst-pdgr}{abovetextrp}{%
1668 \def\pst@pdgr@abovetextrp{#1}}%
1670 % \changes{v0.2}{2006/04/18}{Added the command}
1672 % \begin{macro}{\pst@pdgr@belowtextrp}
1673 % The command to set the reference position for the text below the
1676 \def\pst@pdgr@belowtextrp{lt}%
1677 \define@key[psset]{pst-pdgr}{belowtextrp}{%
1678 \def\pst@pdgr@belowtextrp{#1}}%
1680 % \changes{v0.2}{2006/04/18}{Added the command}
1682 % \begin{macro}{\pst@pdgr@lefttextrp}
1683 % The command to set the reference position for the text to the left
1686 \def\pst@pdgr@lefttextrp{r}%
1687 \define@key[psset]{pst-pdgr}{lefttextrp}{%
1688 \def\pst@pdgr@lefttextrp{#1}}%
1690 % \changes{v0.2}{2006/04/18}{Added the command}
1692 % \begin{macro}{\pst@pdgr@righttextrp}
1693 % The command to set the reference position for the text to the right
1696 \def\pst@pdgr@righttextrp{l}%
1697 \define@key[psset]{pst-pdgr}{righttextrp}{%
1698 \def\pst@pdgr@righttextrp{#1}}%
1700 % \changes{v0.2}{2006/04/18}{Added the command}
1703 % The option |addtwin| for |\pstTwin| command is special. Since it
1704 % can be repeated, we want it to be executed immediately. We store
1705 % the name of the descentnode in |\pst@pdgr@tempnode|
1707 \define@key[psset]{pst-pdgr}{addtwin}{\ncline{\pst@pdgr@tempnode}{#1}}%
1708 \define@key[psset]{pst-pdgr}{descentnode}{%
1709 \def\pst@pdgr@descentnode{#1}}%
1714 %\subsubsection{Numerical Options}
1715 %\label{sec:impl_opts_num}
1717 % The options to set up numerical values.
1719 % \begin{macro}{\pst@pdgr@descentnodepos}
1720 % The position of the descent node on the relationship line
1722 \def\pst@pdgr@descentnodepos{0.5}
1723 \define@key[psset]{pst-pdgr}{descentnodepos}{%
1724 \pst@checknum{#1}\pst@pdgr@descentnodepos%
1725 \ifdim\pst@pdgr@descentnodepos \p@<\z@
1726 \def\pst@pdgr@descentnodepos{0.5}%
1727 \@pstrickserr{Bad `descentnodepos' value: `#1'. Must be >0}\@ehpa%
1731 % \begin{macro}{\pst@pdgr@brokenpos}
1732 % The position of the broken line symbol on the relationship line
1734 \def\pst@pdgr@brokenpos{0.3}
1735 \define@key[psset]{pst-pdgr}{brokenpos}{%
1736 \pst@checknum{#1}\pst@pdgr@brokenpos%
1737 \ifdim\pst@pdgr@brokenpos \p@<\z@
1738 \def\pst@pdgr@brokenpos{0.3}%
1739 \@pstrickserr{Bad `brokenpos' value: `#1'. Must be >0}\@ehpa%
1743 % \begin{macro}{\pst@pdgr@mzlinepos}
1744 % The position of the monozygotic line or question mark on the twins
1747 \def\pst@pdgr@mzlinepos{0.5}
1748 \define@key[psset]{pst-pdgr}{mzlinepos}{%
1749 \pst@checknum{#1}\pst@pdgr@mzlinepos%
1750 \ifdim\pst@pdgr@mzlinepos \p@<\z@%
1751 \def\pst@pdgr@mzlinepos{0.5}%
1752 \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be >0}\@ehpa%
1754 \ifdim\pst@pdgr@mzlinepos \p@>\p@\relax%
1755 \def\pst@pdgr@mzlinepos{0.5}%
1756 \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be <1}\@ehpa%
1764 %\subsection{Drawing A Person}
1765 %\label{sec:impl_pstPerson}
1767 % And now the main macro.
1769 % \begin{macro}{\pstPerson}
1770 % First, the standard processing of optional parameter
1772 \def\pstPerson{\@ifnextchar[{\pstPerson@i}{\pstPerson@i[]}}
1775 % \begin{macro}{\pstPerson@i}
1776 % And now we are ready for a real work. Actually we create a
1777 % |rnode| and put everything inside. We add a |\pspicture| for the
1778 % node to have non-zero size.
1780 \def\pstPerson@i[#1]#2{%
1782 \psset{arrows=-, linestyle=solid}%
1784 \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.25)%
1786 % Condition processing.
1788 \ifcase\pst@pdgr@condition\relax % Nothing to do if normal
1792 \qline(0,0.25)(0,-0.25)%
1794 \expandafter\psset\expandafter{\affectedstyle}%
1795 \def\pst@pdgr@instxtcolor{\csname\affectedfgcolor\endcsname}%
1798 % The actual drawing
1800 \ifcase\pst@pdgr@sex\relax % First, unknown sex. A diamond
1801 \pspolygon(0,0.25)(0.25,0)(0,-0.25)(-0.25,0)%
1802 \or % Male. A square with side 0.5
1803 \pspolygon(-0.25,-0.25)(-0.25,0.25)(0.25,0.25)(0.25,-0.25)%
1804 \or % Female. A circle with radius 0.25
1808 % Necessary for next
1810 \psset{fillstyle=none}%
1815 \ifpst@pdgr@deceased%
1816 \qline(-0.33,-0.33)(0.33,0.33)%
1821 \ifpst@pdgr@proband%
1822 \psline[arrows=->](-0.55,-0.55)(-0.29,-0.29)%
1827 \ifpst@pdgr@adopted%
1828 \psline(-0.25,-0.35)(-0.35,-0.35)(-0.35,0.35)(-0.25,0.35)%
1829 \psline(0.25,-0.35)(0.35,-0.35)(0.35,0.35)(0.25,0.35)%
1832 % \changes{v0.2}{2006/04/18}{Slightly increased brackets for the ``adopted''
1836 \ifpst@pdgr@evaluated%
1837 \rput(0.4,-0.4){$\ast$}%
1841 % Now a bunch of text putting commands
1843 \ifx\pst@pdgr@abovetext\@empty\relax\else%
1844 \rput[\pst@pdgr@abovetextrp](0,0.4){%
1845 \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
1847 \ifx\pst@pdgr@belowtext\@empty\relax\else%
1848 \rput[\pst@pdgr@belowtextrp](0,-0.4){%
1849 \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
1851 \ifx\pst@pdgr@righttext\@empty\relax\else%
1852 \rput[\pst@pdgr@righttextrp](0.4,0){\pst@pdgr@righttext}%
1854 \ifx\pst@pdgr@lefttext\@empty\relax\else%
1855 \rput[\pst@pdgr@lefttextrp](-0.4,0){\pst@pdgr@lefttext}%
1858 % Inside text is a bit more difficult since we want to be able to
1859 % do reverse video if necessary
1861 \ifx\pst@pdgr@insidetext\@empty\relax\else%
1862 \rput(0,0){\pst@pdgr@instxtcolor\pst@pdgr@insidetext}%
1867 % \changes{v0.2}{2006/04/18}{Changed text positioning}
1871 %\subsection{Drawing A Terminated Pregnancy}
1872 %\label{sec:impl_pstAbortion}
1874 % \begin{macro}{\pstAbortion}
1875 % First, the standard processing of optional parameter
1877 \def\pstAbortion{\@ifnextchar[{\pstAbortion@i}{\pstAbortion@i[]}}%
1880 % \begin{macro}{\pstAbortion@i}
1881 % And the actual macro:
1883 \def\pstAbortion@i[#1]#2{%
1885 \psset{arrows=-, linestyle=solid}%
1889 % The standard~\cite{PedigreeNomenclature95} requires the lines for
1890 % the terminated pregnancies to be shorter than for the normal ones.
1891 % A way to do this is to make the node \emph{higher}:
1893 \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.5)%
1897 % Condition processing:
1899 \ifcase\pst@pdgr@condition\relax % Nothing to do if normal
1900 \or \relax % Nothing to do if obligatory
1901 \or \relax % Nothing to do if asymptomatic
1903 \expandafter\psset\expandafter{\affectedstyle}%
1907 % If this is a terminated pregnancy, we use the same symbol as for
1910 \ifpst@pdgr@sab\relax\else%
1911 \qline(-0.25,0.1)(0.25,0.6)%
1915 % The actual drawing
1917 \pspolygon(-0.25,0.25)(0,0.5)(0.25,0.25)
1920 % And text putting commands
1922 \ifx\pst@pdgr@abovetext\@empty\relax\else%
1923 \rput[\pst@pdgr@abovetextrp](0,0.65){%
1924 \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
1926 \ifx\pst@pdgr@belowtext\@empty\relax\else%
1927 \rput[\pst@pdgr@belowtextrp](0,0.1){%
1928 \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
1930 \ifx\pst@pdgr@righttext\@empty\relax\else%
1931 \rput[\pst@pdgr@righttextrp](0.4,0.35){\pst@pdgr@righttext}%
1933 \ifx\pst@pdgr@lefttext\@empty\relax\else%
1934 \rput[\pst@pdgr@lefttextrp](-0.4,0.35){\pst@pdgr@lefttext}%
1939 % \changes{v0.2}{2006/04/18}{Changed text positioning}
1943 %\subsection{Drawing A Childlessness Symbol}
1944 %\label{sec:impl_childless}
1946 % \begin{macro}{\pstChildless}
1947 % Again, the standard processing of optional parameter
1949 \def\pstChildless{\@ifnextchar[{\pstChildless@i}{\pstChildless@i[]}}%
1952 % \begin{macro}{\pstChildless@i}
1953 % And the actual macro:
1955 \def\pstChildless@i[#1]#2{%
1957 \psset{arrows=-, linestyle=solid}%
1960 % The actual drawing depends on the |infertile| option. If it is
1961 % true, we want a double line (an non-zero height). Otherwise this is
1962 % a single line with zero height:
1964 \ifpst@pdgr@infertile % double line
1965 \pspicture[shift=-0.05](-0.2,-0.05)(0.2,0.05)%
1966 \qline(-0.2,-0.05)(0.2,-0.05)%
1967 \qline(-0.2,0.05)(0.2,0.05)%
1970 \qline(-0.2,0)(0.2,0)%
1973 % And the text below the symbol:
1975 \ifx\pst@pdgr@belowtext\@empty\relax\else%
1976 \rput[t](0,-0.2){\pst@pdgr@belowtext}%
1983 %\subsection{Drawing A Relationship Line}
1984 %\label{sec:impl_pstRelationship}
1986 % \begin{macro}{\pstRelationship}
1987 % The |\pstRelationship| command can have both optional and
1988 % non-optional parameters:
1990 \def\pstRelationship{\@ifnextchar[{%
1991 \pstRelationship@i}{\pstRelationship@i[]}}%
1994 % \begin{macro}{\pstRelationship@i}
1997 \def\pstRelationship@i[#1]#2#3{%
1999 \psset{arrows=-, linestyle=solid, nodesep=0.7\pslinewidth}%
2002 % A consanguinic relationship is shown by a double line:
2004 \ifpst@pdgr@consanguinic%
2005 \psset{doubleline=true}%
2007 \psset{doubleline=false}%
2010 % The actual drawing
2012 \pst@pdgr@rellinecmd{#2}{#3}%
2014 % The broken relationships are shown using //:
2017 \lput(\pst@pdgr@brokenpos){/\kern-0.7ex/}%
2020 % And the descent node
2022 \ifx\pst@pdgr@descentnode\@empty\relax%
2024 \lput(\pst@pdgr@descentnodepos){\pnode{\pst@pdgr@descentnode}}%
2032 %\subsection{Drawing a Descent Line}
2033 %\label{sec:impl_pstDescent}
2035 % \begin{macro}{\pstDescent}
2036 % The standard option processing command:
2038 \def\pstDescent{\@ifnextchar[{\pstDescent@i}{\pstDescent@i[]}}%
2041 % \begin{macro}{\pstDescent@i}
2042 % The actual macro. Note the ``reverse'' direction of the line:
2043 % this is because for |\ncangle| only |armB| is constant, and we
2044 % want the sib line to be straight
2046 \def\pstDescent@i[#1]#2#3{%
2048 \psset{arrows=-, linestyle=solid, angleA=90, %
2058 %\subsection{Drawing Twins}
2059 %\label{sec:impl_pstTwins}
2061 % \begin{macro}{\pstTwins}
2062 % The standard option processing command:
2064 \def\pstTwins{\@ifnextchar[{\pstTwins@i}{\pstTwins@i[]}}%
2067 % \begin{macro}{\pstTwins@i}
2068 % The actual macro. Note that we need to keep the twin node in
2069 % |\pst@pdgr@tempnode| to correctly process |addtwin|.
2071 \def\pstTwins@i[#1]#2#3#4#5{%
2073 \def\pst@pdgr@tempnode{#3}
2074 \psset{arrows=-, linestyle=solid, angleA=90, %
2078 % The descent line from the parent to the twin node
2080 \pstDescent{#2}{#3}%
2082 % And the twin lines and nodes
2085 \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeA}}%
2087 \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeB}}%
2089 % The monozygotic or qzygotic line
2091 \ifpst@pdgr@monozygotic%
2092 \ncline{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
2094 \ifpst@pdgr@qzygotic%
2095 \ncline[linestyle=none]{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
2106 %\subsection{Tree Making Commands}
2107 %\label{sec:impl_trees}
2109 % \begin{macro}{\pst@pdgr@makeTcommand}
2110 % The general macro to create a tree command from the normal command
2112 \def\pst@pdgr@makeTcommand#1{%
2114 \@ifnextchar[{\@nameuse{T#1@i}}{\@nameuse{T#1@i}[]}}%
2115 \@namedef{T#1@i}[##1]##2{%
2116 \Tr{\@nameuse{#1@i}[##1]{##2}}}}%
2121 % \begin{macro}{\TpstPerson}
2124 \pst@pdgr@makeTcommand{pstPerson}%
2127 % \begin{macro}{\TpstAbortion}
2128 % Drawing an abortion
2130 \pst@pdgr@makeTcommand{pstAbortion}%
2133 % \begin{macro}{\TpstChildless}
2134 % Drawing a childlessness symbol
2136 \pst@pdgr@makeTcommand{pstChildless}%
2140 %\subsection{Finishing Touch}
2150 %\iffalse\bibliography{genetics,neurology,tex}\fi
2151 %\bibliography{pst-pdgr}
2152 %\bibliographystyle{plain}