summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/dnaseq
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dnaseq
Initial commit
Diffstat (limited to 'macros/latex/contrib/dnaseq')
-rw-r--r--macros/latex/contrib/dnaseq/DNAtest.tex35
-rw-r--r--macros/latex/contrib/dnaseq/README29
-rw-r--r--macros/latex/contrib/dnaseq/dnaseq.dtx246
-rw-r--r--macros/latex/contrib/dnaseq/dnaseq.ins6
-rw-r--r--macros/latex/contrib/dnaseq/dnaseq.pdfbin0 -> 219163 bytes
5 files changed, 316 insertions, 0 deletions
diff --git a/macros/latex/contrib/dnaseq/DNAtest.tex b/macros/latex/contrib/dnaseq/DNAtest.tex
new file mode 100644
index 0000000000..d3478c65bb
--- /dev/null
+++ b/macros/latex/contrib/dnaseq/DNAtest.tex
@@ -0,0 +1,35 @@
+\documentclass[a4paper]{book}
+\usepackage{dnaseq}
+ \begin{document}
+\noindent\begin{minipage}{100pt}
+
+\noindent\rule{\textwidth}{.5pt}
+\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+FDSAIOFDSA !
+\end{minipage}
+
+\noindent\begin{minipage}{200pt}
+\noindent\rule{\textwidth}{.5pt}
+\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+FDSAIOFDSA !
+\end{minipage}
+
+\noindent\begin{minipage}{\textwidth}
+\noindent\rule{\textwidth}{.5pt}
+\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+FDSAIOFDSA !
+\end{minipage}
+\end{document}
+
diff --git a/macros/latex/contrib/dnaseq/README b/macros/latex/contrib/dnaseq/README
new file mode 100644
index 0000000000..e4036687e7
--- /dev/null
+++ b/macros/latex/contrib/dnaseq/README
@@ -0,0 +1,29 @@
+To install:
+
+run
+ latex dnaseq.ins
+
+To generate the documentation:
+
+run
+ latex dnaseq.dtx
+if your dvi-viewer can not do color specials (e.g. xdvi),
+convert to postscript:
+ dvips dnaseq
+
+or run:
+ pdflatex dnaseq.dtx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/macros/latex/contrib/dnaseq/dnaseq.dtx b/macros/latex/contrib/dnaseq/dnaseq.dtx
new file mode 100644
index 0000000000..e1bc755186
--- /dev/null
+++ b/macros/latex/contrib/dnaseq/dnaseq.dtx
@@ -0,0 +1,246 @@
+% \iffalse
+%% File: dnaseq.dtx Copyright (C) 2002 Bjoern Pedersen
+%% mailto:Bjoern.Pedersen@ch.tum.de
+%% This file may be distributed and used freely under
+%% the Latex Project Public License
+%%
+%
+%<*dtx>
+ \ProvidesFile{dnaseq.dtx}[2002/05/20 v0.01 dna sequence setter]
+%</dtx>
+%<dnaseq>\NeedsTeXFormat{LaTeX2e}
+%<dnaseq>\ProvidesPackage{dnaseq}[2002/05/20 v0.01 dna sequence setter]
+%<dnaseq>\RequirePackage{color}
+%<driver>\ProvidesFile{dnaseq.drv}
+% \fi
+%\iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{dnaseq}
+\begin{document}
+\DocInput{dnaseq.dtx}
+\end{document}
+%</driver>
+%\fi
+% \GetFileInfo{dnaseq.dtx}
+% \title{The \textsf{dnaseq} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{Bj{\o}rn Pedersen}
+% \date{\filedate}
+% \maketitle
+% \CheckSum{154}
+%
+%\section{Introduction}
+%\label{sec:intro}
+
+%This package allows easy setting of simple dna-sequences in
+%userdefined grouping, with numbering of bases (at the begin of
+%each line.
+%
+%If you need to typeset alignments, have a look at the
+%\texttt{texshade}-Package.
+%
+% The main code has been posted by Andreas Matthias
+% \texttt{<amat@kabsi.at>} on \texttt{de.comp.text.tex} and is based
+% by itself on old code from Anselm Lingnau.
+%\section{Usage}
+%\label{sec:usage}
+%
+%\subsection{DNA}
+%\DescribeMacro{\DNA}
+%\verb|\DNA| is the main macro of this package. It is used as
+%following:
+%\begin{verbatim}
+%\DNA! actctgctagtcgatgcat!
+%\end{verbatim}
+%where the delimiting character \verb|!| can be any normal character.
+%
+%Within the argument you can use \verb|'{<color>}| to change the color
+%of your bases. The color names are normal color.sty names.
+%Look at the full example for more info.
+%
+%\subsection{Configuration}
+%
+%\DescribeMacro{\DNAblock}The macro \verb|\DNAblock| stores the desired blocking intervall of
+%your sequence. Just do a \verb|\renewcommand{\DNAblock}{<some number>}|
+%to change the default of 10.
+%
+%\DescribeMacro{\DNAreserve}The macro defines how much space to reserve
+%for the numbering of bases.
+%To change, do a \verb|\renewcommand{\DNAreserve}{<template>}| The
+%default template is \verb|0000| allowing for for digit numbering.
+%
+%\section{Example}
+%\label{sec:ex}
+%
+%\begin{verbatim}
+%\noindent\begin{minipage}{100pt}
+%
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\noindent\begin{minipage}{200pt}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\noindent\begin{minipage}{\textwidth}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\renewcommand{\DNAblock}{5}
+%\noindent\begin{minipage}{\textwidth}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%\end{verbatim}
+%\noindent\begin{minipage}{100pt}
+%
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\noindent\begin{minipage}{200pt}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\noindent\begin{minipage}{\textwidth}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\renewcommand{\DNAblock}{5}
+%\noindent\begin{minipage}{\textwidth}
+%\noindent\rule{\textwidth}{.5pt}
+%\DNA! ACGT'{red}A CGT'{white}TGCA'{green}x s df'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}TGCA'{green}x sdf '{white}FJKDSLAF
+%DSAIOFDSA AC GT'{red}ACGT'{white}TG CA'{green}xsdf'{white}FJKD SLAF
+%DSAIOFDSA ACGT'{red}ACGT'{white}T GCA'{green} xs df'{white}FJKDSLA
+%FDSAIOFDSA ACGT'{red}AC GT'{white}TGCA'{green}xsdf'{white}FJK DSLA
+%FDSAIOFDSA !
+%\end{minipage}
+%
+%\StopEventually
+%
+%\section{The code}
+%<*dnaseq>
+% \begin{macrocode}
+\def\DNAblock{10}
+\def\DNAreserve{0000}% für 4-stellige Zahlen
+%%
+%% registers /counters
+%%
+\newlength\bl@cklen
+\newlength\l@neln
+\newlength\t@mpln
+\newlength\ch@rwd
+\newcount{\blocks}
+%%
+%% calculate blocks per line
+%%
+\def\DNAc@lcline{%
+ \settowidth{\ch@rwd}{A}
+ \setlength{\bl@cklen}{\DNAblock\ch@rwd}%
+ \settowidth{\t@mpln}{\DNAreserve}
+ \setlength{\l@neln}{\textwidth}
+ \addtolength{\l@neln}{-\t@mpln}
+ \loop%
+ \setlength{\t@mpln}{\blocks\bl@cklen}
+ \addtolength{\t@mpln}{\blocks\ch@rwd}
+ \ifdim\l@neln>\t@mpln\advance\blocks by 1
+ \repeat
+ \advance\blocks by -1
+ \ifnum\blocks<1\errmessage{line too short for 1 block^^J}%
+ \else\expandafter\message\expandafter{Blocks per line: \the\blocks^^J}\fi%
+}
+
+%% main user macro
+\def\DNA#1{%
+ \def\@DNA@end{#1}\bgroup\ttfamily\DNAc@lcline
+ \settoheight\dimen@{I}\advance\dimen@ by 1pt
+ \edef\htst{\the\dimen@}%
+ \def\struty{\rule[-.5pt]{\z@}{\htst}}%
+ %% dnabase per line counter
+ \count@=0
+ %% block counter
+ \@tempcnta=0
+ %% total dnabase counter
+ \@tempcntb=0
+ \fboxrule=0pt \fboxsep=0pt
+ \noindent\phantom{\DNAreserve}\llap 1\
+ \@DNA
+}
+
+\def\@DNA@color{'}
+\def\@DNA@thecolor{white}
+\def\@DNA@setcolor#1{\def\@DNA@thecolor{#1}\@DNA}
+%% do the blocking/line breaking
+\def\@DNA#1{%
+%% insert a space after \DNAblock bases
+ \ifnum\count@=\DNAblock\count@=0\ %
+ \advance\@tempcnta by 1\fi
+ \def\@DNA@cmp{#1}%
+%% check for end of sequence or color shift
+ \ifx\@DNA@cmp\@DNA@end
+ \let\next\egroup
+ \else
+ \ifx\@DNA@cmp\@DNA@color
+ \let\next\@DNA@setcolor
+ \else
+ \advance\count@ by 1
+ \advance\@tempcntb by 1
+%% line break after calculated number of blocks
+ \ifnum\@tempcnta=\blocks \\
+ \hskip\z@\phantom{\DNAreserve}\llap {\the\@tempcntb}\ %
+ \@tempcnta=0
+ \fi
+ \colorbox{\@DNA@thecolor}{\struty#1}%
+ \penalty0\let\next\@DNA
+ \fi
+ \fi
+ \next
+}
+% \end{macrocode}
+%</dnaseq>
+% \Finale
diff --git a/macros/latex/contrib/dnaseq/dnaseq.ins b/macros/latex/contrib/dnaseq/dnaseq.ins
new file mode 100644
index 0000000000..eea3441301
--- /dev/null
+++ b/macros/latex/contrib/dnaseq/dnaseq.ins
@@ -0,0 +1,6 @@
+%% DocStrip driver for dnaseq
+\input docstrip
+\askonceonly
+\generate{\file{dnaseq.sty}{\from{dnaseq.dtx}{dnaseq}}
+}
+\endbatchfile
diff --git a/macros/latex/contrib/dnaseq/dnaseq.pdf b/macros/latex/contrib/dnaseq/dnaseq.pdf
new file mode 100644
index 0000000000..be97499f87
--- /dev/null
+++ b/macros/latex/contrib/dnaseq/dnaseq.pdf
Binary files differ