# In ModernCV, how to define a command in the cls style file to allow lines with right-aligned word.

I am using ModernCV for my CV. I want to achieve something like the following example (please note that the address "align2@rightMargin.com" is aligned to the right margin):

Please note the last word is not necessarily an email address but any other word. In the example above what I used is the \hspace command, so I have to estimate the hspace manually everytime I change length of the sentence. I notice \raggedleft may be the right command, but I don't know how to make a command like \cvline in the ModernCV cls file to achieve the above example. Any help will be highly appreciated.

-
@user3690 Try using \hfill rather than \hspace. –  Yiannis Lazarides Feb 18 '11 at 18:59
@user3690: Welcome to tex.sx. You can use the icons on top of the edit window to include hyperlinks or use [text](URL) to do it. Please use  to mark your macro names and other inline code. I included the image for you. You can do this by yourself once you got 10rep points. –  Martin Scharrer Feb 18 '11 at 19:04
@Martin: thanks for including the image for me. –  Causality Feb 18 '11 at 19:15
@Yiannis: \hfill works exactly what I wanted. Thanks a lot. –  Causality Feb 18 '11 at 19:17

You can use \hfill rather than \hspace` and it should work.