summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-14 22:29:37 +0000
committerKarl Berry <karl@freefriends.org>2011-09-14 22:29:37 +0000
commitd5f1327ab362980bce84f768fab6f93842e93bd1 (patch)
treed60ee0ab368925f240f08d363c1977f63095974a /Master/texmf-dist
parent7049f2efeb82a0814580c606b16d7eeb3032aa9b (diff)
statex2 (14sep11)
git-svn-id: svn://tug.org/texlive/trunk@23961 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/statex2/statex2-example.pdfbin177305 -> 175639 bytes
-rw-r--r--Master/texmf-dist/doc/latex/statex2/statex2-example.tex23
-rw-r--r--Master/texmf-dist/tex/latex/statex2/statex2.sty80
3 files changed, 58 insertions, 45 deletions
diff --git a/Master/texmf-dist/doc/latex/statex2/statex2-example.pdf b/Master/texmf-dist/doc/latex/statex2/statex2-example.pdf
index f4b2787f190..2553881f28c 100644
--- a/Master/texmf-dist/doc/latex/statex2/statex2-example.pdf
+++ b/Master/texmf-dist/doc/latex/statex2/statex2-example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/statex2/statex2-example.tex b/Master/texmf-dist/doc/latex/statex2/statex2-example.tex
index 6c7c59b7e3c..c640bbefcc1 100644
--- a/Master/texmf-dist/doc/latex/statex2/statex2-example.tex
+++ b/Master/texmf-dist/doc/latex/statex2/statex2-example.tex
@@ -1,10 +1,6 @@
\documentclass[dvipsnames,usenames]{report}
%\documentclass[dvipsnames,usenames,autobold]{report}
\usepackage{statex2}
-
-% fix bug in statex2.sty
-\DeclareRobustCommand*{\deriv}[2]{\mb{\frac{\d{}}{\d #1}}\wrap{\mb{#2}}}
-
\usepackage{shortvrb}
\MakeShortVerb{@}
% Examples
@@ -26,12 +22,20 @@ Sometimes overline is better: @\b{x} \vs \ol{x}@ $$\b{x} \vs \ol{x}$$
And, underlines are nice too: @\ul{x}@ $$\ul{x}$$
-A few other nice-to-haves:
+Derivatives and partial derivatives:
-@\chisq@ $$\chisq$$
@\deriv{x}{x^2+y^2}@ $$\deriv{x}{x^2+y^2}$$
@\pderiv{x}{x^2+y^2}@ $$\pderiv{x}{x^2+y^2}$$
+Or, rather, in the order of @\frac@:
+
+@\derivf{x^2+y^2}{x}@ $$\derivf{x^2+y^2}{x}$$
+@\pderivf{x^2+y^2}{x}@ $$\pderivf{x^2+y^2}{x}$$
+
+A few other nice-to-haves:
+
+@\chisq@ $$\chisq$$
+
@\Gamma[n+1]=n!@ $$\Gamma[n+1]=n!$$
@\binom{n}{x}@ $$\binom{n}{x}$$ %provided by amsmath package
@@ -155,7 +159,7 @@ Binomial Distribution
@X ~ \Bin{n}{p}@ $$X ~ \Bin{n}{p}$$
-@\pBin{n}{p}@ $$\pBin{n}{p}$$
+%@\pBin{n}{p}@ $$\pBin{n}{p}$$
Bernoulli Distribution
@@ -165,7 +169,7 @@ Beta-Binomial Distribution
@X ~ \BB{p}@ $$X ~ \BB{p}$$
-@\pBB{n}{\alpha}{\beta}@ $$\pBB{n}{\alpha}{\beta}$$
+%@\pBB{n}{\alpha}{\beta}@ $$\pBB{n}{\alpha}{\beta}$$
Negative-Binomial Distribution
@@ -179,7 +183,7 @@ Poisson Distribution
@X ~ \Poi{\mu}@ $$X ~ \Poi{\mu}$$
-@\pPoi{\mu}@ $$\pPoi{\mu}$$
+%@\pPoi{\mu}@ $$\pPoi{\mu}$$
Dirichlet Distribution
@@ -225,3 +229,4 @@ Suppose @A@ is $\alpha$ and @T@ is the number of tails. To run the program:\\
2\Enter\\
@1.959963986@
\end{document}
+
diff --git a/Master/texmf-dist/tex/latex/statex2/statex2.sty b/Master/texmf-dist/tex/latex/statex2/statex2.sty
index 789aa6d198d..74c085d48bb 100644
--- a/Master/texmf-dist/tex/latex/statex2/statex2.sty
+++ b/Master/texmf-dist/tex/latex/statex2/statex2.sty
@@ -1,7 +1,7 @@
%%
%% This is file `statex2.sty'.
%%
-%% Copyright (C) 2008 by Rodney A Sparapani <rsparapa@mcw.edu>
+%% Copyright (C) 2008-2011 by Rodney A Sparapani <rsparapa@mcw.edu>
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
@@ -14,7 +14,7 @@
%% version 1999/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{statex}[2008/05/06 v2.0 a statistics style for latex]
+\ProvidesPackage{statex2}[2011/09/14 v2.1 a statistics style for latex]
\RequirePackage{ifthen}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
@@ -40,6 +40,9 @@
%option(s);
%autobold: presentations look better and now easier to create;
+%\let\usc@dischyph\@dischyph
+%\DeclareOption{nohyphen}{\def\usc@dischyph{\discretionary{}{}{}}}
+
\newif\if@manualbold
\DeclareOption{manualbold}{\@manualboldtrue}
\DeclareOption{autobold}{\@manualboldfalse}
@@ -65,7 +68,8 @@
\DeclareRobustCommand*{\trace}{\mb{\mathrm{trace}}}
\DeclareRobustCommand*{\chisq}{\ifmmode\mb{\chi^2}\else$\mb{\chi^2}$\fi}
-\DeclareRobustCommand*{\deriv}[2]{\mb{\frac{\d}{\d #1}}\wrap{\mb{#2}}}
+\DeclareRobustCommand*{\deriv}[2]{\mb{\frac{\d{}}{\d{#1}}}\wrap{\mb{#2}}}
+\DeclareRobustCommand*{\derivf}[2]{\mb{\frac{\d{}}{\d{#2}}}\wrap{\mb{#1}}}
\DeclareRobustCommand*{\e}[1]{\mb{\mathrm{e}^{#1}}}
\DeclareRobustCommand*{\E}[2][]{\mb{\mathrm{E}}\ifthenelse{\equal{#1}{}}{}{_{\mb{#1}}} \wrap{\mb{#2}}}
\DeclareRobustCommand*{\ha}{{\mb{\frac{\alpha}{2}}}}
@@ -76,12 +80,12 @@
\DeclareRobustCommand*{\ol}{\overline}
\DeclareRobustCommand*{\ow}{\;\mb{\mathrm{otherwise}}\;}
\DeclareRobustCommand*{\pderiv}[2]{\mb{\frac{\partial}{\partial #1}}\wrap{\mb{#2}}}
+\DeclareRobustCommand*{\pderivf}[2]{\mb{\frac{\partial}{\partial #2}}\wrap{\mb{#1}}}
\DeclareRobustCommand*{\sd}{\mb{\sigma}}
\DeclareRobustCommand*{\ul}{\underline}
\DeclareRobustCommand*{\V}[2][]{\mb{\mathrm{V}}\ifthenelse{\equal{#1}{}}{}{_{\mb{#1}}} \wrap{\mb{#2}}}
\DeclareRobustCommand*{\vs}{\;\mb{\mathrm{vs.}}\;}
\DeclareRobustCommand*{\where}{\;\mb{\mathrm{where}}\;}
-
\DeclareRobustCommand*{\wrap}[2][]%
{\ifthenelse{\equal{#1}{}}{\left[ #2 \right]}%
{\ifthenelse{\equal{#1}{()}}{\left( #2 \right)}%
@@ -95,8 +99,6 @@
%\newcommand*{\xy}{{xy}}
%\newcommand*{\XY}{{XY}}
%\newcommand*{\n}[1][]{_{n #1}}
-
-%two old examples of tex commands
%\def\bp(#1){\left(#1\right)}
%\def~{\relax\ifmmode\sim\else\nobreakspace{}\fi}
@@ -141,18 +143,18 @@
%probability mass functions
\DeclareRobustCommand*{\pBB}[4][x]{\mb{\frac{\Gamma[#2+1]\Gamma[#3+#1]\Gamma[#2+#4-#1]\Gamma[#3+#4]}%
-{\Gamma[#1+1]\Gamma[#2-#1+1]\Gamma[#2+#3+#4]\Gamma[#3]\Gamma[#4]}}%
-\I[\mb{#1}]{\mb{\{0, 1,\., #2\}}}\mb{, \where #3>0,\; #4>0 \and n=1, 2,\.}}
-\DeclareRobustCommand*{\pBin}[3][x]{\binom{\mb{#2}}{\mb{#1}}\mb{#3^#1}%
-\wrap[()]{\mb{{1-#3}}}^{\mb{#2-#1}}%
-\I[\mb{#1}]{\mb{\{0,1,\.,#2\}}}\mb{, \where p \in (0, 1) \and n=1, 2,\.}}
-\DeclareRobustCommand*{\pPoi}[2][x]{\mb{\frac{1}{#1!}#2^{#1}\e{-#2}}\I[\mb{#1}]{\mb{\{0, 1,\.\}}}\mb{, \where #2>0}}
+{\Gamma[#1+1]\Gamma[#2-#1+1]\Gamma[#2+#3+#4]\Gamma[#3]\Gamma[#4]}%
+\I[#1]{\{0, 1,\., #2\}}, \where #3>0,\; #4>0 \and n=1, 2,\.}}
+\DeclareRobustCommand*{\pBin}[3][x]{\mb{\binom{#2}{#1}#3^#1} \wrap[()]{\mb{{1-#3}^{#2-#1}}}%
+\mb{\I[#1]{\{0,1,\.,#2\}}, \where p \in (0, 1) \and n=1, 2,\.}}
+\DeclareRobustCommand*{\pPoi}[2][x]{\mb{\frac{1}{#1!}#2^{#1}\e{-#2}\I[#1]{\{0, 1,\.\}}, \where #2>0}}
%%Continuous distributions
%declarations
\DeclareRobustCommand*{\Cau}[2]{\mb{\mathrm{Cauchy}}\wrap[()]{\mb{#1,\ #2}}}
\let\Cauchy=\Cau
\DeclareRobustCommand*{\Chi}[2][]{\chisq\ifthenelse{\equal{#1}{}}{}{_\mb{#1}}\wrap[()]{\mb{#2}}}
+%\DeclareRobustCommand*{\Chi}[1]{\chisq\wrap[()]{\mb{#1}}}
\let\Chisq=\Chi
\DeclareRobustCommand*{\Bet}[2]{\mb{\mathrm{Beta}}\wrap[()]{\mb{#1,\ #2}}}
\let\Beta=\Bet
@@ -176,25 +178,23 @@
\else\expandafter\STATEXt{#1}\fi}
%probability density functions
-\DeclareRobustCommand*{\pBet}[3][x]{\IBeta{#2}{#3}\mb{#1^{#2-1}}%
-\wrap[()]{\mb{1-#1}}^{\mb{#3-1}}\I[\mb{#1}]{\mb{0,\ 1}}\mb{, \where #2>0 \and #3>0}}
-\DeclareRobustCommand*{\pCau}[3][x]{\ifthenelse{\equal{#2, #3}{0, 1}}%
-{\frac{\mb{1}}{\mb{\cpi}\wrap[()]{\mb{1+#1}}^{\mb{2}}}}%
-{\frac{\mb{1}}{\mb{#3\cpi}\wrap{\mb{1+}\wrap[()]{\mb{\frac{x-#2}{#3}}}^{\mb{2}}}}%
-\mb{, \where #3>0}}}
-\DeclareRobustCommand*{\pChi}[2][x]{\mb{\frac{2^{-\frac{#2}{2}}}{\Gamma[\frac{#2}{2}]}#1^{\frac{#2}{2}-1}\e{-\frac{#1}{2}}}%
-\I[\mb{#1}]{\mb{0,\infty}}\mb{, \where #2>0}}
-\DeclareRobustCommand*{\pExp}[2][x]{\mb{\frac{1}{#2}\e{-\frac{#1}{#2}}}\I[\mb{#1}]{\mb{0,\infty}}%
-\mb{, \where #2>0}}
-\DeclareRobustCommand*{\pGam}[3][x]{\mb{\frac{#3^{#2}}{\Gamma[#2]}#1^{#2-1}\e{-#3#1}}%
-\I[\mb{#1}]{\mb{0,\infty}}\mb{, \where #2>0 \and #3>0}}
+\DeclareRobustCommand*{\pBet}[3][x]{\IBeta{#2}{#3}%
+#1^{#2-1}\wrap[()]{1-#1}^{#3-1}\I[#1]{0,\ 1}, \where #2>0 \and #3>0}
+\DeclareRobustCommand*{\pCau}[3][x]{\ifthenelse{\equal{#2, #3}{0, 1}}{\frac{1}{\cpi\wrap[()]{1+#1}^2}}%
+{\frac{1}{#3\cpi\left\{1+\wrap{\wrap[()]{x-#2}/#3}^2\right\}}, \where #3>0}}
+\DeclareRobustCommand*{\pChi}[2][x]{\frac{2^{-#2/2}}{\Gamma[#2/2]}#1^{#2/2-1}\e{-#1/2}%
+\I[#1]{0,\infty}, \where #2>0}
+\DeclareRobustCommand*{\pExp}[2][x]{\frac{1}{#2}\e{-#1/#2}\I[#1]{0,\infty},%
+\where #2>0}
+\DeclareRobustCommand*{\pGam}[3][x]{\frac{#3^{#2}}{\Gamma[#2]}#1^{#2-1}\e{-#3#1}%
+\I[#1]{0,\infty}, \where #2>0 \and #3>0}
\DeclareRobustCommand*{\pN}[3][x]{\ifthenelse{\equal{#2, #3}{0, 1}}%
-{\mb{\frac{1}{\sqrt{2\cpi}}\e{-\frac{1}{2}#1^2}}}%
-{\mb{\frac{1}{\sqrt{2\cpi#3}}}\e{\mb{-\frac{1}{2#3}}\wrap[()]{\mb{#1-#2}}^2}}}
-\DeclareRobustCommand*{\pPar}[3][x]{\frac{\mb{#3}}{\mb{#2}\wrap[()]{\mb{1+\frac{#1}{#2}}}^{\mb{#3+1}}}%
-\I[\mb{#1}]{\mb{0,\infty}}\mb{, \where #2>0 \and #3>0}}
-\DeclareRobustCommand*{\pU}[3][x]{\ifthenelse{\equal{#2, #3}{0, 1}}{\I[\mb{#1}]{\mb{0,\ 1}}}%
-{\mb{\frac{1}{#3-#2}}\I[\mb{#1}]{\mb{#2,\ #3}}\mb{, \where #2<#3}}}
+{\frac{1}{\sqrt{2\cpi}}\e{-#1^2/2}}%
+{\frac{1}{\sqrt{2\cpi#3}}\e{-\wrap[()]{#1-#2}^2/2#3}}}
+\DeclareRobustCommand*{\pPar}[3][x]{\frac{#3}{#2\wrap[()]{1+#1/#2}^{#3+1}}\I[#1]{0,\infty},%
+\where #2>0 \and #3>0}
+\DeclareRobustCommand*{\pU}[3][x]{\ifthenelse{\equal{#2, #3}{0, 1}}{\I[#1]{0,\ 1}}%
+{\frac{1}{#3-#2}\I[#1]{#2,\ #3}, \where #2<#3}}
%re-define other accents
\let\STATEXequal=\=
@@ -210,7 +210,7 @@
\let\STATEXc=\c
\renewcommand*{\c}[1]{\relax\ifmmode\expandafter\mb{\mathrm{#1}}\else\expandafter\STATEXc{#1}\fi}
\let\STATEXd=\d
-\renewcommand*{\d}[1]{\relax\ifmmode\expandafter\,\mb{\mathrm{d}#1}\else\expandafter\STATEXd{#1}\fi}
+\renewcommand*{\d}[1]{\relax\ifmmode\expandafter\,\mb{\mathrm{d}\ifthenelse{\equal{#1}{}}{}{#1}}\else\expandafter\STATEXd{#1}\fi}
\let\STATEXdot=\.
\renewcommand*{\.}{\relax\ifmmode\expandafter\mb{\ldots}\else\expandafter\STATEXdot\fi}
% warning: \dots is not a replacement for \ldots since \bm{\dots} creates an error
@@ -273,12 +273,20 @@ Sometimes overline is better: @\b{x} \vs \ol{x}@ $$\b{x} \vs \ol{x}$$
And, underlines are nice too: @\ul{x}@ $$\ul{x}$$
-A few other nice-to-haves:
+Derivatives and partial derivatives:
-@\chisq@ $$\chisq$$
@\deriv{x}{x^2+y^2}@ $$\deriv{x}{x^2+y^2}$$
@\pderiv{x}{x^2+y^2}@ $$\pderiv{x}{x^2+y^2}$$
+Or, rather, in the order of @\frac@:
+
+@\derivf{x^2+y^2}{x}@ $$\derivf{x^2+y^2}{x}$$
+@\pderivf{x^2+y^2}{x}@ $$\pderivf{x^2+y^2}{x}$$
+
+A few other nice-to-haves:
+
+@\chisq@ $$\chisq$$
+
@\Gamma[n+1]=n!@ $$\Gamma[n+1]=n!$$
@\binom{n}{x}@ $$\binom{n}{x}$$ %provided by amsmath package
@@ -402,7 +410,7 @@ Binomial Distribution
@X ~ \Bin{n}{p}@ $$X ~ \Bin{n}{p}$$
-@\pBin{n}{p}@ $$\pBin{n}{p}$$
+%@\pBin{n}{p}@ $$\pBin{n}{p}$$
Bernoulli Distribution
@@ -412,7 +420,7 @@ Beta-Binomial Distribution
@X ~ \BB{p}@ $$X ~ \BB{p}$$
-@\pBB{n}{\alpha}{\beta}@ $$\pBB{n}{\alpha}{\beta}$$
+%@\pBB{n}{\alpha}{\beta}@ $$\pBB{n}{\alpha}{\beta}$$
Negative-Binomial Distribution
@@ -426,7 +434,7 @@ Poisson Distribution
@X ~ \Poi{\mu}@ $$X ~ \Poi{\mu}$$
-@\pPoi{\mu}@ $$\pPoi{\mu}$$
+%@\pPoi{\mu}@ $$\pPoi{\mu}$$
Dirichlet Distribution