Browse Source

Add the FGChromosome macro

develop
Damien Goutte-Gattat 8 years ago
parent
commit
2d5e473a7d
1 changed files with 30 additions and 4 deletions
  1. +30
    -4
      flygenet.dtx

+ 30
- 4
flygenet.dtx View File

@ -227,8 +227,34 @@ has been generated for details.
% \end{macrocode}
%
%
% \subsection{Helper macros}
%
% \begin{macro}{\FG@mbox}
% This macro is intended to be used in math mode. It typesets its
% argument as normal, italicized text. The rationale behind this macro
% is that we need a |\mbox| to prevent LaTeX from applying math mode
% rules when parsing genotypes (regarding spacing and special
% characters); but |\mbox| alone also prevent the automatic sizing of
% the text depending on its location within a math expression.
% \begin{macrocode}
\def\FG@mbox#1{\mathchoice%
{\mbox{\normalsize\itshape #1}}%
{\mbox{\normalsize\itshape #1}}%
{\mbox{\scriptsize\itshape #1}}%
{\mbox{\scriptsize\itshape #1}}}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Typesetting chromosomes}
%
% \begin{macro}{\FGChromosome}
% This macro typesets a single chromosome.
% \begin{macrocode}
\def\FGChromosome#1{\ifmmode\mbox{\itshape #1}\else{\itshape #1}\fi}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\FGXYPair}
% This macro typesets a Y chromosome genotype. It is intended to look
% like a half-fraction, with the genotype as the numerator and without a
@ -240,12 +266,12 @@ has been generated for details.
% \begin{macrocode}
\def\FG@XYPair@display#1{%
\tikz{%
\node[inner sep=.9ex] (y) {\raisebox{0pt}[\height][0pt]{$\displaystyle\mathit{#1}$}};
\node[inner sep=.9ex] (y) {\raisebox{0pt}[\height][0pt]{\normalsize\itshape #1}};
\draw[line cap=round] (y.south west) -- (y.south east) -- ++(-0.1,-0.1);
}}
\def\FG@XYPair@inline#1{%
\tikz{%
\node[inner sep=.3ex] (y) {\raisebox{0pt}[\height][0pt]{$\scriptstyle\mathit{#1}$}};
\node[inner sep=.3ex] (y) {\raisebox{0pt}[\height][0pt]{\scriptsize\itshape #1}};
\draw[line cap=round] (y.south west) -- (y.south east) -- ++(-0.1,-0.1);
}}
% \end{macrocode}
@ -272,9 +298,9 @@ has been generated for details.
% \begin{macrocode}
\def\FGChrPair#1#2{%
\def\FG@argii{#2}%
\ifx\FG@argii\empty\mathit{#1}\else%
\ifx\FG@argii\empty\FGChromosome{#1}\else%
\if\FG@argii Y\FGXYPair{#1}\else%
\frac{\mathit{#1}}{\mathit{#2}}%
\frac{\FG@mbox{#1}}{\FG@mbox{#2}}%
\fi%
\fi}
% \end{macrocode}


Loading…
Cancel
Save