[cl-typesetting-devel] How to make some text flush left andsomeflush right?

Peter Seibel peter at gigamonkeys.com
Thu Jul 20 18:23:12 UTC 2006


On Jul 20, 2006, at 11:09 AM, Peter Seibel 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?

If I change the PUT-STRINGs to VERBATIMs then the weird inter-string  
spacing goes away but the strings that I was hoping to have flush  
right (the page number in the header and the date string in the  
footer) are about a half-inch in from the right margin. (Though I'm  
not sure they were exactly flush right even with PUT-STRING.)

-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