6

I've got the following code for an equation:

\begin{dmath}
    x \in A - B \leftrightarrow x \in A \textrm{ and } x \not\in B
\end{dmath}

It produces the output:

enter image description here

The equation really doesn't need so many line breaks, the whole thing could fit on one line. I then put a frame around it to see the bounds of the equation:

enter image description here

Is there a way to define the bounds of a dmath equation so that it isn't crammed into a really small box and given loads of line breaks?

  • instead of using dmath, if you know it can fit on one line, you can use the equation environment. using the same environment for every display in your document may not be the best choice. – barbara beeton Dec 23 '13 at 13:19
  • I'm targeting my documents at the Kindle, so over half of my equations need breaking up! – Todd Davies Dec 25 '13 at 7:47
8

I believe that breqn makes more problems that it solves. By default, every relation symbol in dmath marks a line break point for alignment. Those you don't want should be hidden. Choose one of the methods below.

\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}

\begin{document}
\begin{dmath}
    x \in A - B \leftrightarrow x \in A \text{ and } x \notin B
\end{dmath}
\begin{dmath}
    x \hiderel{\in} A - B \leftrightarrow x \hiderel \in A \text{ and } x \hiderel{\notin} B
\end{dmath}
\begin{dmath}
    {x \in A - B} \leftrightarrow {x \in A \text{ and } x \notin B}
\end{dmath}
\end{document}

Note that \not\in produces a wrong symbol and \notin should be used; this doesn't depend on breqn.

enter image description here

| improve this answer | |
  • s/that it solves/than it solves/? – morbusg May 8 '14 at 12:46
  • @morbusg Yes, typo. ;-) – egreg May 8 '14 at 12:51

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.