From 9c285fb487bdb507e481b5c0592be3348a2c44e7 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 6 Jan 2010 01:39:32 +0000
Subject: new pstricks/latex package pst-exa (5jan10)

git-svn-id: svn://tug.org/texlive/trunk@16615 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty | 97 +++++++++++++++++++++++++
 1 file changed, 97 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty

(limited to 'Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty')

diff --git a/Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty b/Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty
new file mode 100644
index 00000000000..1fec2902c89
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pst-exa/pst-exa.sty
@@ -0,0 +1,97 @@
+% $Id: pst-exa.sty 239 2010-01-01 17:23:13Z herbert $
+%% BEGIN pst-exa.tex
+%%
+%% Code and image side by side or on top of
+%% each other with PSTricks.
+%%
+%% COPYRIGHT 2010 by Herbert Voss, hvoss tug.org.
+%%
+%% 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.
+%%
+%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{graphicx}
+\RequirePackage{listings}
+\RequirePackage{pst-xkey}
+\def\fileversion{0.01}
+\def\filedate{2010/01/01}
+%
+\ProvidesPackage{pst-exa}[\filedate\ v\fileversion\ PSTricks example code (hv)]
+
+\lstset{basicstyle=\ttfamily\footnotesize,numbers=left,numbersep=0.5pt,
+    xleftmargin=1em,
+    numberstyle=\tiny,breaklines,
+    language=PSTricks}
+\pst@addfams{pst-exa}
+\define@key[psset]{pst-exa}{pos}[l]{%
+  \ifx#1l\def\psk@exa@pos{0}
+  \else
+    \ifx#1r\def\psk@exa@pos{1}
+    \else
+      \ifx#1b\def\psk@exa@pos{2}
+      \else  \def\psk@exa@pos{3}
+  \fi\fi\fi}
+\psset[pst-exa]{pos=l}
+\define@key[psset]{pst-exa}{halign}[c]{\def\psk@exa@halign{#1}}
+\psset[pst-exa]{halign=c}
+\define@key[psset]{pst-exa}{valign}[c]{\def\psk@exa@valign{#1}}
+\psset[pst-exa]{valign=c}
+\define@key[psset]{pst-exa}{frame}[{}]{\def\psk@exa@frame{#1}}
+\psset[pst-exa]{frame=}
+\newlength\pst@exa@width
+\define@key[psset]{pst-exa}{width}[0.5\linewidth]{\pssetlength\pst@exa@width{#1}}
+\psset[pst-exa]{width=0.5\linewidth}
+\newlength\pst@exa@sep
+\define@key[psset]{pst-exa}{sep}[1em]{\pssetlength\pst@exa@sep{#1}}
+\psset[pst-exa]{sep=1em}
+%
+\def\PSTfilename@i#1.#2.#3\@nil{\xdef\PSTfilename{#1.#2.tex}}%
+%
+\providecommand\IncludeGraphics[2][]{}
+\renewcommand\IncludeGraphics[2][]{%
+  \expandafter\PSTfilename@i#2\@nil%
+  \includegraphics[#1]{#2}}
+%
+\newenvironment{PSTexample}[1][]
+  {\par\noindent\psset{#1}%
+   \begin{lrbox}{\pst@hbox}}
+  {\end{lrbox}%
+   \ifcase\psk@exa@pos 
+     \minipage{\pst@exa@width}%
+     \ifdim\wd\pst@hbox<\linewidth\usebox\pst@hbox%
+     \else\resizebox{\linewidth}{!}{\usebox\pst@hbox}\fi
+     \endminipage\kern\pst@exa@sep%
+     \pst@dimm=\linewidth%
+     \advance\pst@dimm by -\pst@exa@width%
+     \advance\pst@dimm by -\pst@exa@sep%
+     \minipage{\pst@dimm}%
+       \lstinputlisting[includerangemarker=false,firstnumber=1,
+                    linerange=\\begin\{document\}-\\end\{document\}]{\PSTfilename}
+    \endminipage%
+  \or
+     \pst@dimm=\linewidth%
+     \advance\pst@dimm by -\pst@exa@width
+     \advance\pst@dimm by -\pst@exa@sep
+     \minipage{\pst@dimm}%
+       \lstinputlisting[includerangemarker=false,firstnumber=1,
+                    linerange=\\begin\{document\}-\\end\{document\}]{\PSTfilename}
+    \endminipage\kern\pst@exa@sep%
+    \minipage{\pst@exa@width}%
+    \ifdim\wd\pst@hbox<\linewidth\usebox\pst@hbox%
+    \else\resizebox{\linewidth}{!}{\usebox\pst@hbox}\fi
+    \endminipage
+  \or
+       \lstinputlisting[includerangemarker=false,firstnumber=1,
+                    linerange=\\begin\{document\}-\\end\{document\}]{\PSTfilename}
+    \par\vskip\pst@exa@sep%
+    \usebox\pst@hbox\par
+  \or
+    \usebox\pst@hbox\par
+    \vskip\pst@exa@sep%
+       \lstinputlisting[includerangemarker=false,firstnumber=1,
+                    linerange=\\begin\{document\}-\\end\{document\}]{\PSTfilename}\par
+  \fi}
+%
+\endinput
\ No newline at end of file
-- 
cgit v1.2.3

