maths equations and adding "for i=1,...,n"

3,378 views
Skip to first unread message

raed

unread,
Jan 4, 2007, 3:50:56 PM1/4/07
to LaTeX Users Group

Hi,

I'm sure you have seen in technical papers, the equation format that
results when you use the syntax $$[equation here]$$

I came across a problem using this. I want to centre the equation on a
new line but I also want "for i=1,...,n" next to it. However the "for"
bit comes out in italics (other technical papers do not use italics for
this bit if i remember correctly)

For example "$$ x=k_i for i=1,...,n $$" does not produce the desired
visuals.

Thanks for your help,

Raed.

Kevin E. Thorpe

unread,
Jan 4, 2007, 8:54:41 PM1/4/07
to LaTeX Users Group

Does "x=k_i \mbox{for} i=1, \ldots, n" do what you want?

--
Kevin E. Thorpe
Assistant Professor, Department of Public Health Sciences
Faculty of Medicine, University of Toronto

Ariovaldo V Garcia

unread,
Jan 5, 2007, 6:52:59 AM1/5/07
to latex...@googlegroups.com
Hi

you can use:

$$ x=k_i \mbox{ for } i=1,...,n $$

or if you want more spacing before and after "for":

$$ x=k_i \;\;\; \mbox{for} \;\;\; i=1,...,n $$


Ariovaldo

Flamel

unread,
Jan 5, 2007, 8:45:17 AM1/5/07
to LaTeX Users Group
Hi,

You can use the package ALGORITHMS (Peter William) which enable to
write codes. It is easy to use and make very nice code (loops, while,
etc). I think it is the best for what you want to do.
You can find it on CTAN as weel as it pdf guide.

See you

raed

unread,
Jan 6, 2007, 8:26:11 AM1/6/07
to LaTeX Users Group
Hi,

Thanks a lot guys for your help :)

raed

Reply all
Reply to author
Forward
0 new messages