# How can I center a Karnaugh map using the karnaugh-map package?

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}

• You can put \centering on the line before \begin{karnaugh-map} to center the image. – Marijn Dec 9 '18 at 23:10

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}