TransWikia.com

Equation exceeds one column of IEEE

TeX - LaTeX Asked by Ghulam Hafeez on February 26, 2021

Equation exceeds one column of IEEE pattern in LaTeX how should I correct it? Please help, the code is attached herewith.

begin{equation}label{eq11}
        pleft( {v,h|u,y,...} right) = {rm{RelU}}left( {left[ {hat b + {w^h}left{ {left( {{v^T}{w^v}} right) circ left( {{y^T}{w^y}} right)} right}}  right]*left[ {hat a + {w^v}left{ {left( {{h^T}{w^h}} right) circ left( {{y^T}{w^y}} right)} right}} right]} right)
end{equation}

3 Answers

Line breaks aren't possible in an equation environment. There are likely several possible ways of doing this, one is to use multline from amsmath, another is a split environment inside equation. Note that left/right cannot span a line break, and that you have a lot of brace pairs that are not needed.

enter image description here

documentclass{IEEEtran}
usepackage{lipsum}
usepackage{amsmath}
DeclareMathOperator{RelU}{RelU}
begin{document}
lipsum*[1]
begin{multline}label{eq11}
   p(v,h|u,y,...) = 
   RelUbigl( bigl[ hat b + w^h { ( v^T w^v ) circ ( y^T w^y ) }  bigr]* 
    bigl[ hat a + w^v { ( h^T w^h ) circ ( y^T w^y ) } bigr] bigr)
end{multline}
lipsum[2]
begin{equation}label{eq12}
begin{split}
   p(v,h|u,y,...) &= 
   RelUbigl( bigl[ hat b + w^h { ( v^T w^v ) circ ( y^T w^y ) }  bigr]* 
   &phantom{{}=RelUbigl(} bigl[ hat a + w^v { ( h^T w^h ) circ ( y^T w^y ) } bigr] bigr)
end{split}
end{equation}
lipsum
end{document}

Correct answer by Torbjørn T. on February 26, 2021

I suggest using multline. I took the opportunity to improve and simplify the code:

documentclass{ieeetran}
usepackage{mathtools}
usepackage{lipsum}

 begin{document}

lipsum[1]
begin{multline}label{eq11}
        pbigl(v,hmid u,ydots bigr) = 
  mathrm{RelU}Bigl( Bigl[ {hat b + {w^h}bigl{bigl(v^T w^v bigr) circ bigl(y^T w^y bigr) bigr}}Bigr]  *
  Bigl[ {hat a + {w^v}bigl{ bigl(h^Tw^h bigl) circ bigl( y^T w^y bigr) bigr}} Bigr] Bigr)
end{multline}

end{document}

enter image description here

Answered by Bernard on February 26, 2021

I prefer equation environment with split as it automatically vertically justifies the equation number and is slightly more compact.

documentclass{article}
usepackage[a4paper, total={3in, 9in}]{geometry}
usepackage[utf8]{inputenc}
usepackage{amsmath}


begin{document}


textbf{this is with multiline package}
begin{multline}label{eq11}
        pbigl(v,hmid u,ydots bigr) = 
  mathrm{RelU}Bigl( Bigl[ {hat b + {w^h}bigl{bigl(v^T w^v bigr) circ bigl(y^T w^y bigr) bigr}}Bigr]  *
  Bigl[ {hat a + {w^v}bigl{ bigl(h^Tw^h bigl) circ bigl( y^T w^y bigr) bigr}} Bigr] Bigr)
end{multline}


textbf{this is with equation package}
begin{equation}label{eq11}
begin{split}
        pbigl(v,hmid u,ydots bigr) = 
  mathrm{RelU}Bigl( Bigl[ {hat b + {w^h}bigl{bigl(v^T w^v bigr) circ bigl(y^T w^y bigr) bigr}}Bigr]  *
  Bigl[ {hat a + {w^v}bigl{ bigl(h^Tw^h bigl) circ bigl( y^T w^y bigr) bigr}} Bigr] Bigr)
  end{split}
end{equation}

end{document}

Equation package vertically aligns the equation number

Answered by Mohit Lamba on February 26, 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