|
329 | 329 | % ^^A ########################################################################## |
330 | 330 | % ^^A ########################################################################## |
331 | 331 | \NewDocumentEnvironment{karnaugh-map}{D(){} s O{4} O{4} O{1}} {% |
| 332 | + \begin{tikzpicture} |
| 333 | + \IfBooleanTF{#2}{% |
| 334 | + \begin{karnaugh-map-inner}(#1)*[#3][#4][#5]% |
| 335 | + }{% |
| 336 | + \begin{karnaugh-map-inner}(#1)[#3][#4][#5]% |
| 337 | + } |
| 338 | +}{% |
| 339 | + \end{karnaugh-map-inner} |
| 340 | + \end{tikzpicture} |
| 341 | +} |
| 342 | +\NewDocumentEnvironment{karnaugh-map-inner}{D(){} s O{4} O{4} O{1}} {% |
332 | 343 | \begingroup |
333 | 344 | % parse environment options |
334 | 345 | \setkeys{karnaugh-map}{#1}% |
|
366 | 377 | % to parse remaining arguments and finish initialization. |
367 | 378 | \@karnaughmap@func@karnaughstart@% |
368 | 379 | }{ |
369 | | - \end{tikzpicture} |
370 | 380 | \endgroup |
371 | 381 | } |
372 | 382 | \DeclareDocumentCommand{\@karnaughmap@func@karnaughstart@}{oooooo} {% |
|
564 | 574 | Existing templates have the following dimensions: 2x2x1, 2x4x1, 4x2x1, 4x4x1, 4x4x2, and 4x4x4. |
565 | 575 | }% |
566 | 576 | \fi |
567 | | - \begin{tikzpicture}[ |
| 577 | + \tikzset{ |
568 | 578 | LineStyleA/.style={semithick,solid}, |
569 | 579 | LineStyleB/.style={semithick,dash dot dot}, |
570 | 580 | LineStyleC/.style={thin,double distance=0.8pt}, |
571 | 581 | LineStyleD/.style={ultra thick}, |
572 | 582 | LineStyleE/.style={semithick,dashed}, |
573 | 583 | LineStyleF/.style={semithick,densely dotted}, |
574 | | - ] |
| 584 | + } |
575 | 585 | % grid {[START] |
576 | 586 | % for all dimensions |
577 | 587 | \draw[color=black, ultra thin] (0,0) grid (\@karnaughmap@var@mapsizex@,\@karnaughmap@var@mapsizey@); |
|
0 commit comments