TransWikia.com

Format long equation

TeX - LaTeX Asked on August 30, 2020

I have this equation:

documentclass[a4paper,12pt]{article}
usepackage{amsmath}
title{}
author{}
date{}
begin{document}
begin{equation}
   frac{u(x,t)-u(x,t-k)}{k}=cfrac{u(x+h,t)-2u(x,t)+u(x-h,t)}{h^2}+(frac{u(x+h,t)-u(x-h,t)}{2h})(frac{c(x+h,t)-c(x-h,t)}{2h}) 
end{equation}
end{document}

The problem is that it goes off the page. So I tried:

begin{align}
  frac{u(x,t)-u(x,t-k)}{k} 
  =& cfrac{u(x+h,t)-2u(x,t)+u(x-h,t)}{h^2}+(frac{u(x+h,t)-u(x-h,t)}{2h})(frac{c(x+h,t)-c(x-h,t)}
  {2h})
end{align}

That doesn’t seem to work either. Any advice?

One Answer

You could use multline.

documentclass[a4paper,12pt]{article}
usepackage{amsmath}
title{}
author{}
date{}
begin{document}

begin{multline}
  frac{u(x,t)-u(x,t-k)}{k} 
  = cfrac{u(x+h,t)-2u(x,t)+u(x-h,t)}{h^2}
 +left(frac{u(x+h,t)-u(x-h,t)}{2h}right)
 left(frac{c(x+h,t)-c(x-h,t)}{2h}right) 
end{multline}

begin{multline}
  frac{u(x,t)-u(x,t-k)}{k} 
  = cfrac{u(x+h,t)-2u(x,t)+u(x-h,t)}{h^2}
 +Bigl(frac{u(x+h,t)-u(x-h,t)}{2h}Bigr)
 Bigl(frac{c(x+h,t)-c(x-h,t)}{2h}Bigr) 
end{multline}
end{document}

enter image description here

Answered by user194703 on August 30, 2020

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