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}
  • 1
    You can put \centering on the line before \begin{karnaugh-map} to center the image. – Marijn Dec 9 '18 at 23:10
1

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}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.