0

I have three karnaugh maps which I would like to put besides each other. I tried doing this with minipages and subfigures but nothing seems to work. There are always displayed on top of each other.

These are the three karnaugh maps

\usepackage{karnaugh-map}
\begin{document}
    \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
    \minterms{3,2,5,7}
    \autoterms[0]
    \implicant{3}{2}
    \implicant{5}{7}
    \end{karnaugh-map}
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
\minterms{3,2,5,7}
\autoterms[0]
\implicant{3}{2}
\implicant{5}{7}
\implicant{3}{7}
\end{karnaugh-map}

\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
\minterms{3,2,5,7}
\autoterms[0]
\implicant{0}{1}
\implicantedge{4}{4}{6}{6}
\end{karnaugh-map}

\end{document}

2 Answers2

2

Like this:

\documentclass{article}
\usepackage{karnaugh-map}
\usepackage[margin=1cm]{geometry}

\begin{document} \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \implicant{3}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{0}{1} \implicantedge{4}{4}{6}{6} \end{karnaugh-map} \end{document}

Output:

enter image description here

I make the text width greater with geometry package. Before I tried to make smaller characters without success (perhaps You need to change the package karnaugh-map).

EDIT If You want 4 maps on two lines, You dont need minipage or geometry package:

\documentclass{article}
\usepackage{karnaugh-map}
%\usepackage[margin=1cm]{geometry}

\begin{document} \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \implicant{3}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\indent \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{0}{1} \implicantedge{4}{4}{6}{6} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{0}{1} \implicantedge{4}{4}{6}{6} \end{karnaugh-map} \end{document}

Output:

enter image description here

LAST EDIT You van put also more than 3 k-maps on the same line, without geometry or minipage, with resizebox:

\documentclass{article}
\usepackage{karnaugh-map}

\begin{document} \resizebox{.95\columnwidth}{!}{% \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%
\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{3}{2} \implicant{5}{7} \implicant{3}{7} \end{karnaugh-map}\hfill \hspace{-.5cm}%

\begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
    \minterms{3,2,5,7}
    \autoterms[0]
    \implicant{0}{1}
    \implicantedge{4}{4}{6}{6}
\end{karnaugh-map}
}

\end{document}

Output:

enter image description here

0

By pure coincidence during a copy and paste error I did manage to get at least two karnaugh maps side by side, and it might work for three as well. I put the minipages inside minipages. In the following code the first two kmaps will be placed on top of each other and then besides that comes another minipage with two other kmaps which will also be placed on top of each other.

\begin{minipage}{0.5\textwidth}
    \begin{minipage}{0.8\textwidth}
    \centering
    \resizebox{\columnwidth}{!}{%
        \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
        \minterms{3,2,5,7}
        \autoterms[0]
        \implicant{3}{2}
        \implicant{5}{7}
        \end{karnaugh-map}
    }
    \end{minipage}
    \begin{minipage}{0.8\textwidth}
\centering
\resizebox{\columnwidth}{!}{%
    \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
    \minterms{3,2,5,7}
    \autoterms[0]
    \implicant{3}{2}
    \implicant{5}{7}
    \implicant{3}{7}
    \end{karnaugh-map}
}
\end{minipage}

\end{minipage}

\begin{minipage}{0.5\textwidth} \begin{minipage}{0.8\textwidth} \centering \resizebox{\columnwidth}{!}{% \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$] \minterms{3,2,5,7} \autoterms[0] \implicant{0}{1} \implicantedge{4}{4}{6}{6} \end{karnaugh-map} } \end{minipage}

\begin{minipage}{0.8\textwidth}
\centering
\resizebox{\columnwidth}{!}{%
    \begin{karnaugh-map}[4][2][1][$C$][$B$][$A$]
    \minterms{3,2,5,7}
    \autoterms[0]
    \implicant{0}{1}
    \implicantedge{4}{4}{6}{6}
    \implicant{0}{4}
    \end{karnaugh-map}
}
\end{minipage}

\end{minipage}

Kmaps side by side