<div> Hi,</div><div> </div><div>I would like to write a command \toRight{#1} allowing me to align a piece of thext to be flushed the right at the end of a justified paragraph, creating a nex line of necessary.</div><div>Example 1 :</div>
<div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph</div>
<div>\toRight{foo}</div><div> </div><div>would create a paragrapph looking like :</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div>
<div>paragraph paragraph paragraph paragraph foo</div><div> </div><div>Example 2 :</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>
paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph</div><div>\toRight{very long foo}</div><div> </div><div>would create a paragrapph looking like :</div><div>paragraph paragraph paragraph paragraph paragraph</div>
<div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph</div><div> very long foo</div>
<div> </div><div> </div><div>Currently, I have </div><div>toRight defined such as :</div><div>\newcommand{\toright}[1]{%</div><div>\hspace{\stretch{1}}%<br>{\hfil\penalty 100 \hfilneg \raggedright \hbox{#1}}</div><div>}</div>
<div> </div><div>It works perfectly fot rhe first example. It also correctly prevent the #1 argument to be splitted over several lines.</div><div>However, it doesn't allo to rag right when a new line is created.</div>
<div> </div><div>with this implementation, Example 2 looks like :</div><div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div><div>paragraph paragraph paragraph paragraph paragraph</div>
<div>paragraph paragraph paragraph paragraph</div><div> very long foo</div><div> </div><div>which is not good.</div><div> </div><div>Any Idea ?</div></div>
<div>
</div><div>-----</div><div>Regards,</div><div>Wilfried Kirschenmann</div><div> </div><div>"An expert is a person who has made all the mistakes that can be made in a very narrow field."</div><div>Niels Bohr - Danish physicist (1885 - 1962)</div>
<div> </div>