diff options
author | Karl Berry <karl@freefriends.org> | 2013-08-02 23:22:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-08-02 23:22:03 +0000 |
commit | 3d97b842f77d38b6981e4218a5adc108fc3bb960 (patch) | |
tree | acc7ce4227797309d61417cf9e9c4e5d99a97a64 /Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx | |
parent | 3fb19fff0df84de848983022f3d16758a1f863a0 (diff) |
pgfmolbio (31jul13)
git-svn-id: svn://tug.org/texlive/trunk@31334 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx')
-rw-r--r-- | Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx b/Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx index 95c27940ce2..eb4fc315258 100644 --- a/Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx +++ b/Master/texmf-dist/source/lualatex/pgfmolbio/pgfmolbio.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2012 by Wolfgang Skala +% Copyright (C) 2013 by Wolfgang Skala % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -13,14 +13,14 @@ % \fi % % \iffalse -%<pgfmolbio-tex>\ProvidesPackage{pgfmolbio}[2012/10/01 v0.2 Molecular biology graphs with TikZ] +%<pgfmolbio-tex>\ProvidesPackage{pgfmolbio}[2013/08/01 v0.21 Molecular biology graphs with TikZ] %<pgfmolbio-tex>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<pgfmolbio-lua>module("pgfmolbio", package.seeall) -%<pmb-chr-tex>\ProvidesFile{pgfmolbio.chromatogram.tex}[2012/10/01 v0.2 SCF chromatograms] +%<pmb-chr-tex>\ProvidesFile{pgfmolbio.chromatogram.tex}[2013/08/01 v0.21 SCF chromatograms] %<pmb-chr-lua>module("pgfmolbio.chromatogram", package.seeall) -%<pmb-dom-tex>\ProvidesFile{pgfmolbio.domains.tex}[2012/10/01 v0.2 Protein domains] +%<pmb-dom-tex>\ProvidesFile{pgfmolbio.domains.tex}[2013/08/01 v0.21 Protein domains] %<pmb-dom-lua>module("pgfmolbio.domains", package.seeall) -%<pmb-con-tex>\ProvidesFile{pgfmolbio.convert.tex}[2012/10/01 v0.2 pgfmolbio graph conversion] +%<pmb-con-tex>\ProvidesFile{pgfmolbio.convert.tex}[2013/08/01 v0.21 pgfmolbio graph conversion] % %<*driver> \documentclass[captions=tableheading,cleardoublepage=empty,titlepage=false]{scrreprt} @@ -1791,8 +1791,8 @@ % You can change the format of the coordinates by the following keys: % % \DescribeOption{}{coordinate unit}{mm}<unit> -% \DescribeOption{}{coordinate format string}{\%s\%s}<format string>\relax -% \pkg{pgfmolbio} internally calculates dimensions in scaled points, but usually converts them before returning them to \TeX. To this end, it selects the \meta{unit} stored in \opt{coordinate unit} (any of the standard \TeX\ units of measurement: \texttt{bp}, \texttt{cc}, \texttt{cm}, \texttt{dd}, \texttt{in}, \texttt{mm}, \texttt{pc}, \texttt{pt} or \texttt{sp}). In addition, the package formats the dimension according to the \meta{format string} given by \opt{coordinate format string}. This string basically follows the syntax of C's \texttt{printf} function, as described in the Lua reference manual. +% \DescribeOption{}{coordinate format string}{\letterpercent s\letterpercent s}<format string>\relax +% \pkg{pgfmolbio} internally calculates dimensions in scaled points, but usually converts them before returning them to \TeX. To this end, it selects the \meta{unit} stored in \opt{coordinate unit} (any of the standard \TeX\ units of measurement: \texttt{bp}, \texttt{cc}, \texttt{cm}, \texttt{dd}, \texttt{in}, \texttt{mm}, \texttt{pc}, \texttt{pt} or \texttt{sp}). In addition, the package formats the dimension according to the \meta{format string} given by \opt{coordinate format string}. This string basically follows the syntax of C's \texttt{printf} function, as described in the Lua reference manual. (Note: Use |\letterpercent| instead of \texttt{\%}, since \TeX\ treats anything following a percent character as comment.) % % Depending on the values of \opt{coordinate unit} and \opt{coordinate format string}, dimensions will be printed in different ways (Table~\ref{tab:CoordFormat}). % @@ -2067,7 +2067,7 @@ % We introduce two package-wide keys. % \begin{macrocode} \pgfkeyssetvalue{/pgfmolbio/coordinate unit}{mm} -\pgfkeyssetvalue{/pgfmolbio/coordinate format string}{\%s\%s} +\pgfkeyssetvalue{/pgfmolbio/coordinate format string}{\letterpercent s\letterpercent s} % \end{macrocode} % Furthermore, we define two scratch token registers. Strictly speaking, the two conditionals belong to the \module{convert} module, but all modules need to know them. @@ -2149,14 +2149,16 @@ function dimToString(x) end % \end{macrocode} -% §getRange§ extracts a variable number of strings from §rangeInput§ by applying the regular expressions in its §arg§ table. §rangeInput§ contains the values of any of the \opt{... range} keys. +% §getRange§ extracts a variable number of strings from §rangeInput§ by applying the regular expressions in the table §matchStrings§, which derives from the varargs. §rangeInput§ contains the values of any of the \opt{... range} keys. % \begin{macrocode} function getRange(rangeInput, ...) if type(rangeInput) ~= "string" then return end local result = {} - for _, v in ipairs(arg) do - if type(v) ~= "string" then return end - table.insert(result, rangeInput:match(v)) + local matchStrings = table.pack(...) + for i = 1, matchStrings.n do + if type(matchStrings[i]) == "string" then + table.insert(result, rangeInput:match(matchStrings[i])) + end end return unpack(result) end |