summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pstricks/pst-tools.pro64
-rw-r--r--Master/texmf-dist/dvips/pstricks/pstricks.pro10
2 files changed, 74 insertions, 0 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/pst-tools.pro b/Master/texmf-dist/dvips/pstricks/pst-tools.pro
new file mode 100644
index 00000000000..d4dc3795266
--- /dev/null
+++ b/Master/texmf-dist/dvips/pstricks/pst-tools.pro
@@ -0,0 +1,64 @@
+% $Id: pst-tools.pro 490 2011-04-23 09:25:30Z herbert $
+%
+%% PostScript tools prologue for pstricks.tex.
+%% Version 0.01, 2011/04/23
+%%
+%% 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.
+%
+%
+%%%%% ### bubblesort ###
+%% syntax : array bubblesort --> array2 trie par ordre croissant
+%% code de Bill Casselman
+%% http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/
+/bubblesort {
+4 dict begin
+ /a exch def
+ /n a length 1 sub def
+ n 0 gt {
+ % at this point only the n+1 items in the bottom of a remain to
+ % the sorted largest item in that blocks is to be moved up into
+ % position n
+ n {
+ 0 1 n 1 sub {
+ /i exch def
+ a i get a i 1 add get gt {
+ % if a[i] > a[i+1] swap a[i] and a[i+1]
+ a i 1 add
+ a i get
+ a i a i 1 add get
+ % set new a[i] = old a[i+1]
+ put
+ % set new a[i+1] = old a[i]
+ put
+ } if
+ } for
+ /n n 1 sub def
+ } repeat
+ } if
+ a
+end
+} def
+%
+/concatstringarray{ % [(a) (b) ... (z)] --> (ab...z) 20100422
+ 0 1 index { length add } forall
+ string
+ 0 3 2 roll
+ { 3 copy putinterval length add }forall
+ pop
+} bind def
+%
+/dot2comma {% on stack a string (...)
+ 2 dict begin
+ /Output exch def
+ 0 1 Output length 1 sub {
+ /Index exch def
+ Output Index get 46 eq { Output Index 44 put } if
+ } for
+ Output
+ end
+} def
+%
+%-----------------------------------------------------------------------------%
+% END pst-tools.pro
diff --git a/Master/texmf-dist/dvips/pstricks/pstricks.pro b/Master/texmf-dist/dvips/pstricks/pstricks.pro
index ea18f469bc8..dc8abde2aee 100644
--- a/Master/texmf-dist/dvips/pstricks/pstricks.pro
+++ b/Master/texmf-dist/dvips/pstricks/pstricks.pro
@@ -995,6 +995,16 @@ end
pop
} bind def
%
+/dot2comma {% on stack a string (...)
+ 2 dict begin
+ /Output exch def
+ 0 1 Output length 1 sub {
+ /Index exch def
+ Output Index get 46 eq { Output Index 44 put } if
+ } for
+ Output
+ end
+} def
%
end
%-----------------------------------------------------------------------------%