View Full Version : question about latex
quasar987
Jan10-12, 02:22 PM
How would I go about to write in latex (not the PF version, the actual thing) a function? By that, I mean when you go
f:A\rightarrow B
a\mapsto f(a)
but how to write the code so that the arrows are all just right in length?
Thx!
Pengwuino
Jan10-12, 02:34 PM
What do you meany by "just right in length"?
quasar987
Jan10-12, 02:47 PM
I am looking for a command, if it exist, that will make it so a and f(a) will automatically have the right alignment with A and B respectively, and this, independantly of what A,B,a and f(a) are.
Pengwuino
Jan10-12, 03:12 PM
Do you mean aligning the arrows like the equal signs are lined up here:
http://i42.tinypic.com/2vkbvb6.jpg
If so, simply surround whatever you want everything to align to with &'s. So for this, it was putting "&=&" to align all the equal signs.
quasar987
Jan10-12, 03:21 PM
No. For instance, if I take A to be very long, the formula will look ugly:
f:A set that's very long to write outtttt\rightarrow B
a\mapsto f(a)
Here, the problem is that f(a) is not aligned with B. I could fix this my making the mapsto arrow longer, but I was hoping for a command like \definefunction{f}{A}{B}{a}{f(a)} that would set everything right automarically.
quasar987
Jan10-12, 03:35 PM
Oh, I see what you mean: aligning the arrows would align all. That's clever, thanks :)
AlephZero
Jan10-12, 03:36 PM
I'm not sure exactly what you are trying to do, but the \phantom{} macro works out what size its argument would be if it was typeset, and then creates an invisible object the same size. Maybe you could use that to extend your arrow using a \phantom copy of the long definition.
EDIT: simultaneous post with your #6 !
jhae2.718
Jan11-12, 07:04 PM
The amsmath align environment should work for that.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.