6

This question already has an answer here:

How can I make the same diagram like this in LaTeX?

enter image description here

I see that i could use package karnaugh but i don´t like placement of x.

enter image description here

marked as duplicate by Red, Benedikt Bauer, Andrew Swann, henrique, Claudio Fiandrino Oct 25 '13 at 12:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Is there any chance to create the same diagram in latex without package karnaugh. – Luka Toni Oct 20 '13 at 13:53
12

Use package karnaugh.

\documentclass{article}
\input{kvmacros}

\begin{document}
\karnaughmap{4}{$F(x_1,x_2,x_3,x_4)=$}{{$x_1$}{$x_2$}{$x_3$}{$x_4$}}{1111100100011011}{}
\end{document}

enter image description here

You can also draw this stuff with TikZ:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) grid (4,4);
\node at (.5,.5){1};
\node at (3.5,.5){1};
\node at (1.5,1.5){1};
\node at (1.5,3.5){1};
\node at (3.5,3.5){1};
\draw (0,4.3) --node[midway, above]{$x_1$} (2,4.3);
\draw (-0.3,4) --node[midway, left]{$x_2$} (-0.3,2);
\draw (1,-0.3) --node[midway, below]{$x_3$} (3,-0.3);
\draw (4.3,1) --node[midway, right]{$x_4$} (4.3,3);
\end{tikzpicture}
\end{document}

enter image description here

You could also use a picture environment like the karnaugh package does internally, or PSTricks, or any other lesser-known LaTeX graphics environment since the drawing required by a Karnaugh map is very simple.

  • is it possible to change a possition of x ? – Luka Toni Oct 20 '13 at 10:32
  • @LukaToni I don't think so. – marczellm Oct 20 '13 at 11:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.