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

Peter Seibel peter at gigamonkeys.com
Wed Jul 26 21:19:21 UTC 2006


On Jul 20, 2006, at 11:50 AM, Marc Battyani wrote:

> "Peter Seibel" <peter at gigamonkeys.com> wrote:
>> 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:
>>>
>>> Weird. Maybe put 3 :hfill instead of just one ;-)
>>
>> That's a joke, right.
>
> Yes, but it can be interesting to try anyway as this will  
> artificially increase the expandability of the hfill.
>
>>> Also can you disable the stream compression so that I can look   
>>> inside the pdf.
>>
>> How?
>
> (setf *compress-streams* nil) or something like that. The generated  
> pdf should be readable with emacs after that.

Okay. Attached is a document generated with stream compression turned  
of. Here's the 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 #'(lambda (page)
			  (declare (ignore page))
			  (compile-text (:font "Times-Italic" :font-size 10)
			    (paragraph (:h-align :fill)
			      ;; Not clear whether these should
			      ;; be VERBATIM or PUT-STRING. Get
			      ;; weird spacing with PUT-STRING.
			      (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)))))

There are two problems with the output. First, the weird interword  
spacing I mentioned before. That gets better if I use VERBATIM rather  
than PUT-STRING but then the stuff that's supposed to be flush right  
is even more to the left. The other problem, which I just noticed, is  
that not all the content is rendered. FWIW, the next thing that  
should appear is a table; dunno if that matters or not.

-Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: docs.pdf
Type: application/pdf
Size: 36257 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-typesetting-devel/attachments/20060726/1f38d1bb/attachment.pdf>
-------------- next part --------------

-- 
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