6

Consider the following code:

\documentclass[twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{lipsum}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{breqn}

\usepackage{amsmath} \delimitershortfall=-1pt

\usepackage{mleftright}
\usepackage{color}

\begin{document}

  \lipsum[3-4]

  \textcolor{red}{{\ttfamily \textbackslash mleft} and {\ttfamily \textbackslash mright} inhibits the breaking between delimiters inside {\ttfamily dmath}:}

  \begin{dmath*}
    \mathcal{O}(f) = \mleft\{ t \hiderel{:} \mathbb{N} \hiderel{\rightarrow} \mathbb{R}^+_0 \hiderel{\mid} \exists c \hiderel{\in} \mathbb{R}^+ \wedge \exists n_0 \hiderel{\in} \mathbb{N} \wedge \forall n \hiderel{\geq} n_0 \wedge t(n) \hiderel{\leq} c \, f(n) \mright\}
  \end{dmath*}

  \textcolor{blue}{{\ttfamily \textbackslash left} and {\ttfamily \textbackslash right} produce a good results but {\bf is preferable in many equations always use} the {\ttfamily \textbackslash mleft} and {\ttfamily \textbackslash mright} commands:}

  \begin{dmath*}
    \mathcal{O}(f) = \left\{ t \hiderel{:} \mathbb{N} \hiderel{\rightarrow} \mathbb{R}^+_0 \hiderel{\mid} \exists c \hiderel{\in} \mathbb{R}^+ \wedge \exists n_0 \hiderel{\in} \mathbb{N} \wedge \forall n \hiderel{\geq} n_0 \wedge t(n) \hiderel{\leq} c \, f(n) \right\}
  \end{dmath*}

  \lipsum[1-5]

\end{document}

Output:

enter image description here

Are there any solution or modification that allowed to use \mleft and \mright correctly inside \dmath?

1
  • 2
    In order to work breqn redefines more or less everything related to math typesetting in TeX. Then you load Heiko's package and he redefines stuff again, but aimed at a normal tex setup. It's no doubt possible to rewrite mleftright in breqn style, but not working together should be the expected behaviour. Aug 23, 2013 at 10:16

1 Answer 1

7

The trick of \mleft of package mleftright is that it starts with an empty \mathopen{} and puts the whole expression inside a \mathclose{...} including the original delimiters with \left and \right. Thus the surrounding math sees a correctly delimited expression and \left and \right do not set their additional spacing inside \mathclose.

As the original \left and \right, the expression is put into a math subformula that cannot be broken across lines (\mathinner for \left and \right; \mathclose in case of \mleft and \mright). However, package breqn redefines \left and \right for its purpose to allow line breaks. But because they are inside a subformula, the line break will not have an effect.

Thus you can make a feature request to breqn, if you want to have a similiar feature that package mleftright provides.

But in the case of the question there is no point in using \mleft/\mright at all. The inserted space between the relational symbol (=) and the opening fence \{ or a math inner formula (\left/\right) is exactly the same (\thickmuskip). And the closing fence ends the whole equation without a following symbol.

3
  • There isn;t really anyone maintaining breqn anymore. Those of us left, either do not have the time for breqn or simply do not understand the code behind it.
    – daleif
    Aug 23, 2013 at 11:04
  • Could you merge breqn + mleftright + tex.stackexchange.com/questions/124464/… ?
    – David
    Aug 23, 2013 at 11:10
  • @David: Adding support for breqn (if possible) seems way too complex for mleftright. And adding analyzing and maintaining a complex package is nothing that I should put on my "ToDo" list. It is way too long already. Aug 23, 2013 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .