我想将使用 karnaugh-map 包生成的 K 图居中。有什么建议吗?以下代码创建了地图,但左对齐。
\documentclass[legalpaper, 12pt, addpoints]{exam}
\usepackage{tikz}
\usepackage{karnaugh-map}
\CorrectChoiceEmphasis{\itseries\color{red}}
\begin{document}
\begin{questions}
\question The following is a 2x4 k-map:
\begin{karnaugh-map}[4][2][1][$xy$][$z$]
\maxterms{0,1,4,5}
\manualterms{,,1 (b),1 (a),,, 1 (d), 1 (c)}
\end{karnaugh-map}
\end{questions}
\end{document}
答案1
您可以将卡诺图代码置于\begin{center} ... \end{center}
环境之间。
\documentclass[legalpaper, 12pt, addpoints]{exam}
\usepackage{tikz}
\usepackage{karnaugh-map}
\CorrectChoiceEmphasis{\itseries\color{red}}
\begin{document}
\begin{questions}
\question The following is a 2x4 k-map:
\begin{center}
\begin{karnaugh-map}[4][2][1][$xy$][$z$]
\maxterms{0,1,4,5}
\manualterms{,,1 (b),1 (a),,, 1 (d), 1 (c)}
\end{karnaugh-map}
\end{center}
\end{questions}
\end{document}