TransWikia.com

Issue with `cases` of `amsmath`

TeX - LaTeX Asked on January 2, 2021

Problem description:

using the following latex code:

[   left{
begin{array}{ll}
0 & xleq a 
frac{x-a}{b-a} & aleq xleq b 
frac{c-x}{c-b} & bleq xleq c 
1 & cleq x 
end{array} 
right. ]

I obtain this:
enter image description here

While the expected result was:

enter image description here

I have the same issue using cases of amsmath. For example:

begin{equation}
    X=
    begin{cases}
      0, & text{if} a=1 
      1, & text{otherwise}
    end{cases}
  end{equation}

The result is:

enter image description here

Question: I do not even know what to look for. The file style.txt is a huge file with hundreds of lines. Any suggestions about the possible causes of this problem? A cannot even create a minimal example.

Update:

The line usepackage{breqn} cause that problem. If I delete (or comment is), this issue disappears. However, other parts of the .tex contain this code that I need to delete and re-write in some other way:


begin{dmath}
begin{split}
    label{eq:something}
    x_e = x_0 + gamma (x_r - x_{0})
    = x_0 + gamma(cancel{x_0} + alpha (x_0 - x_{n+1}) - cancel{x_0})
    = x_0 + gamma alpha (x_0 - x_{n+1})
    end{split}
end{dmath}

Is possible that some package create conflicts between them?

One Answer

To big for comment:

Your code fragment works as expected. Also works fine cases (from amsmath} as well dcases (from mathtools):

enter image description here

documentclass{article}
usepackage{mathtools}

begin{document}
[
left{begin{array}{ll}
0 & xleq a 
dfrac{x-a}{b-a} & aleq xleq b 
dfrac{c-x}{c-b} & bleq xleq c 
1 & cleq x 
        end{array}
right.
]

[ 
begin{cases}
0 & xleq a 
dfrac{x-a}{b-a} & aleq xleq b 
dfrac{c-x}{c-b} & bleq xleq c 
1 & cleq x 
end{cases}
]


[
begin{dcases}
0 & xleq a 
frac{x-a}{b-a} & aleq xleq b 
frac{c-x}{c-b} & bleq xleq c 
1 & cleq x 
end{dcases}
]

end{document}

Answered by Zarko on January 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP