并排放置卡诺图

并排放置卡诺图

我有三张卡诺图,我想将它们并排摆放。我尝试使用小页面和子图来实现这一点,但似乎没有什么效果。它们总是显示在彼此的顶部。

这是三张卡诺图

\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}

答案1

像这样:

\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}

输出:

在此处输入图片描述

我使用 geometry 包将文本宽度调大。之前我尝试将字符调小,但没有成功(也许你需要更换 karnaugh-map 包)。

编辑如果您想要两行上的 4 张地图,则不需要 minipage 或 geometry 包:

\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}

输出:

在此处输入图片描述

最后编辑您还可以在同一行上放置 3 个以上的 k-map,不带geometryminipage,带有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}

输出:

在此处输入图片描述

答案2

纯属巧合,在复制粘贴时出错,我设法并排放置了至少两个卡诺图,而且三个卡诺图可能也行得通。我将小页面放在小页面中。在下面的代码中,前两个 kmap 将相互叠放,然后是另一个小页面,其中还有另外两个 kmap,它们也将相互叠放。

\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

相关内容