summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/karnaugh-map
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-02-21 00:25:33 +0000
committerKarl Berry <karl@freefriends.org>2017-02-21 00:25:33 +0000
commit412da490d9754458e0cb477df83c2eb5c37d44d0 (patch)
treea2a30836e356b151be53b3bbc039e7cce0987f1e /Master/texmf-dist/tex/latex/karnaugh-map
parenta50c2b65438f2654a3024426b92803035c9ae871 (diff)
karnaugh-map (20feb17)
git-svn-id: svn://tug.org/texlive/trunk@43271 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/karnaugh-map')
-rw-r--r--Master/texmf-dist/tex/latex/karnaugh-map/karnaugh-map.sty32
1 files changed, 12 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/karnaugh-map/karnaugh-map.sty b/Master/texmf-dist/tex/latex/karnaugh-map/karnaugh-map.sty
index 877cb0806bf..f4b4eb98eb4 100644
--- a/Master/texmf-dist/tex/latex/karnaugh-map/karnaugh-map.sty
+++ b/Master/texmf-dist/tex/latex/karnaugh-map/karnaugh-map.sty
@@ -10,12 +10,12 @@
%%
%%
-%% Copyright (C) 2015 by Mattias Jacobsson
-%% This work, karnaugh-map, is written from the ground up by Mattias Jacobsson. However the general implementation idea is based on the work published on [TeX - LaTeX Stack Exchange](https://tex.stackexchange.com) by [Ignasi](https://tex.stackexchange.com/users/1952/ignasi) found [here](https://tex.stackexchange.com/a/140581) and [here](https://tex.stackexchange.com/a/36879) which is licensed under [CC BY-SA](https://creativecommons.org/licenses/by-sa/3.0/). karnaugh-map is therefore licensed under [CC BY-SA](https://creativecommons.org/licenses/by-sa/3.0/).
+%% Copyright (C) 2015, 2016, 2017 Mattias Jacobsson and contributors
+%% This work, karnaugh-map, is written from the ground up by Mattias Jacobsson. However the general implementation idea is based on the work published on [TeX - LaTeX Stack Exchange](https://tex.stackexchange.com) by [Ignasi](https://tex.stackexchange.com/users/1952/ignasi) found [here](https://tex.stackexchange.com/a/140581) and [here](https://tex.stackexchange.com/a/36879) which is licensed under [CC BY-SA](https://creativecommons.org/licenses/by-sa/3.0/). karnaugh-map is therefore licensed under [CC BY-SA](https://creativecommons.org/licenses/by-sa/3.0/). Contributors include [Oscar Gustafsson](https://github.com/oscargus).
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{karnaugh-map}[2015/10/09 v1.0 Draw Karnaugh Maps]
+\ProvidesPackage{karnaugh-map}[2017/02/20 v1.1 Draw Karnaugh Maps]
%%
%% Dependencies
@@ -313,14 +313,7 @@
% bail if outside environment karnaugh-map
\@karnaughmap@func@bailoutsideenvironment@{}
%
- \foreach \cell in {#1} {%
- % only write to cell if it is empty otherwise fail silently
- \IfSubStr{\@karnaughmap@var@usedcells@}{,\cell,}{}{%
- \path (\@karnaughmap@func@decimaltobin@{\cell}) node {-};
- }
- }
- % update \@karnaughmap@var@usedcells@
- \expandafter\def\expandafter\@karnaughmap@var@usedcells@\expandafter{\@karnaughmap@var@usedcells@#1,}
+ \terms{#1}{-}
}
\DeclareDocumentCommand{\manualterms}{m} {%
% bail if outside environment karnaugh-map
@@ -351,23 +344,22 @@
% bail if outside environment karnaugh-map
\@karnaughmap@func@bailoutsideenvironment@{}
%
- \foreach \cell in {#1} {%
- % only write to cell if it is empty otherwise fail silently
- \IfSubStr{\@karnaughmap@var@usedcells@}{,\cell,}{}{%
- \path (\@karnaughmap@func@decimaltobin@{\cell}) node {0};
- }
- }
- % update \@karnaughmap@var@usedcells@
- \expandafter\def\expandafter\@karnaughmap@var@usedcells@\expandafter{\@karnaughmap@var@usedcells@#1,}
+ \terms{#1}{0}
}
\DeclareDocumentCommand{\minterms}{m} {%
% bail if outside environment karnaugh-map
\@karnaughmap@func@bailoutsideenvironment@{}
%
+ \terms{#1}{1}
+}
+\DeclareDocumentCommand{\terms}{m m} {%
+ % bail if outside environment karnaugh-map
+ \@karnaughmap@func@bailoutsideenvironment@{}
+ %
\foreach \cell in {#1} {%
% only write to cell if it is empty otherwise fail silently
\IfSubStr{\@karnaughmap@var@usedcells@}{,\cell,}{}{%
- \path (\@karnaughmap@func@decimaltobin@{\cell}) node {1};
+ \path (\@karnaughmap@func@decimaltobin@{\cell}) node {#2};
}
}
% update \@karnaughmap@var@usedcells@