Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!
share|improve this question
    
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Mar 23 '13 at 20:14

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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