3

I would like to center the K-map generated using the karnaugh-map package. Any suggestions? The following code creates the map but aligned left.

\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}
BHamza
  • 351

1 Answers1

2

You can put your Karnaugh Map Code between a \begin{center} ... \end{center} environment.

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