# [tex-live] setting off to the right on same line as left-aligned text

Zdenek Wagner zdenek.wagner at gmail.com
Sat May 19 19:12:42 CEST 2012

2012/5/18 Anne Wainwright <anotheranne at fables.co.za>:
> Hi,
>
> As you will note from other current post I have text involving a price
> which is set in bold type.
>
\def\price #1\par{\unskip
\nobreak\hfill\penalty50\hskip2em\hbox{}\nobreak\hfill
\hbox{\style #1}\par}

You will use it as:

Book information \price 50

You have to define \style or replace it with commands to define the
style how the price should be printed (\bfseries etc), you can also
automatically insert currency unit so that it is not necessary to put
it in you text.

The macro is taken and slightly adapted from the book TeXbook naruby
by Petr Olšák (in Czech).

> The other issue involved with this is that this price comes at the end
> of a paragraph outlining the author/title/description of a book that is
> one solid paragraph.
>
> I want that where the paragraph ends, the last line, it is set to the
> left and the price is set to the right on the same line. I use the code
> shown below but this results in the price being set to the right on the
> next line.
>
> I can find no way to keep the price on the same line. Obviously if there
> is too much text in that last line and no room is left for a
> right-aligned price, then of course the price must be set to the right
> of a newline.
>
> \textbf{\#19493  Burton, A.R.E.} CAPE COLONY FOR THE SETTLER. An Account
> Of Its Urban And Rural Industries, Their Probable Future Development And
> Extension. \textit{Brown gilt boards, 11pp+355pp+46pp of illustrated
> adverts, tables, maps, plates. Boards loose and worn, some small holes
> to spine edge, front board. Edges and eps browned, contents VG. } J.C.
> Juta \& Co., South Africa 1903\begin{flushright}\begin{math}\mathbf{
> \boldsymbol{\pounds}25.00}\end{math}\end{flushright}
>
> If I \flushleft{} the description I note that a) the paragraph
> width shrinks slightly but b) we still get the price on the next line.
>
> Again, any assistance greatfully received.
>
> Anne

--
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz