Browse Source

Comment the code

develop
Damien Goutte-Gattat 8 years ago
parent
commit
da5ea875ec
1 changed files with 76 additions and 0 deletions
  1. +76
    -0
      flygenet.dtx

+ 76
- 0
flygenet.dtx View File

@ -46,6 +46,7 @@ has been generated for details.
\ProvidesFile{flygenet.dtx}[2013/07/14 v0.1 Fly genetics notation]
\documentclass[a4paper]{ltxdoc}
\usepackage{hyperref}
\usepackage{wasysym}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@ -120,22 +121,68 @@ has been generated for details.
\ProvidesPackage{flygenet}[2013/07/14 v0.1 Fly genetics notation]
% \end{macrocode}
%
% We load the |wasysym| package, that we will use to typeset the female
% (\venus), male (\mars) and virgin female (\mercury) symbols.
% \begin{macrocode}
\RequirePackage{wasysym}
% \end{macrocode}
%
% \subsection{Typesetting genotypes}
%
% \begin{macro}{\fly@printchromosome}
% This macro typesets a single chromosome pair, as a mathematical
% fraction.
% \begin{macrocode}
\def\fly@printchromosome#1/#2\end{%
\def\fly@argii{#2}%
\ifx\fly@argii\empty\mathit{#1}\else\frac{\mathit{#1}}{\mathit{#2}}\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\fly@parsechromosome}
% This macro parses a genotype notation (chromosome pairs separated by
% semi-colons), and calls the |\fly@printchromosome| for each chromosome
% pair.
% \begin{macrocode}
\def\fly@parsechromosome#1;#2\end{%
\fly@printchromosome#1\end%
\def\fly@argii{#2}%
\ifx\fly@argii\empty\else; \fly@parsechromosome#2\end\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mhyphen}
% \begin{macro}{\mcolon}
% These two macros are used to typeset actual hyphens and colons in math
% mode.
% \begin{macrocode}
\mathchardef\mhyphen="2D
\mathchardef\mcolon="3A
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\fly@endgenotype}
% This macro is called at the end of the |\genotype| macro. It performs
% the task of parsing and typesetting the genotype and reset the
% modified catcodes.
% \begin{macrocode}
\def\fly@endgenotype#1{%
\fly@parsechromosome#1;\end%
\catcode`\ =10\relax%
\catcode`\-=12\relax%
\catcode`\:=12\relax}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\genotype}
% This macro is the main user interface to typeset a genotype. Its
% declaration is enclosed in a group since we need to locally modify the
% catcodes of some characters. For the same reason, the macro cannot be
% declared as expecting an argument (otherwise, the argument would be
% parsed before the catcodes are modified)---the argument is parsed when
% calling the |\fly@endgenotype| macro.
% \begin{macrocode}
\begingroup
\catcode`\ =\active
\catcode`\-=\active
@ -146,13 +193,42 @@ has been generated for details.
\catcode`\:=\active\let:=\mcolon%
\fly@endgenotype}
\endgroup
% \end{macrocode}
% \end{macro}
%
% \subsection{Gender symbols}
%
% \begin{macro}{\female}
% \begin{macro}{\male}
% \begin{macro}{\virgin}
% These macros typeset a genotype as |\genotype| does, but insert a
% female (\venus), male (\mars) or virgin female (\mercury) symbol at
% the beginning. This is intended as an abstraction layer above the
% |wasysym| package providing these symbols.
% \begin{macrocode}
\def\female{\venus\;\genotype}
\def\male{\mars\;\genotype}
\def\virgin{\mercury\;\genotype}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\females}
% \begin{macro}{\males}
% \begin{macro}{\virgins}
% These macros are similar to their singular forms above, but inserts
% two female, male or virgin female symbols at the beginning. By
% convention, this is used to represent several individuals of the
% indicated genotype.
% \begin{macrocode}
\def\females{\venus\venus\;\genotype}
\def\males{\mars\mars\;\genotype}
\def\virgins{\mercury\mercury\;\genotype}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \Finale
\endinput

Loading…
Cancel
Save