|
339 | 339 | % parse environment options |
340 | 340 | \setkeys{karnaugh-map}{#1}% |
341 | 341 | % |
342 | | - % check if the user wants us to omit begin/end{tikzpicture} |
343 | | - \if@karnaughmap@option@omittikzpicture |
344 | | - \begin{scope} |
345 | | - \else |
346 | | - % wrap in tikzpicture for the user |
347 | | - \begin{tikzpicture} |
348 | | - \fi |
349 | | - % |
350 | 342 | % check if implicant colors are specified |
351 | 343 | \IfStrEq{\@karnaughmap@option@implicantcolors}{}{}{% |
352 | 344 | % ensure no empty colors are specified |
|
380 | 372 | % to parse remaining arguments and finish initialization. |
381 | 373 | \@karnaughmap@func@karnaughstart@% |
382 | 374 | }{ |
383 | | - % end tikzpicture if the user did not want us to omit it |
384 | | - \if@karnaughmap@option@omittikzpicture |
385 | | - \end{scope} |
386 | | - \else |
| 375 | + \end{scope} |
| 376 | + % end tikzpicture environment if the user did not want us to omit it |
| 377 | + \if@karnaughmap@option@omittikzpicture\else |
387 | 378 | \end{tikzpicture} |
388 | 379 | \fi |
389 | 380 | \endgroup |
390 | 381 | } |
391 | | - |
392 | 382 | \DeclareDocumentCommand{\@karnaughmap@func@karnaughstart@}{oooooo} {% |
393 | 383 | % parse label args {[START] |
394 | 384 | % try to maintain backwards compatibility with v1 while enabling users to separatly |
|
584 | 574 | Existing templates have the following dimensions: 2x2x1, 2x4x1, 4x2x1, 4x4x1, 4x4x2, and 4x4x4. |
585 | 575 | }% |
586 | 576 | \fi |
587 | | - \tikzset{ |
| 577 | + % begin tikzpicture environment if the user did not want us to omit it |
| 578 | + \if@karnaughmap@option@omittikzpicture\else |
| 579 | + \begin{tikzpicture} |
| 580 | + \fi |
| 581 | + % |
| 582 | + \begin{scope}[ |
588 | 583 | LineStyleA/.style={semithick,solid}, |
589 | 584 | LineStyleB/.style={semithick,dash dot dot}, |
590 | 585 | LineStyleC/.style={thin,double distance=0.8pt}, |
591 | 586 | LineStyleD/.style={ultra thick}, |
592 | 587 | LineStyleE/.style={semithick,dashed}, |
593 | 588 | LineStyleF/.style={semithick,densely dotted}, |
594 | | - } |
| 589 | + ] |
595 | 590 | % grid {[START] |
596 | 591 | % for all dimensions |
597 | 592 | \draw[color=black, ultra thin] (0,0) grid (\@karnaughmap@var@mapsizex@,\@karnaughmap@var@mapsizey@); |
|
1482 | 1477 | % \end{karnaugh-map} |
1483 | 1478 | % \end{figure} |
1484 | 1479 | % |
1485 | | -% \texttt{omittikzpicture}: By default, the |karnaugh-map| environment creates its own |tikzpicture| environment. This option disables this behavior, and it would be expected that the user wraps the |karnaugh-map| environment in a |tikzpicture| environment. This option makes it possible to use the |tikzexternal| package with |karnaugh-map|, or to integrate |karnaugh-map| into a larger |tikzpicture|. |
1486 | | -% |
1487 | | -% \begin{verbatim} |
1488 | | -% \begin{tikzpicture} |
1489 | | -% \begin{karnaugh-map}(omittikzpicture) |
1490 | | -% \minterms{0,1,2,3} |
1491 | | -% \end{karnaugh-map} |
1492 | | -% % Additional tikz code in the same picture |
1493 | | -% \end{tikzpicture}} |
1494 | | -% \end{verbatim} |
| 1480 | +% \texttt{omittikzpicture}: By default, the |karnaugh-map| environment creates its own |tikzpicture| environment. This option disables this behavior, and it would be expected that the user wraps the |karnaugh-map| environment in a |tikzpicture| environment. This option makes it possible to use the |tikzexternal| package with |karnaugh-map|, or to integrate |karnaugh-map| into a larger |tikzpicture|. A code example follows; |
| 1481 | +%\begin{verbatim} |
| 1482 | +%\begin{tikzpicture} |
| 1483 | +% \begin{karnaugh-map}(omittikzpicture) |
| 1484 | +% \end{karnaugh-map} |
| 1485 | +%\end{tikzpicture}} |
| 1486 | +%\end{verbatim} |
1495 | 1487 | % |
1496 | 1488 | % \newpage |
1497 | 1489 | % \section{Examples} |
|
0 commit comments