Browse Source

Add the \allele macro

Add a new macro to typeset gene alleles. Inside the \genotype
macro, the exponentiation character ^ is redefined as an alias to
that macro.
develop
Damien Goutte-Gattat 6 years ago
parent
commit
2e8008b3d7
1 changed files with 30 additions and 11 deletions
  1. +30
    -11
      flygenet.dtx

+ 30
- 11
flygenet.dtx View File

@ -76,22 +76,25 @@ has been generated for details.
%
% \DoNotIndex{\,}
% \DoNotIndex{\active}
% \DoNotIndex{\begingroup}
% \DoNotIndex{\catcode}
% \DoNotIndex{\DeclareOption,\def}
% \DoNotIndex{\else,\empty,\end,\endgroup,\ensuremath}
% \DoNotIndex{\fi,\frac}
% \DoNotIndex{\height}
% \DoNotIndex{\gdef}
% \DoNotIndex{\height,\hspace}
% \DoNotIndex{\if,\ifmmode,\ifx,\itshape}
% \DoNotIndex{\let}
% \DoNotIndex{\mars,\mathchoice,\mbox,\mercury}
% \DoNotIndex{\NeedsTeXFormat,\newif,\node,\normalsize}
% \DoNotIndex{\ProcessOptions,\ProvidesPackage}
% \DoNotIndex{\RequirePackage,\raisebox,\relax}
% \DoNotIndex{\text}
% \DoNotIndex{\text,\textsuperscript}
% \DoNotIndex{\venus}
%
% \changes{0.1}{2013/07/14}{Initial version.}
% \changes{0.2}{2013/10/09}{Remove limitations.}
% \changes{0.3}{2014/01/01}{Do not draw Y hook.}
% \changes{0.3}{2014/01/01}{Do not draw Y hook; add allele macro.}
%
% \GetFileInfo{flygenet.dtx}
%
@ -116,7 +119,7 @@ has been generated for details.
% notation, as in the following example:
%
% $$
% \genotype{C(1)RM,y\ts2/Y; In(2LR)O, Cy cn\ts2 sp\ts2/Sco; ci\ts D/ey\ts D}
% \genotype{C(1)RM, y^2/Y; In(2LR)O, Cy cn^2 sp^2/Sco; ci^D/ey^D}
% $$
%
% Consequently, \LaTeX's math mode (and especially displayed math mode,
@ -132,13 +135,12 @@ has been generated for details.
% the following code:
%
% \begin{verbatim}
% \let\ts\textsuperscript
% \genotype{C(1)RM,y\ts2/Y; In(2LR)O,Cy cn\ts2 sp\ts2/Sco; ci\ts D/ey\ts D}
% \genotype{C(1)RM, y^2/Y; In(2LR)O,Cy cn^2 sp^2/Sco; ci^D/ey^D}
% \end{verbatim}
%
% A complete genotype can thus be written in a very intuitive way, the
% only \TeX ism being the exponentiation macro, |\ts|, which is defined
% here as an alias for the |\textsuperscript| macro.
% only \TeX ism being the exponentiation character (which is redefined,
% inside the |\genotype| macro, as an alias to the |\allele| macro).
%
%
% \section{User interface}
@ -160,7 +162,7 @@ has been generated for details.
% \quad
% \virgin{cn bw/;TM2/tra}
% \quad
% \male{FM7a/Y;In(2LR)O,Cy/+}
% \male{FM7a/Y;In(2LR)O, Cy/+}
% $$
%
% The plural forms of these macros (|\females|, |\males|, and
@ -259,9 +261,26 @@ has been generated for details.
% \end{macro}
%
% \begin{macro}{\genotype}
% This macro is the main user interface to typeset a genotype.
% This macro is the main user interface to typeset a genotype. Its
% definition is a bit tricky because we redefine the \textasciicircum\ character as
% an alias to the |\allele| macro.
% \begin{macrocode}
\begingroup
\catcode`\^=\active
\gdef\genotype{%
\catcode`\^=\active%
\let^\allele%
\end@genotype}
\gdef\end@genotype#1{\FG@parsechromosome#1;\end}
\endgroup
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\allele}
% This macro typesets its argument as a superscript. It is intended to
% represent alleles of a gene.
% \begin{macrocode}
\def\genotype#1{\FG@parsechromosome#1;\end}
\def\allele#1{\hspace{.1em}\textsuperscript{#1}}
% \end{macrocode}
% \end{macro}
%


Loading…
Cancel
Save