diff options
author | Karl Berry <karl@freefriends.org> | 2017-10-02 21:58:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-10-02 21:58:12 +0000 |
commit | f3d0235a07baa8c6f8430bddcaa95ba3ad6de5ee (patch) | |
tree | b3b2a6d4460d6a5f5c75e4a314db604a8cc705df /Master | |
parent | 08f4fdc740a25d49aa543ac6694453cd84aacfd4 (diff) |
pst-tools (1oct17)
git-svn-id: svn://tug.org/texlive/trunk@45451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-tools/Changes | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-tools/README | 11 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf | bin | 80617 -> 99637 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex | 61 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex | 16 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty | 6 |
6 files changed, 82 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-tools/Changes b/Master/texmf-dist/doc/generic/pst-tools/Changes index f6e774fbe38..d9f2277fe93 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/Changes +++ b/Master/texmf-dist/doc/generic/pst-tools/Changes @@ -1,4 +1,5 @@ ..... pst-tools.tex +0.08 2017-10-02 - new macro \psGetElement 0.07 2017-08-23 - use always URW fonts instead of PostScript, eg Helvetica-NimbusSanL 0.06 2017-05-12 - added style mmpaper 0.05 2014-05-12 - new optional arguments for printing values diff --git a/Master/texmf-dist/doc/generic/pst-tools/README b/Master/texmf-dist/doc/generic/pst-tools/README index e25e9ec1b92..eea7ff0347c 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/README +++ b/Master/texmf-dist/doc/generic/pst-tools/README @@ -1,6 +1,6 @@ pst-tools: helper functions --- psPrintValue - +-- psPrintValue on PostScript level +-- \psGetElement of a comma separated list Save the files pst-tools.sty|pro|tex in a directory, which is part of your local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ @@ -10,11 +10,16 @@ on installing packages into your local TeX system or read the TeX Frequently Asked Questions: (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). -pst-func needs pst-plot (pstricks-add) and pstricks, which should +pst-tools needs pst-plot (pstricks-add) and pstricks, which should be part of your local TeX installation, otherwise get it from a CTAN server, http://mirror.ctan.org PSTricks is PostScript Tricks, the documentation cannot be run with pdftex, use the sequence latex->dvips->ps2pdf. +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. + + %% $Id: README 286 2010-02-11 09:40:41Z herbert $ diff --git a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf Binary files differindex 2a2b9490ecc..42823552b56 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex index 7202cec324d..17db1dd5597 100644 --- a/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-tools/pst-tools-doc.tex @@ -1,21 +1,23 @@ -%% $Id: pst-tools-doc.tex 527 2017-08-23 14:14:45Z herbert $ +%% $Id: pst-tools-doc.tex 607 2017-10-02 17:56:55Z herbert $ \documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false, smallheadings, headexclude,footexclude,oneside]{pst-doc} \usepackage[utf8]{inputenc} \usepackage{pst-tools} \let\pstToolsFV\fileversion -\usepackage{ltablex} +\usepackage{xltabular} +\usepackage{pst-plot} \renewcommand\bgImage{} \lstset{language=PSTricks, morekeywords={psPrintValue},basicstyle=\footnotesize\ttfamily} % +\usepackage{biblatex} \addbibresource{pst-tools-doc.bib} \begin{document} \title{\texttt{pst-tools}} \subtitle{Helper functions; v.\pstToolsFV} -\author{Herbert Vo\ss} +\author{Herbert Voß} \docauthor{} \date{\today} \maketitle @@ -56,7 +58,7 @@ space. There are the following valid options for \Lcs{psPrintValue}: \noindent\medskip -\begin{tabularx}{\linewidth}{@{}l|>{\ttfamily}l>{\ttfamily}lX@{}} +\begin{xltabular}{\linewidth}{@{}l|>{\ttfamily}l>{\ttfamily}lX@{}} \textrm{name} & \textrm{value} & \textrm{default}\\\hline \endhead \Lkeyword{PSfont} & PS font name & Times & only valid \PS\ font names are possible, e.g. @@ -74,7 +76,7 @@ may vary on different operating systems.\\ \Lkeyword{algebraic} & <boolean> & false & function in algebraic notation.\\ \Lkeyword{VarName} & <string> & \{\} & saves the value in /<VarName> for further use\\ \Lkeyword{comma} & <boolean> & false & comma instead of the dor for decimals\\ -\end{tabularx} +\end{xltabular} \begin{center} \psset{fontscale=12} @@ -157,6 +159,39 @@ foo \makebox[3.5em][l]{\psPrintValue[PSfont=StandardSymL,decimals=6, +\section{\nxLcs{psGetElement}}\label{sec:getElement} +The macro returns the n-th Element of a comma separated list into the +user definied Macro \Lcs{\Larga{Element}}. + +\begin{BDef} +\Lcs{psGetElement}\Largb{Index}\Largb{value list}\nxLcs{\Larga{Element}}\\ +\end{BDef} + + +\begin{lstlisting} +\def\ColorList{,violet,blue,green,red}% Index starts at 0 +\begin{pspicture}(-7,-4)(7,5) +\psaxes(0,0)(-6.5,-4)(6.5,5) +\psset{plotpoints=400,algebraic} +\psforeach{\iA}{1,2,3,4}{% + \psGetElement{\iA}{\ColorList}\foo + \psplot[linecolor=\foo]{-6.28}{6.28}{\iA*sin(\iA*x)}} +\end{pspicture} +\end{lstlisting} + +\def\ColorList{,violet,blue,green,red}% Index starts at 0 +\begin{pspicture}(-7,-4)(7,5) +\psaxes(0,0)(-6.5,-4)(6.5,5) +\psset{plotpoints=400,algebraic} +\psforeach{\iA}{1,2,3,4}{% + \psGetElement{\iA}{\ColorList}\foo + \psplot[linecolor=\foo]{-6.28}{6.28}{\iA*sin(\iA*x)}} +\end{pspicture} + + + + + @@ -181,4 +216,18 @@ foo \makebox[3.5em][l]{\psPrintValue[PSfont=StandardSymL,decimals=6, \end{document} - +\def\psGetElement#1#2{% #1 natural number; #2 comma separated list + \pst@cnto=0\relax + \pst@cntp=#1\relax + \expandafter\psGetElement@i#2,,\@nil +} +\iftrue +\def\psGetElement@i#1,#2,#3\@nil{% + \ifnum\the\pst@cnto<\pst@cntp\relax + \advance\pst@cnto by \@ne + \def\ps@next{\psGetElement@i#2,#3\@nil}% + \else + \def\ps@next{#1}% + \fi + \ps@next +} diff --git a/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex index 3c7ec247a90..494b9e16efd 100644 --- a/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex +++ b/Master/texmf-dist/tex/generic/pst-tools/pst-tools.tex @@ -1,4 +1,4 @@ -%% $Id: pst-tools.tex 527 2017-08-23 14:14:45Z herbert $ +%% $Id: pst-tools.tex 606 2017-10-02 17:34:18Z herbert $ %% %% This is file `pst-tools.tex', %% @@ -26,8 +26,8 @@ % interface to the `xkeyval' package \pst@addfams{pst-tools} % -\def\fileversion{0.07} -\def\filedate{2017/08/23} +\def\fileversion{0.08} +\def\filedate{2017/10/02} \message{`PST-tools' v\fileversion, \filedate\space (hv)} % \define@key[psset]{pst-tools}{decimalSeparator}[.]{\def\psk@decimalSeparator{#1}}% @@ -122,6 +122,16 @@ \end@SpecialObj } % +\def\psGetElement#1#2#3{% #1 index; #2 comma separated list; #3: Element as macro + \pst@cnto=\number#1 + \@for\pst@tempA:=#2\do{% + \ifnum\pst@cnto=0 % + \edef#3{\pst@tempA}% + \fi + \advance\pst@cnto by -1 + }% +} + \catcode`\@=\PstAtCode\relax % %% END: pst-tools.tex diff --git a/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty b/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty index ec192f26741..48b51cfa51f 100644 --- a/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty +++ b/Master/texmf-dist/tex/latex/pst-tools/pst-tools.sty @@ -4,5 +4,9 @@ \input{pst-tools.tex} \ProvidesFile{pst-tools.tex} [\filedate\space v\fileversion\space `PST-tools' (hv)] +\IfFileExists{pst-tools.pro}{% + \ProvidesFile{pst-tools.pro}[2013/10/26 v 0.04, PostScript prologue file] + \@addtofilelist{pst-tools.pro}}{}% + \endinput -%% $Id: pst-tools.sty 456 2017-05-12 19:35:55Z herbert $ +%% $Id: pst-tools.sty 606 2017-10-02 17:34:18Z herbert $ |