5

I am trying to have three matrices on one line as

i) A=(..), ii) B=(..) and ii) C=(..).

I tried \nopagebreak, \noindent just after item. Instead I always get the Roman numeral on one line, a comma on the next line, etc. Below is my code

\begin{document}
\begin{questions}
Determine which of the following matrices are Hermitian

\begin{enumerate}[i)]
\item \begin{displaymath} \noindent A= \begin{pmatrix*} 2 & 2+3i & 4-5i \\
2-3i & 5 & 6+2i \\
4+5i & 6-2i & -7 \\ \end{pmatrix*}
end{displaymath},
\item \begin{displaymath}B= \left [ \begin{array}{rrr}3 & 2-i & 4+i \\[2ex]
2-i & 6 & i \\ [2ex] 4+i & i & 3 \\
\end{array} \right] \end{displaymath},
\item \begin{displaymath}C= \left [ \begin{array}{rrr}4 & -3 & 5 \\[2ex]
-3 & 2 & 1 \\ [2ex] 5 & 1 & -6 \\
\end{array} \right] \end{displaymath}
\end{enumerate}
\end{questions}
\end{document}
5

You can use the enumitem package that also frees you from manually adding the separators. Note that this package is much more powerful than paralist and offers several more bells and whistles.

\documentclass{article}
\usepackage{mathtools}
\usepackage[inline]{enumitem}

\begin{document}

Determine which of the following matrices are Hermitian\\*[\medskipamount]
\begin{enumerate*}[label=\roman*),itemjoin={,\quad}]
\item $A= \begin{bmatrix*}[r] 
          2    & 2+3i & 4-5i \\
          2-3i & 5    & 6+2i \\
          4+5i & 6-2i &  -7 \\ 
          \end{bmatrix*}$

\item $B= \begin{bmatrix*}[r]
          3 & 2-i & 4+i \\
          2-i & 6 & i \\  
          4+i & i & 3 \\
          \end{bmatrix*}$

\item $C= \begin{bmatrix*}[r]
          4 & -3 & 5 \\
          -3 & 2 & 1 \\
          5 & 1 & -6 \\
          \end{bmatrix*}$
\end{enumerate*}

\bigskip\bigskip

Determine which of the following matrices are Hermitian\\*[\medskipamount]
\begin{enumerate*}[label=\roman*),itemjoin={,\quad}]
\item $A= \begin{bmatrix}
          2    & 2+3i & 4-5i \\
          2-3i & 5    & 6+2i \\
          4+5i & 6-2i &  -7 \\ 
          \end{bmatrix}$

\item $B= \begin{bmatrix}
          3 & 2-i & 4+i \\
          2-i & 6 & i \\  
          4+i & i & 3 \\
          \end{bmatrix}$

\item $C= \begin{bmatrix}
          4 & -3 & 5 \\
          -3 & 2 & 1 \\
          5 & 1 & -6 \\
          \end{bmatrix}$
\end{enumerate*}

\end{document}

As you see, the separation between the items is set with the itemjoin key.

I added the version with matrices having the default center alignment, which seems much better (except, perhaps, for the third one).

enter image description here

| improve this answer | |
  • Yes this is a very good improvement @egreg, however am getting an error on the line "\begin{enumerate*}[label=\roman*),itemjoin={,\quad}]", giving the error "missing number, treated as zero". I would appreciate help. Further more for my learning what do a) \quad, b) \bigskip do. Note that I remove \quad after each \end{bmatrix}. – Zilore Mumba Apr 19 '15 at 14:09
  • @ZiloreMumba You may have an outdated version of enumitem; what TeX distribution are you using? – egreg Apr 19 '15 at 14:11
  • I am working on Windows. It seems I have enumitem for 2009-05-25. I do not know how to update it on windows. – Zilore Mumba Apr 19 '15 at 14:36
  • @ZiloreMumba Go to miktex.org and install MiKTeX 2.9 – egreg Apr 19 '15 at 15:07
4

You could use the paralist package and its inparaenum environment.

enter image description here

\documentclass{exam}
\usepackage{mathtools}  % for 'bmatrix*' environment
\usepackage{paralist}   % for 'inparaenum' environment

\begin{document}
Determine which of the following matrices are Hermitian
\bigskip

\begin{inparaenum}[i)]
\item $A= \begin{bmatrix*}[r] 
          2    & 2+3i & 4-5i \\
          2-3i & 5    & 6+2i \\
          4+5i & 6-2i &  -7 \\ 
          \end{bmatrix*}$,\quad
\item $B= \begin{bmatrix*}[r]
          3 & 2-i & 4+i \\
          2-i & 6 & i \\  
          4+i & i & 3 \\
          \end{bmatrix*} $,\quad
\item $C= \begin{bmatrix*}[r]
          4 & -3 & 5 \\
          -3 & 2 & 1 \\
          5 & 1 & -6 \\
          \end{bmatrix*} $
\end{inparaenum}

\end{document}
| improve this answer | |
  • 1
    Thanks @Mico, this does exactly what I wanted. Thanks for your time and effort. – Zilore Mumba Apr 19 '15 at 13:07

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.