diff options
author | Karl Berry <karl@freefriends.org> | 2016-09-26 20:52:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-09-26 20:52:50 +0000 |
commit | 0aeb54ea38eda4571b93e571228e81a29444730c (patch) | |
tree | 332c9a60c51b8725486caa2eb8c8e1398a0538bd /Master/texmf-dist/tex/latex/optidef | |
parent | 1302eeeb3978a70f34e873a949d47684c8d5a534 (diff) |
optidef (26sep16)
git-svn-id: svn://tug.org/texlive/trunk@42154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/optidef')
-rw-r--r-- | Master/texmf-dist/tex/latex/optidef/optidef.sty | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/optidef/optidef.sty b/Master/texmf-dist/tex/latex/optidef/optidef.sty index 796992d5d22..b52ee18762e 100644 --- a/Master/texmf-dist/tex/latex/optidef/optidef.sty +++ b/Master/texmf-dist/tex/latex/optidef/optidef.sty @@ -1,4 +1,4 @@ -% optidef - Version 2.0 +% optidef - Version 2.1 % %Copyright 2016 J. Lago Garcia % @@ -12,11 +12,11 @@ %This work consists of the file optidef.sty. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{optidef}[2016/08/07 - version=2.0, Package for defining optimization problems] +\ProvidesPackage{optidef}[2016/09/25 - version=2.1, Package for defining optimization problems] \RequirePackage{environ} \RequirePackage{mathtools} -\RequirePackage{xifthen} +\RequirePackage{xifthen} \RequirePackage{etoolbox} \RequirePackage{xparse} \RequirePackage{calc} @@ -25,6 +25,7 @@ % DEFINING PACKAGE OPTIONS %%%%%%%%%%%%%%%%%%%%%%% % Default +\newcommand{\defaultOCPConstraint}{,} \newcommand{\defaultProblemFormat}{l} \DeclareOption{short}{ @@ -35,6 +36,10 @@ \renewcommand{\defaultProblemFormat}{l} } +\DeclareOption{nocomma}{ + \renewcommand{\defaultOCPConstraint}{} +} + \ProcessOptions\relax %%%%%%%%%%%%%%%%%%%%%%% @@ -264,7 +269,7 @@ \bodyconst{#1} \togglefalse{bodyCon} }{ - ,\\&\quad & #2\span\span + \defaultOCPConstraint\\&\quad & #2\span\span \togglefalse{bodyCon} } }{ @@ -272,7 +277,7 @@ \bodyconst{#1}{#2} \togglefalse{bodyCon} }{ - ,\\&\quad  & #2\span\span + \defaultOCPConstraint\\&\quad  & #2\span\span \togglefalse{bodyCon} } } @@ -283,9 +288,9 @@ \togglefalse{bodyCon} }{ \ifthenelse{\equal{#2}{}}{ - ,\\&\quad & #2 && #3 + \defaultOCPConstraint\\&\quad & #2 && #3 }{ - ,\\&\quad  & #2 && #3 + \defaultOCPConstraint\\&\quad  & #2 && #3 } \togglefalse{bodyCon} } @@ -304,18 +309,18 @@ }{ \ifthenelse{\equal{#2}{}}{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\&\quad & #2 + \defaultOCPConstraint\spanit\\&\quad & #2 \togglefalse{previousThird} }{ - ,\spanit\\&\quad & #2 && #3 + \defaultOCPConstraint\spanit\\&\quad & #2 && #3 \toggletrue{previousThird} } }{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\&\quad  & #2 + \defaultOCPConstraint\spanit\\&\quad  & #2 \togglefalse{previousThird} }{ - ,\spanit\\&\quad  & #2 && #3 + \defaultOCPConstraint\spanit\\&\quad  & #2 && #3 \toggletrue{previousThird} } } @@ -331,16 +336,16 @@ }{ \ifthenelse{\equal{#2}{}}{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\&& #2 \togglefalse{previousThird} + \defaultOCPConstraint\spanit\\&& #2 \togglefalse{previousThird} }{ - ,\spanit\\&& #2 && #3 + \defaultOCPConstraint\spanit\\&& #2 && #3 \toggletrue{previousThird} } }{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\ &  \togglefalse{previousThird} + \defaultOCPConstraint\spanit\\ &  \togglefalse{previousThird} }{ - ,\spanit\\ &  && #3 + \defaultOCPConstraint\spanit\\ &  && #3 \toggletrue{previousThird} } } @@ -355,9 +360,9 @@ \togglefalse{bodyCon} }{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\&\quad & #2 \togglefalse{previousThird} + \defaultOCPConstraint\spanit\\&\quad & #2 \togglefalse{previousThird} }{ - ,\spanit\\&\quad & #2 && #3 + \defaultOCPConstraint\spanit\\&\quad & #2 && #3 \toggletrue{previousThird} } \togglefalse{bodyCon} @@ -371,9 +376,9 @@ \togglefalse{bodyCon} }{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\& & #2\togglefalse{previousThird} + \defaultOCPConstraint\spanit\\& & #2\togglefalse{previousThird} }{ - ,\spanit\\& & #2 && #3 + \defaultOCPConstraint\spanit\\& & #2 && #3 \toggletrue{previousThird} } \togglefalse{bodyCon} @@ -388,16 +393,16 @@ }{ \ifthenelse{\equal{#3}{}}{ \ifthenelse{\equal{#2}{}}{ - ,\spanit\\&& #2 + \defaultOCPConstraint\spanit\\&& #2 }{ - ,\spanit\\ &  + \defaultOCPConstraint\spanit\\ &  } \togglefalse{previousThird} }{ \ifthenelse{\equal{#2}{}}{ - ,\spanit\\&& #2 && #3 + \defaultOCPConstraint\spanit\\&& #2 && #3 }{ - ,\spanit\\ & && #3} + \defaultOCPConstraint\spanit\\ & && #3} \toggletrue{previousThird} } \togglefalse{bodyCon} @@ -411,9 +416,9 @@ \togglefalse{bodyCon} }{ \ifthenelse{\equal{#3}{}}{ - ,\spanit\\& & #2 \togglefalse{previousThird} + \defaultOCPConstraint\spanit\\& & #2 \togglefalse{previousThird} }{ - ,\spanit\\& & #2 && #3 + \defaultOCPConstraint\spanit\\& & #2 && #3 \toggletrue{previousThird} } \togglefalse{bodyCon} |