2

I was trying to use the darray environment from the breqn package but hadn't success on it.

As a mwe I would like to replace the eqnarray below by the darray.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{eqnarray*}
  \max & & c^T x \\
  \text{s.t.} & & x \in \left\{ 0, 1 \right\}^n
\end{eqnarray*}
\end{document}

I try

\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}
\begin{document}
\begin{darray}[cols={rl}]
  \max & c^T x \\
  \text{s.t.} & x \in \left\{ 0, 1 \right\}^n
\end{darray}
\end{document}

but got the error below

! Undefined control sequence.
\@tempc ...let \@preamble \@empty \darray@mkpream 
                                                  #1\@percentchar 
l.5 \begin{darray}[cols={rl}]

? 
! Emergency stop.
\@tempc ...let \@preamble \@empty \darray@mkpream 
                                                  #1\@percentchar 
l.5 \begin{darray}[cols={rl}]

End of file on the terminal!
0

The breqn documentation specifies that "the darray environment is unfinished". Perhaps a safer alternative should be used. How about simply using an array environment?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{array}{rl}
  \max    &  c^T x \\
  \text{s.t.} & x \in \left\{ 0, 1 \right\}^n
\end{array}
\]
\end{document}

enter image description here

| improve this answer | |
1

Same semantics, different syntax. Decide which you find easier to read.

\begin{equation*}
\max \left\{ c^T x \mid x \in \left\{ 0, 1 \right\}^n \right\}
\end{equation*}

enter image description here

| 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.