TeX - LaTeX Asked by Mrinai on April 20, 2021
begin{equation}label{eq:42}
E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 , k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
end{array}
end{equation}
It lacks a right.
to close the left{
. See the code below:
begin{equation}label{eq:42}
E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 , k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
end{array}right. %<-- this one was missing
end{equation}
Another alternative is use cases
from amsmath
package:
begin{equation}
E_t(k,d)=begin{cases}
k * E_{ele} + k * E_{fs} * d^2 & mbox{~ if} d< d_0 ,
k * E_{ele} + k * E_{mp} * d^4 & mbox{~ if} dgeq d_0
end{cases}
end{equation}
I add a MWE with both options:
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation}label{eq:42}
E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 , k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
end{array}right. %<-- this one was missing
end{equation}
medskip
begin{equation}
E_t(k,d)=begin{cases}
k * E_{ele} + k * E_{fs} * d^2 & mbox{~ if} d< d_0 ,
k * E_{ele} + k * E_{mp} * d^4 & mbox{~ if} dgeq d_0
end{cases}
end{equation}
end{document}
And the output:
Answered by Luis Turcio on April 20, 2021
There are many things wrong, I'm afraid.
The main error is about TeX syntax: a left
command must have a corresponding right
one, in this case right.
, since you don't want a right fence.
On the other hand, the output is not really pretty
Let's try to correct it.
amsmath
and use its cases
environment.documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation}label{eq:42}
E_t(k,d)=
begin{cases}
k E_{mathrm{ele}} + k E_{mathrm{fs}} d^2 & text{if } d< d_0 ,
k E_{mathrm{ele}} + k E_{mathrm{mp}} d^4 & text{if } dgeq d_0
end{cases}
end{equation}
end{document}
Answered by egreg on April 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP