2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

added path in karnough map

This commit is contained in:
Martin Thoma 2013-03-25 23:38:44 +01:00
parent 78d2c45580
commit 6bd1c9a613
4 changed files with 51 additions and 35 deletions

View file

@ -4,6 +4,7 @@ DENSITY = 300
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
pdflatex $(SOURCE).tex -output-format=pdf
make clean

View file

@ -0,0 +1 @@
Thanks to Peter Grill for his help on [tex.stackexchange.org](http://tex.stackexchange.com/a/104285/5645)!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before After
Before After

View file

@ -1,41 +1,55 @@
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\documentclass[border=2pt]{standalone}
\usepackage[dvipsnames]{xcolor}
\input{kvmacros}
\usepackage{tikz}
\usetikzlibrary{calc}%
\newcommand{\tikzmark}[1]{%
\tikz[overlay, remember picture, baseline] \node (#1) {};%
}
\newcommand{\DrawArrow}[3][]{%
\begin{tikzpicture}[overlay,remember picture]
\draw[
->, thick,% distance=\ArcDistance,
%shorten <=\ShortenBegin, shorten >=\ShortenEnd,
%out=\OutAngle, in=\InAngle, Arrow Style, #2
#1
]
($(#2)+(-0.50em,3.5ex)$) to
($(#3)+(1.5em,0.0ex)$);
\end{tikzpicture}% <-- important
}
\begin{document}
\begin{preview}
\karnaughmap{4}{$f(w,x,y,z)$}{{$w$}{$x$}{$y$}{$z$}}%
{
1100
1100
0011
0101
}
{
% Long one at top
\textcolor{Blue}{
\put(2,3.5){\oval(3.9,0.9)[]}
}
\textcolor{WildStrawberry}{
\put(0.9,3.5){\oval(1.7,0.8)[]}
}
% two left
\textcolor{Green}{
\put(0.7,1.5){\oval(1.9,0.9)}
}
\textcolor{Sepia}{
\put(1.5,1.5){\oval(1.6,0.7)}
}
\textcolor{Red}{
\put(1.92,1){\oval(0.9,1.9)}
}
\textcolor{LimeGreen}{
\put(1.76,-0.2){\oval(0.9,2.1)[t]}
\put(1.76,4.2){\oval(0.9,2.1)[b]}
}
}
\end{preview}
\karnaughmap{4}{$f(w,x,y,z)$}{{$w$}{$x$}{$y$}{$z$}}%
{
1100
1100
0011
0101
}
{
\textcolor{Blue}{
\put(2,3.5){\oval(3.9,0.9)[]}
}
\textcolor{WildStrawberry}{
\put(0.9,3.5){\oval(1.7,0.8)[]}
}
\textcolor{Green}{
\put(0.7,1.5){\tikzmark{11}\oval(1.9,0.9)}
}
\textcolor{Sepia}{
\put(1.5,1.5){\oval(1.6,0.7)}
}
\textcolor{Red}{
\put(1.92,1){\oval(0.9,1.9)}
}
\textcolor{LimeGreen}{
\put(1.76,-0.2){\tikzmark{13}\oval(0.9,2.1)[t]}
\put(1.76,4.2){\oval(0.9,2.1)[b]}
}
}
\DrawArrow[red, ultra thick, out=-180, in=-90, distance=1.5em, shorten >= -4.5ex]{13}{11}
\end{document}