[cl-typesetting-devel] How to make some text flush left andsomeflush right?
Marc Battyani
marc.battyani at fractalconcept.com
Thu Jul 20 17:59:34 UTC 2006
"Peter Seibel" <peter at gigamonkeys.com> wrote:
> On Jul 19, 2006, at 10:35 PM, Dmitriy Ivanov wrote:
>
> So using a function is what allows the header to differ a bit each time
> (i.e. the different page number) but isn't necessary for the layout
> part--for that I just needed :hfill which I didn't know about. However
> now I have a new puzzle. Here's my call to draw-pages:
>
> (draw-pages content
> :size :Letter
> :margins '(72 72 72 72) ; left top right bottom
> :header-top 36
> :footer-bottom 36
> :header (compile-text (:font "Times-Italic" :font-size 10)
> (hbox (:align :center :adjustable-p t)
> (put-string "Header")
> :hfill
> (put-string "Page number")))
> :footer (compile-text ()
> (paragraph
> (:h-align :left :font "Times-Italic" :font-size 10)
> (put-string "Footer")))))
>
> This works fine except there's a lot of spacing between the letters in
> "Header" and "Page number" but not between the characters of "Footer". I
> assume that's due to some difference between the hbox used in the header
> and the paragraph used in the footer, but how do I get rid of the weird
> spacing.
hbox is not normally not meant to be used at a user level so you should use
a paragraph in the header too.
You probably want to use :fill as h-align value in addition to the :hfill
where you want the separation.
;; untested
(paragraph (:h-align :fill)
(put-string "Header")
:hfill
(put-string "Page number")))
Marc
More information about the cl-typesetting-devel
mailing list