LaTeX中karnaugh-map宏包特定单元格连接的技术求助
How to Connect Cells 0&8 and 3&11 in Your Karnaugh Map with
karnaugh-map Package Hey there! I’ve got you covered on adding those cross-row implicants you need. The karnaugh-map package has dedicated commands to draw these connections—here’s exactly how to tweak your code:
Full Working Code
\documentclass{standalone} \usepackage{karnaugh-map} \begin{document} \begin{karnaugh-map}[4][4][1][$A$][$B$][$C$][$D$] % Your original manual term values \manualterms{1,0,0,1,0,0,0,0,1,1,1,1,0,1,1,1} % Connect cell 0 (row 0, column 0) to cell 8 (row 2, column 0) \implicant{0}{0}{2}{0} % Connect cell 3 (row 0, column 3) to cell 11 (row 2, column 3) \implicant{0}{3}{2}{3} \end{karnaugh-map} \end{document}
Key Explanations
- Environment Setup: The
[4][4][1][$A$][$B$][$C$][$D$]parameters define a 4x4 map (for 4 variables), set cell size, and label the row variables ($A,B$) and column variables ($C,D$). Adjust variable labels if your map uses a different variable order. \implicantCommand: This is the tool for drawing cross-cell connections. The syntax is\implicant{start_row}{start_col}{end_row}{end_col}:- Cell 0 sits at row 0, column 0; cell 8 sits at row 2, column 0—hence
\implicant{0}{0}{2}{0}to link them. - Cell 3 is at row 0, column 3; cell 11 is at row 2, column 3—so
\implicant{0}{3}{2}{3}creates that vertical connection.
- Cell 0 sits at row 0, column 0; cell 8 sits at row 2, column 0—hence
- If you need to add larger groups of cells later, you can use
\implicantgroupfor multi-cell clusters, but these single-column cross-row links work perfectly with\implicant.
Compile this code, and you’ll get the exact connections you’re looking for!
内容的提问来源于stack exchange,提问作者Alessandro Pierro
相关产品推荐
相关产品推荐

