[cl-typesetting-devel] How to make some text flush leftandsomeflush right?
Peter Seibel
peter at gigamonkeys.com
Thu Jul 20 18:43:32 UTC 2006
On Jul 20, 2006, at 11:37 AM, Marc Battyani wrote:
> "Peter Seibel" <peter at gigamonkeys.com> wrote:
>> On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote:
>>
>>> 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.
>>
>> Okay, almost there. Now I've got this:
>>
>> (draw-pages content
>> :size :Letter
>> :margins '(72 72 72 72) ; left top right bottom
>> :header-top 36
>> :footer-bottom 36
>> :header #'(lambda (page)
>> (declare (ignore page))
>> (compile-text (:font "Times-Italic" :font-size 10)
>> (paragraph (:h-align :fill)
>> (put-string (get-contextual-variable 'chapter-name))
>> :hfill
>> (put-string (format nil "Page ~d of ~d"
>> pdf:*page-number*
>> (find-ref-point-page-number :the-end))))))
>> :footer (compile-text (:font "Times-Italic" :font-size 10)
>> (paragraph (:h-align :fill)
>> (put-string
>> (format nil "Copyright ~c ~a" +copyright+ *copyright*))
>> :hfill
>> (put-string (date-string)))))
>>
>> The only problem is that there are weird bits of inter-string
>> space. (See attached PDF.) For instance the "Gigamonkeys Markup"
>> on the left side of the header is rendered like "Gi ga monkeys
>> Markup" and the date in the footer has an inordinate amount of
>> space between the month and the year. Advice?
>
> Weird. Maybe put 3 :hfill instead of just one ;-)
That's a joke, right.
> Also can you disable the stream compression so that I can look
> inside the pdf.
How?
-Peter
--
Peter Seibel * peter at gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
More information about the cl-typesetting-devel
mailing list