From marc.battyani at fractalconcept.com Wed Feb 4 22:08:43 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 4 Feb 2004 23:08:43 +0100 Subject: [cl-typesetting-devel] multi-page documents References: <16355.37938.71979.988062@mccarthy.genworks.com><20031220155903.GA16626@w-m-p.com> <1c3c01c3deaf$0bb525d0$0303a8c0@marc2> <1d9c01c3dee3$e6011940$0303a8c0@marc2> Message-ID: <0b9001c3eb6b$75e7a810$0303a8c0@marc2> "Peter Seibel" wrote: > > Okay, looks like something else that manifests in the same way. With > > my fix in 3/4 pages are formatted properly. One page, however, still > > has the old problem--the remainder of a paragraph that crosses a page > > boundary loses it's formatting. I have no theories unless you are > > doing something about widow-and-orphans because the remainder happens > > to be two lines. > > More hacking has revealed that sometimes there are styles with NIL > fonts which tends to screw things up. I'm not sure where they come > from. But this patch at least makes my stuff work again. (To replace > the previous patch.) Nil in a style value means that this value is not changed by this style I looked again at the with-text-content macro. The style is saved at the end and re-used at the beginning. The text-style in the text-content is there precisely for this. Have you tried the last version (rev 5) ? Marc From peter at javamonkey.com Wed Feb 4 23:27:52 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 04 Feb 2004 23:27:52 -0000 Subject: [cl-typesetting-devel] multi-page documents In-Reply-To: <0b9001c3eb6b$75e7a810$0303a8c0@marc2> References: <16355.37938.71979.988062@mccarthy.genworks.com> <20031220155903.GA16626@w-m-p.com> <1c3c01c3deaf$0bb525d0$0303a8c0@marc2> <1d9c01c3dee3$e6011940$0303a8c0@marc2> <0b9001c3eb6b$75e7a810$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" wrote: > > > > Okay, looks like something else that manifests in the same way. With > > > my fix in 3/4 pages are formatted properly. One page, however, still > > > has the old problem--the remainder of a paragraph that crosses a page > > > boundary loses it's formatting. I have no theories unless you are > > > doing something about widow-and-orphans because the remainder happens > > > to be two lines. > > > > More hacking has revealed that sometimes there are styles with NIL > > fonts which tends to screw things up. I'm not sure where they come > > from. But this patch at least makes my stuff work again. (To replace > > the previous patch.) > > Nil in a style value means that this value is not changed by this style > I looked again at the with-text-content macro. The style is saved at the end > and re-used at the beginning. > The text-style in the text-content is there precisely for this. > > Have you tried the last version (rev 5) ? Just tried it. With my patch I didn't see any instances where it formatted things incorrectly. Without my patch, same old problem. Below is a patch against rev 5. If you want to look at my code that is using cl-typesetting to see if I'm doing something wrong, it's available at: -Peter Index: layout.lisp =================================================================== --- layout.lisp (revision 5) +++ layout.lisp (working copy) @@ -195,8 +195,18 @@ (with-text-content (content) (multiple-value-bind (lines boxes-left) (split-lines (boxes content) dx dy v-align) (when lines - (let* ((box (make-instance 'vbox :dx dx :dy dy :boxes lines :fixed-size t))) + (let* ((box (make-instance 'vbox :dx dx :dy dy :boxes lines :fixed-size t)) + (last-style (find-last-style (boxes content) boxes-left))) (do-layout box) - (setf (boxes content) boxes-left) - box))))) + (setf (boxes content) (and boxes-left (if last-style (cons last-style boxes-left) boxes-left))) + box)))))) +(defun find-last-style (orig-boxes boxes-left) + "Find the last style element in orig-boxes prior to boxes-left" + (loop with last-style = nil + for cons on orig-boxes + for element = (car cons) + while (not (eql cons boxes-left)) + when (and (style-p element) (font element)) do + (setf last-style element) + finally (return last-style))) -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From ffjeld at common-lisp.net Thu Feb 5 00:42:45 2004 From: ffjeld at common-lisp.net (Frode Vatvedt Fjeld) Date: Thu, 05 Feb 2004 01:42:45 +0100 Subject: [cl-typesetting-devel] *print-base* Message-ID: <2h4qu61hmi.fsf@vserver.cs.uit.no> [I posted this first via nntp.common-lisp.net, but I remembered that probably doesn't work.] I just checked out cl-typesetting, and it does look quite nice. However, at first it produced PDF-files unnacceptable to acrobat or ghostview. After a while I remembered my previous attempt at running cl-pdf and there being a problem with my having *print-base* and *print-radix* not 10 and nil. So is the case with cl-typesetting, apparently. Or it's still a cl-pdf problem. Anyway, while CL-USER(249): (typeset::ex #p"ex.pdf") doesn't work for me, CL-USER(250): (let ((*print-radix* nil) (*print-base* 10)) (typeset::ex #p"ex.pdf")) does work. I'd suggest replacing some generic writes with (format .. "~D" ..), or wrapping some strategic functions in with-standard-io-syntax. -- Frode Vatvedt Fjeld From marc.battyani at fractalconcept.com Thu Feb 5 07:57:05 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 5 Feb 2004 08:57:05 +0100 Subject: [cl-typesetting-devel] *print-base* References: <2h4qu61hmi.fsf@vserver.cs.uit.no> Message-ID: <0c4101c3ebbd$a66d67c0$0303a8c0@marc2> > I just checked out cl-typesetting, and it does look quite > nice. However, at first it produced PDF-files unnacceptable to acrobat > or ghostview. After a while I remembered my previous attempt at > running cl-pdf and there being a problem with my having *print-base* > and *print-radix* not 10 and nil. So is the case with cl-typesetting, > apparently. Or it's still a cl-pdf problem. Anyway, while > > CL-USER(249): (typeset::ex #p"ex.pdf") > > doesn't work for me, > > CL-USER(250): (let ((*print-radix* nil) > (*print-base* 10)) > (typeset::ex #p"ex.pdf")) > > does work. I'd suggest replacing some generic writes with (format > .. "~D" ..), or wrapping some strategic functions in > with-standard-io-syntax. Corrected. It was cl-pdf issue. I thought I corrected it already but it was not the case. Can you check it again ? You need to recompile cl-typesetting after cl-pdf. Marc From marc.battyani at fractalconcept.com Thu Feb 5 08:22:12 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 5 Feb 2004 09:22:12 +0100 Subject: [cl-typesetting-devel] multi-page documents References: <16355.37938.71979.988062@mccarthy.genworks.com><20031220155903.GA16626@w-m-p.com> <1c3c01c3deaf$0bb525d0$0303a8c0@marc2> <1d9c01c3dee3$e6011940$0303a8c0@marc2> <0b9001c3eb6b$75e7a810$0303a8c0@marc2> Message-ID: <0c9601c3ebc1$2ada4930$0303a8c0@marc2> "Peter Seibel" wrote: > > Have you tried the last version (rev 5) ? > > Just tried it. With my patch I didn't see any instances where it > formatted things incorrectly. Without my patch, same old problem. > Below is a patch against rev 5. If you want to look at my code that is > using cl-typesetting to see if I'm doing something wrong, it's > available at: > > I looked at your patch, this one and the previous one. It corrects the problem but should not be needed as with-text-content saves the text style values at the end to reuse them after. And also to be complete it should collect all the last values for each style value. For instance the last text-style could only change the font size and leave the font to nil if it has not changed. Can you tell me what style values are not properly restored ? Marc From ffjeld at common-lisp.net Thu Feb 5 09:58:57 2004 From: ffjeld at common-lisp.net (Frode Vatvedt Fjeld) Date: Thu, 05 Feb 2004 10:58:57 +0100 Subject: [cl-typesetting-devel] *print-base* In-Reply-To: (Marc Battyani's message of "Thu, 5 Feb 2004 08:57:05 +0100") References: <2h4qu61hmi.fsf@vserver.cs.uit.no> Message-ID: <2hy8rhzw2m.fsf@vserver.cs.uit.no> "Marc Battyani" writes: > Corrected. It was cl-pdf issue. I thought I corrected it already but > it was not the case. Can you check it again ? You need to > recompile cl-typesetting after cl-pdf. Not quite. Acrobat says: "An unrecognized token '#x14' was found." (let ((*print-base* 16) (*print-radix* t)) (ex)) ..will presumably give you the same result. -- Frode Vatvedt Fjeld From marc.battyani at fractalconcept.com Thu Feb 5 10:21:57 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 5 Feb 2004 11:21:57 +0100 Subject: [cl-typesetting-devel] *print-base* References: <2h4qu61hmi.fsf@vserver.cs.uit.no> <2hy8rhzw2m.fsf@vserver.cs.uit.no> Message-ID: <0d6301c3ebd1$e3837000$0303a8c0@marc2> "Frode Vatvedt Fjeld" writes: > "Marc Battyani" writes: > > > Corrected. It was cl-pdf issue. I thought I corrected it already but > > it was not the case. Can you check it again ? You need to > > recompile cl-typesetting after cl-pdf. > > Not quite. Acrobat says: "An unrecognized token '#x14' was found." > > (let ((*print-base* 16) > (*print-radix* t)) > (ex)) > > ..will presumably give you the same result. It's exactly the test I've done to check the modifications. It works fine for me (with LW 4.3.6) Are you sure you have recompiled all ? Marc From ffjeld at common-lisp.net Thu Feb 5 10:31:35 2004 From: ffjeld at common-lisp.net (Frode Vatvedt Fjeld) Date: Thu, 05 Feb 2004 11:31:35 +0100 Subject: [cl-typesetting-devel] *print-base* In-Reply-To: <0d6301c3ebd1$e3837000$0303a8c0@marc2> (Marc Battyani's message of "Thu, 5 Feb 2004 11:21:57 +0100") References: <2h4qu61hmi.fsf@vserver.cs.uit.no> <2hy8rhzw2m.fsf@vserver.cs.uit.no> <0d6301c3ebd1$e3837000$0303a8c0@marc2> Message-ID: <2hhdy5zuk8.fsf@vserver.cs.uit.no> "Marc Battyani" writes: > It's exactly the test I've done to check the modifications. It > works fine for me (with LW 4.3.6) Are you sure you have recompiled > all ? It certainly looked like it, but I'm not very proficient with asdf. I did (asdf:operate 'asdf:compile-op 'cl-pdf :force t) (asdf:operate 'asdf:compile-op 'cl-typesetting :force t) ..but apparently this was not enough.. An additional load-op seems to do the trick, and it indeed works ok now. Thanks, and sorry for the confusion. -- Frode Vatvedt Fjeld From peter at javamonkey.com Thu Feb 5 22:06:32 2004 From: peter at javamonkey.com (Peter Seibel) Date: Thu, 05 Feb 2004 22:06:32 -0000 Subject: [cl-typesetting-devel] multi-page documents In-Reply-To: <0c9601c3ebc1$2ada4930$0303a8c0@marc2> References: <16355.37938.71979.988062@mccarthy.genworks.com> <20031220155903.GA16626@w-m-p.com> <1c3c01c3deaf$0bb525d0$0303a8c0@marc2> <1d9c01c3dee3$e6011940$0303a8c0@marc2> <0b9001c3eb6b$75e7a810$0303a8c0@marc2> <0c9601c3ebc1$2ada4930$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" wrote: > > > > Have you tried the last version (rev 5) ? > > > > Just tried it. With my patch I didn't see any instances where it > > formatted things incorrectly. Without my patch, same old problem. > > Below is a patch against rev 5. If you want to look at my code that is > > using cl-typesetting to see if I'm doing something wrong, it's > > available at: > > > > > > I looked at your patch, this one and the previous one. It corrects the > problem but should not be needed as with-text-content saves the text style > values at the end to reuse them after. And also to be complete it should > collect all the last values for each style value. For instance the last > text-style could only change the font size and leave the font to nil if it > has not changed. Is with-text-content something *I'm* supposed to be using. Because I never do. Maybe that's my problem? > Can you tell me what style values are not properly restored ? The obvious problem is the font goes back to the default font. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Thu Feb 5 23:03:51 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 6 Feb 2004 00:03:51 +0100 Subject: [cl-typesetting-devel] multi-page documents References: <16355.37938.71979.988062@mccarthy.genworks.com><20031220155903.GA16626@w-m-p.com> <1c3c01c3deaf$0bb525d0$0303a8c0@marc2> <1d9c01c3dee3$e6011940$0303a8c0@marc2> <0b9001c3eb6b$75e7a810$0303a8c0@marc2> <0c9601c3ebc1$2ada4930$0303a8c0@marc2> Message-ID: <11c601c3ec3c$54fd86c0$0303a8c0@marc2> "Peter Seibel" writes: > "Marc Battyani" writes: > > > I looked at your patch, this one and the previous one. It corrects the > > problem but should not be needed as with-text-content saves the text style > > values at the end to reuse them after. And also to be complete it should > > collect all the last values for each style value. For instance the last > > text-style could only change the font size and leave the font to nil if it > > has not changed. > > Is with-text-content something *I'm* supposed to be using. Because I > never do. Maybe that's my problem? It's used in typeset::make-filled-vbox. It should record the current style values in the text-content at the end of the vbox to reuse them at the start of the next one. > > Can you tell me what style values are not properly restored ? > > The obvious problem is the font goes back to the default font. ok. Marc From peter at javamonkey.com Fri Feb 6 06:13:34 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 06 Feb 2004 06:13:34 -0000 Subject: [cl-typesetting-devel] Turning off hyphenation and getting verbatim output? Message-ID: Is there any way to turn off hyphenation for a chunk of text? Or maybe my real question is why the hyphenation engine hyphenated some text like "/tmp/foo/bar" as "/-tmp/foo/bar". And another question: how do I typeset a paragraph so the text isn't filled, e.g. source code examples? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Fri Feb 6 10:03:42 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 6 Feb 2004 11:03:42 +0100 Subject: [cl-typesetting-devel] Turning off hyphenation and getting verbatimoutput? References: Message-ID: <12c601c3ec98$8220aef0$0303a8c0@marc2> "Peter Seibel" writes: > Is there any way to turn off hyphenation for a chunk of text? Or maybe > my real question is why the hyphenation engine hyphenated some text > like "/tmp/foo/bar" as "/-tmp/foo/bar". > > And another question: how do I typeset a paragraph so the text isn't > filled, e.g. source code examples? I've added a put-source-code-string function that will put text with no hypenation, no kerning, significant whitespaces and newlines etc. It's in the repository. Marc From peter at javamonkey.com Fri Feb 6 17:29:43 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 06 Feb 2004 17:29:43 -0000 Subject: [cl-typesetting-devel] Turning off hyphenation and getting verbatimoutput? In-Reply-To: <12c601c3ec98$8220aef0$0303a8c0@marc2> References: <12c601c3ec98$8220aef0$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > > > Is there any way to turn off hyphenation for a chunk of text? Or maybe > > my real question is why the hyphenation engine hyphenated some text > > like "/tmp/foo/bar" as "/-tmp/foo/bar". > > > > And another question: how do I typeset a paragraph so the text isn't > > filled, e.g. source code examples? > > I've added a put-source-code-string function that will put text with no > hypenation, no kerning, significant whitespaces and newlines etc. > > It's in the repository. Thanks. I'll take a look. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Fri Feb 6 17:42:09 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 6 Feb 2004 18:42:09 +0100 Subject: [cl-typesetting-devel] Turning off hyphenation and gettingverbatimoutput? References: <12c601c3ec98$8220aef0$0303a8c0@marc2> Message-ID: <142101c3ecd8$8ebcba10$0303a8c0@marc2> "Peter Seibel" writes > "Marc Battyani" writes: > > > I've added a put-source-code-string function that will put text with no > > hypenation, no kerning, significant whitespaces and newlines etc. > > > > It's in the repository. > > Thanks. I'll take a look. I've updated the example with a piece of Lisp code in the text. Marc From Marc.Battyani at fractalconcept.com Sun Feb 8 16:11:14 2004 From: Marc.Battyani at fractalconcept.com (Marc Battyani) Date: Sun, 8 Feb 2004 17:11:14 +0100 Subject: [cl-typesetting-devel] [ANNOUNCE] cl-typesetting release 0.70 Message-ID: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> cl-typesetting is a complete typesetting system written in Common Lisp using cl-pdf for the direct generation of pdf files. This enables it to be powerful, extensible, programmable and fast. It is intended to be an alternative to the TeX like typesetting systems. >From the change log: February 08 2004: Release 0.7 Added put-source-code-string to be able to insert text with no hyphenation, significant whitespaces and newlines so that source code is formatted correctly. Added color-box Added multipage example Updated the example with a new cl-pdf code128 barcode Exported the public symbols A few fixes and some cleaning The cl-typesetting home page is here: http://www.fractalconcept.com/asp/html/cl-typesetting.html An example of what cl-typesetting can do is here: http://www.fractalconcept.com/ex.pdf (Try to do this with your favorite typesetting system ;-) This project is still looking for contributors... Marc From divanov at aha.ru Mon Feb 9 14:10:36 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 9 Feb 2004 17:10:36 +0300 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerning globally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> Message-ID: <003001c3ef16$a0184550$945702c3@digo> Hello, | Is there any way to switch off these two facilities? I endeavor to | make PDF file size smaller. I meant to ask about the three things: - usual word wrapping behavior but without trying to hyphenate, - usual TJ adjustment between words but without kerning between characters, - respecting newline characters. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Mon Feb 9 09:50:39 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 9 Feb 2004 12:50:39 +0300 Subject: [cl-typesetting-devel] National language example References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> Message-ID: <002401c3eef2$4d33c2c0$945702c3@digo> Hello, I have succeeded in generating a PDF containing a Cyrillic font with CL-Typesetting. See the difference file attached. The resulting PDF file, the modified example source, fonts, and other auxiliary files can be found on lisp.ystok.ru/cl-pdf.html Please let me know whether you can watch ex-1251.pdf without problem. -- Sincerely, Dmitri Ivanov lisp.ystok.ru -------------- next part -------------- A non-text attachment was scrubbed... Name: all-lisp.diff Type: application/octet-stream Size: 2307 bytes Desc: not available URL: From marc.battyani at fractalconcept.com Mon Feb 9 17:59:29 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 9 Feb 2004 18:59:29 +0100 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerningglobally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> Message-ID: <16ca01c3ef36$779bd680$0303a8c0@marc2> Hi Dmitri, > | Is there any way to switch off these two facilities? I endeavor to > | make PDF file size smaller. ?? > I meant to ask about the three things: > - usual word wrapping behavior but without trying to hyphenate, > - usual TJ adjustment between words but without kerning between characters, > - respecting newline characters. Have a look at #'put-source-code-string that does most of this. As the name implies it's meant to typeset source code text. For more general text I can't see why you would like to disable char kerning ? Hyphenation would benefit from a special variable holding the language (or nil) and functions/macros to deal with it (set-hyphenation-language, with-no-hyphenation, etc.) Marc From marc.battyani at fractalconcept.com Mon Feb 9 18:40:24 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 9 Feb 2004 19:40:24 +0100 Subject: [cl-typesetting-devel] National language example References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <002401c3eef2$4d33c2c0$945702c3@digo> Message-ID: <170001c3ef3c$2f029340$0303a8c0@marc2> > I have succeeded in generating a PDF containing a Cyrillic font with > CL-Typesetting. See the difference file attached. Great! > The resulting PDF file, the modified example source, fonts, and other > auxiliary files can be found on > lisp.ystok.ru/cl-pdf.html > > Please let me know whether you can watch ex-1251.pdf without problem. No problem for me. (Accrobat 5, Windows XP) Though there are 2 lines ending with a comma which are not correctly justified. Marc From divanov at aha.ru Mon Feb 9 11:41:02 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 9 Feb 2004 14:41:02 +0300 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerning globally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> Message-ID: <002501c3ef01$b7a9a520$945702c3@digo> Hello, Is there any way to switch off these two facilities? I endeavor to make PDF file size smaller. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Mon Feb 9 19:02:22 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 9 Feb 2004 22:02:22 +0300 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerningglobally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> <16ca01c3ef36$779bd680$0303a8c0@marc2> Message-ID: <005501c3ef3f$731dd960$945702c3@digo> Hello Marc, |> I meant to ask about the three things: |> - usual word wrapping behavior but without trying to hyphenate, |> - usual TJ adjustment between words but without kerning between |> characters, |> - respecting newline characters. | | Have a look at #'put-source-code-string that does most of this. | As the name implies it's meant to typeset source code text. For more | general text I can't see why you would like to disable char kerning ? In an PDF document where text prevails, without graphics or font embedded, a good portion of it is occupied by "(char1) n1 (char2) n2 ... TJ" sequences. In the application domain I am targeting at - printing database records in a tabular form - built-in Acrobat Reader capabilities for char kerning would be quite enough. OTOH, adding stuff for easily defining page dimensions, headers, footers, margins, and multi-page tables is of higher priority. I could look closer at those if you gave some guidelines. | Hyphenation would benefit from a special variable holding the language | (or nil) and functions/macros to deal with it | (set-hyphenation-language, with-no-hyphenation, etc.) Agree. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From peter at javamonkey.com Mon Feb 9 19:43:01 2004 From: peter at javamonkey.com (Peter Seibel) Date: Mon, 09 Feb 2004 19:43:01 -0000 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerningglobally? In-Reply-To: <16ca01c3ef36$779bd680$0303a8c0@marc2> References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> <16ca01c3ef36$779bd680$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > Hi Dmitri, > > > | Is there any way to switch off these two facilities? I endeavor to > > | make PDF file size smaller. > > ?? > > > I meant to ask about the three things: > > - usual word wrapping behavior but without trying to hyphenate, > > - usual TJ adjustment between words but without kerning between > characters, > > - respecting newline characters. > > Have a look at #'put-source-code-string that does most of this. > As the name implies it's meant to typeset source code text. For more general > text I can't see why you would like to disable char kerning ? > > Hyphenation would benefit from a special variable holding the language (or > nil) and functions/macros to deal with it (set-hyphenation-language, > with-no-hyphenation, etc.) Yes. This would be useful. The put-source-code-string is perfect for whole paragraphs of source code but I also want to be able to mark a span of text within a paragraph as not to be hyphenated. Another related feature would be to have a way to mark a string of text as not to be broken on whitespace. I use this in my HTML styles for inline code snippets to prevent "(foo bar baz)" from getting broken like "(foo bar baz)" -Peter P.S. The beginning-of-page formatting lossage is still happening--I have the latest cl-pdf and cl-typesetting from subversion. I'm not sure how to characterize the problem it except that the first paragraph of each page has some fairly high probability of having its formatting screwed up in some way, often manifesting as characters getting run together and overlapped, sometimes by reverting to the default font. Without my patch this happens on every page; with my patch it only happens sometimes. Note that I'm adding a header to my page; that may have something to do with it. My latest code is at: An output file that exhibits the problem is at: -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Mon Feb 9 20:03:51 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 9 Feb 2004 21:03:51 +0100 Subject: [cl-typesetting-devel] Q: How to disable hyphenation and kerningglobally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> <16ca01c3ef36$779bd680$0303a8c0@marc2> <005501c3ef3f$731dd960$945702c3@digo> Message-ID: <179d01c3ef47$d7255390$0303a8c0@marc2> > | Have a look at #'put-source-code-string that does most of this. > | As the name implies it's meant to typeset source code text. For more > | general text I can't see why you would like to disable char kerning ? > > In an PDF document where text prevails, without graphics or font embedded, a > good portion of it is occupied by "(char1) n1 (char2) n2 ... TJ" sequences. > In the application domain I am targeting at - printing database records in a > tabular form - built-in Acrobat Reader capabilities for char kerning would > be quite enough. Acrobat will not do kerning on its own, otherwise text length would not be equal to the sum of the char widths. But I see what you mean, I have code in stroke to deal with this and output compact pdf strings when there is no extra char spacing. #'put-source-code-string should be ok. > OTOH, adding stuff for easily defining page dimensions, headers, footers, > margins, and multi-page tables is of higher priority. I could look closer at > those if you gave some guidelines. The most missing point to start is multi-page tables. Though to start with tables it's probably easier to do some simple improvements like specifying styles for the top/left/bottom/right borders of cell/rows/table, col-span, default style, etc... > | Hyphenation would benefit from a special variable holding the language > | (or nil) and functions/macros to deal with it > | (set-hyphenation-language, with-no-hyphenation, etc.) > > Agree. Marc From amoroso at mclink.it Mon Feb 9 20:23:39 2004 From: amoroso at mclink.it (Paolo Amoroso) Date: Mon, 09 Feb 2004 21:23:39 +0100 Subject: [cl-typesetting-devel] National language example In-Reply-To: <002401c3eef2$4d33c2c0$945702c3@digo> (Dmitri Ivanov's message of "Mon, 9 Feb 2004 12:50:39 +0300") References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <002401c3eef2$4d33c2c0$945702c3@digo> Message-ID: <877jywj92s.fsf@plato.moon.paoloamoroso.it> "Dmitri Ivanov" writes: > I have succeeded in generating a PDF containing a Cyrillic font with > CL-Typesetting. See the difference file attached. [...] > Please let me know whether you can watch ex-1251.pdf without problem. Da :) I can correctly see the file with Acrobat Reader 5.0.8, Xpdf 1.0 and gv 3.5.8 for Linux under Debian Woody. But Xpdf displays the following errors: Error (29491): Bad DCT Adobe APP14 marker Error (61467): Bad DCT Adobe APP14 marker Paolo -- Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film From marc.battyani at fractalconcept.com Mon Feb 9 20:28:35 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 9 Feb 2004 21:28:35 +0100 Subject: [cl-typesetting-devel] National language example References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2><002401c3eef2$4d33c2c0$945702c3@digo> <877jywj92s.fsf@plato.moon.paoloamoroso.it> Message-ID: <17f001c3ef4b$4bcd0960$0303a8c0@marc2> "Paolo Amoroso" write: > "Dmitri Ivanov" writes: > > > I have succeeded in generating a PDF containing a Cyrillic font with > > CL-Typesetting. See the difference file attached. > [...] > > Please let me know whether you can watch ex-1251.pdf without problem. > > Da :) > > I can correctly see the file with Acrobat Reader 5.0.8, Xpdf 1.0 and > gv 3.5.8 for Linux under Debian Woody. But Xpdf displays the following > errors: > > Error (29491): Bad DCT Adobe APP14 marker > Error (61467): Bad DCT Adobe APP14 marker This is a problem related to the jpg images. Xpdf does not like the ones I created with Photoshop. Marc From marc.battyani at fractalconcept.com Mon Feb 9 22:23:25 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 9 Feb 2004 23:23:25 +0100 Subject: [cl-typesetting-devel] Q: How to disable hyphenation andkerningglobally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2><003001c3ef16$a0184550$945702c3@digo><16ca01c3ef36$779bd680$0303a8c0@marc2> Message-ID: <188601c3ef5b$564bdaa0$0303a8c0@marc2> Peter Seibel writes: > "Marc Battyani" writes: > > > Hyphenation would benefit from a special variable holding the language (or > > nil) and functions/macros to deal with it (set-hyphenation-language, > > with-no-hyphenation, etc.) > > Yes. This would be useful. The put-source-code-string is perfect for > whole paragraphs of source code but I also want to be able to mark a > span of text within a paragraph as not to be hyphenated. Another > related feature would be to have a way to mark a string of text as not > to be broken on whitespace. I use this in my HTML styles for inline > code snippets to prevent "(foo bar baz)" from getting broken like "(foo > bar baz)" This one is a small one. I will try to find the time to do it. > P.S. The beginning-of-page formatting lossage is still happening--I > have the latest cl-pdf and cl-typesetting from subversion. I'm not > sure how to characterize the problem it except that the first > paragraph of each page has some fairly high probability of having its > formatting screwed up in some way, often manifesting as characters > getting run together and overlapped, sometimes by reverting to the > default font. Without my patch this happens on every page; with my > patch it only happens sometimes. Note that I'm adding a header to my > page; that may have something to do with it. My latest code is at: > > > > An output file that exhibits the problem is at: > > Quite nice! (well except for the bug) Your code seems ok for me when I look at it. If you send me some working toy exemple reproducing the problem I will look at it. It could be a mismatch between my graphic state and the pdf's one. Marc From erik at nittin.net Tue Feb 10 22:41:39 2004 From: erik at nittin.net (Erik Enge) Date: Tue, 10 Feb 2004 17:41:39 -0500 Subject: [cl-typesetting-devel] Non-macro interface to building documents. Message-ID: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> I have a list of objects. Each object has three slots: name, telephone, age. I'd like to make a PDF document that displays this information in neat tables. The only thing I don't know is how many objects there are in my list. (defun testpdf (&optional (file #P"/tmp/test.pdf")) (pdf:with-document () (pdf:with-page () (pdf:with-outline-level ("Example" (pdf:register-page-reference)) (pdf:set-line-width 0.1) (let ((content (typeset::compile-text () (typeset:paragraph (:font "Helvetica-Bold" :font-size 16) "Test document") (typeset:hrule :dy 2) (typeset:table (:col-widths '(100 430) :border 0) (typeset:row () (typeset:cell () (typeset:paragraph () "Name")) (typeset:cell () (typeset:paragraph () "Erik Enge"))) (typeset:row () (typeset:cell () (typeset:paragraph () "Telephone")) (typeset:cell () (typeset:paragraph () "555-1234"))) (typeset:row () (typeset:cell () (typeset:paragraph () "Age")) (typeset:cell () (typeset:paragraph () "25"))))))) (typeset::draw-block content 20 800 545 700 0)))) (pdf:write-document file))) Can someone show me how I would turn that code into code that would essentially do the same thing for a list of objects, as described at the top of the mail? I have read typo.lisp and tables.lisp but there doesn't seem to be a functional equivalent to the table macro. Thanks in advance, Erik. From david.cooper at genworks.com Tue Feb 10 22:54:51 2004 From: david.cooper at genworks.com (David J Cooper Jr) Date: Tue, 10 Feb 2004 17:54:51 -0500 Subject: [cl-typesetting-devel] Non-macro interface to building documents. In-Reply-To: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> Message-ID: <16425.24891.306260.248596@mccarthy.genworks.com> Hi Erik, Assuming you have a list of objects in the variable "objects," try something like this: ... (typeset:table () (dolist (object objects) (typeset:row () (typest:cell () (typeset:paragraph () (typeset:put-string (slot-value object 'name)))) (typest:cell () (typeset:paragraph () (typeset:put-string (slot-value object 'telephone)))) (typest:cell () (typeset:paragraph () (typeset:put-string (slot-value object 'age))))))) ... -dave Erik Enge writes: > I have a list of objects. Each object has three slots: name, > telephone, age. I'd like to make > a PDF document that displays this information in neat tables. The only > thing I don't know is > how many objects there are in my list. > > (defun testpdf (&optional (file #P"/tmp/test.pdf")) > (pdf:with-document () > (pdf:with-page () > (pdf:with-outline-level ("Example" (pdf:register-page-reference)) > (pdf:set-line-width 0.1) > (let ((content > (typeset::compile-text () > (typeset:paragraph (:font "Helvetica-Bold" :font-size > 16) > "Test document") > (typeset:hrule :dy 2) > (typeset:table (:col-widths '(100 430) :border 0) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Name")) > (typeset:cell () > (typeset:paragraph () > "Erik Enge"))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Telephone")) > (typeset:cell () > (typeset:paragraph () > "555-1234"))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Age")) > (typeset:cell () > (typeset:paragraph () > "25"))))))) > (typeset::draw-block content 20 800 545 700 0)))) > (pdf:write-document file))) > > Can someone show me how I would turn that code into code that would > essentially do the > same thing for a list of objects, as described at the top of the mail? > I have read typo.lisp > and tables.lisp but there doesn't seem to be a functional equivalent to > the table macro. > > Thanks in advance, > > Erik. > > > _______________________________________________ > cl-typesetting-devel site list > cl-typesetting-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-typesetting-devel > > From marc.battyani at fractalconcept.com Tue Feb 10 22:56:15 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 10 Feb 2004 23:56:15 +0100 Subject: [cl-typesetting-devel] Non-macro interface to building documents. References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> Message-ID: <1d4d01c3f029$17509bf0$0303a8c0@marc2> Erik Enge writes > I have a list of objects. Each object has three slots: name, > telephone, age. I'd like to make > a PDF document that displays this information in neat tables. The only > thing I don't know is > how many objects there are in my list. > > (defun testpdf (&optional (file #P"/tmp/test.pdf")) > (pdf:with-document () > (pdf:with-page () > (pdf:with-outline-level ("Example" (pdf:register-page-reference)) > (pdf:set-line-width 0.1) > (let ((content > (typeset::compile-text () > (typeset:paragraph (:font "Helvetica-Bold" :font-size > 16) > "Test document") > (typeset:hrule :dy 2) > (typeset:table (:col-widths '(100 430) :border 0) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Name")) > (typeset:cell () > (typeset:paragraph () > "Erik Enge"))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Telephone")) > (typeset:cell () > (typeset:paragraph () > "555-1234"))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Age")) > (typeset:cell () > (typeset:paragraph () > "25"))))))) > (typeset::draw-block content 20 800 545 700 0)))) > (pdf:write-document file))) > > Can someone show me how I would turn that code into code that would > essentially do the > same thing for a list of objects, as described at the top of the mail? > I have read typo.lisp > and tables.lisp but there doesn't seem to be a functional equivalent to > the table macro. Why do you want a functional interface ? It works directly with the macros: You can even put the loop into a separate defun and it with work thanks to the special var bindings :) (defun testpdf (&optional (file #P"/tmp/test.pdf")) (pdf:with-document () (pdf:with-page () (pdf:with-outline-level ("Example" (pdf:register-page-reference)) (pdf:set-line-width 0.1) (let ((content (typeset::compile-text () (typeset:paragraph (:font "Helvetica-Bold" :font-size 16) "Test document") (typeset:hrule :dy 2) (typeset:table (:col-widths '(100 430) :border 0) (loop for (name tel age) in '(("Erik Enge" "555-1234" "25") ("Erik Enge" "555-1234" "25") ("Erik Enge" "555-1234" "25") ("Erik Enge" "555-1234" "25") ("Erik Enge" "555-1234" "25")) do (typeset:row () (typeset:cell () (typeset:paragraph () "Name")) (typeset:cell () (typeset:paragraph () name))) (typeset:row () (typeset:cell () (typeset:paragraph () "Telephone")) (typeset:cell () (typeset:paragraph () tel))) (typeset:row () (typeset:cell () (typeset:paragraph () "Age")) (typeset:cell () (typeset:paragraph () age)))))))) (typeset::draw-block content 20 800 545 700 0)))) (pdf:write-document file))) Marc From marc.battyani at fractalconcept.com Tue Feb 10 23:04:01 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 11 Feb 2004 00:04:01 +0100 Subject: [cl-typesetting-devel] Non-macro interface to building documents. References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> <1d4d01c3f029$17509bf0$0303a8c0@marc2> Message-ID: <1d6101c3f02a$2d27edb0$0303a8c0@marc2> Marc Battyani writes: > (loop for (name tel age) in '(("Erik Enge" "555-1234" "25") > ("Erik Enge" "555-1234" "25") > ("Erik Enge" "555-1234" "25") > ("Erik Enge" "555-1234" "25") > ("Erik Enge" "555-1234" "25")) > do > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Name")) > (typeset:cell () > (typeset:paragraph () > name))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Telephone")) > (typeset:cell () > (typeset:paragraph () > tel))) > (typeset:row () > (typeset:cell () > (typeset:paragraph () > "Age")) > (typeset:cell () > (typeset:paragraph () > age)))))))) Warning: the table are not multi-page so far. So you should use a table for each row if you don't want to have problems when the table height exceed the draw-block height. Patches for multi-page tables are welcomed! (Dmitri ?) Marc From erik at nittin.net Wed Feb 11 02:13:53 2004 From: erik at nittin.net (Erik Enge) Date: Tue, 10 Feb 2004 21:13:53 -0500 Subject: [cl-typesetting-devel] Non-macro interface to building documents. In-Reply-To: <1d4d01c3f029$17509bf0$0303a8c0@marc2> References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> <1d4d01c3f029$17509bf0$0303a8c0@marc2> Message-ID: On Feb 10, 2004, at 5:56 PM, Marc Battyani wrote: > It works directly with the macros: Thank you both, you're right. I was so sure I had tested it and found it not to work but I must have gotten confused somewhere along the way. Thanks for the help and cl-typesetting! :-) Erik. From marc.battyani at fractalconcept.com Wed Feb 11 16:47:48 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 11 Feb 2004 17:47:48 +0100 Subject: [cl-typesetting-devel] Added new-page References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net><1d4d01c3f029$17509bf0$0303a8c0@marc2> Message-ID: <1fe301c3f0be$c87ca410$0303a8c0@marc2> Added #'new-page (or :eop) to force a page break. Marc From peter at javamonkey.com Wed Feb 11 22:26:54 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 11 Feb 2004 22:26:54 -0000 Subject: [cl-typesetting-devel] Q: How to disable hyphenation andkerningglobally? In-Reply-To: <188601c3ef5b$564bdaa0$0303a8c0@marc2> References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> <16ca01c3ef36$779bd680$0303a8c0@marc2> <188601c3ef5b$564bdaa0$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > Peter Seibel writes: > > P.S. The beginning-of-page formatting lossage is still > > happening--I have the latest cl-pdf and cl-typesetting from > > subversion. I'm not sure how to characterize the problem it except > > that the first paragraph of each page has some fairly high > > probability of having its formatting screwed up in some way, often > > manifesting as characters getting run together and overlapped, > > sometimes by reverting to the default font. Without my patch this > > happens on every page; with my patch it only happens sometimes. > > Note that I'm adding a header to my page; that may have something > > to do with it. My latest code is at: > > > > > > > > An output file that exhibits the problem is at: > > > > > > Quite nice! (well except for the bug) > > Your code seems ok for me when I look at it. If you send me some > working toy exemple reproducing the problem I will look at it. It > could be a mismatch between my graphic state and the pdf's one. Okay. Here's some standalone code that demonstrates the problem. If you take out the line that strokes the header box, it doesn't show up. (BTW, this is running against the latest cl-typesetting without my patch. With my patch the problem doesn't manifest on this document but still does on more complex docs.) (defun bug (&optional (file #P"/tmp/hello.pdf")) (let ((paragraphs (loop repeat 20 collect (format nil "~{~a~^ ~}" (loop repeat 20 collect "The quick brown fox jumps over the lazy dog.")))) (width 612) (height 792) (margins '(108 36 108 108)) (header-height (- 108 36))) (pdf:with-document () (let ((content (typeset::compile-text () (dolist (p paragraphs) (typeset::paragraph (:h-align :left :font "Times-Roman" :font-size 12) (typeset::vspace 12) (typeset::put-string p)))))) (loop for header = (typeset::compile-text () (typeset::paragraph (:h-align :right :font "Times-Roman" :font-size 12) (typeset::put-string "HEADER") :eol)) while (typeset::boxes content) do (destructuring-bind (left &optional (top left) (right left) (bottom top)) margins (let ((x left) (y (- height top)) (dx (- width left right)) (dy (- height top bottom))) (pdf:with-page (:bounds (vector 0 0 width height)) (pdf:with-saved-state (typeset::stroke (typeset::make-filled-vbox header dx header-height :top) x y)) (typeset::stroke (typeset::make-filled-vbox content dx (- dy header-height) :top) x (- y header-height))))))) (pdf:write-document file)))) -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Sat Feb 14 21:31:05 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 14 Feb 2004 22:31:05 +0100 Subject: [cl-typesetting-devel] Q: How to disable hyphenationandkerningglobally? References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2><003001c3ef16$a0184550$945702c3@digo><16ca01c3ef36$779bd680$0303a8c0@marc2> <188601c3ef5b$564bdaa0$0303a8c0@marc2> Message-ID: <023401c3f341$dd431250$0303a8c0@marc2> "Peter Seibel" writes: > Okay. Here's some standalone code that demonstrates the problem. If > you take out the line that strokes the header box, it doesn't show up. > (BTW, this is running against the latest cl-typesetting without my > patch. With my patch the problem doesn't manifest on this document but > still does on more complex docs.) [snipped code example] Fixed! It was layout time vs stroke time issue. The text style saving/restoring was handled correctly during the layout but not during the stroke on the page. Please tell me it it works for your real code now. Marc From peter at javamonkey.com Sat Feb 14 23:01:12 2004 From: peter at javamonkey.com (Peter Seibel) Date: Sat, 14 Feb 2004 23:01:12 -0000 Subject: [cl-typesetting-devel] Q: How to disable hyphenationandkerningglobally? In-Reply-To: <023401c3f341$dd431250$0303a8c0@marc2> References: <098d01c3ee5e$2ed95f40$0303a8c0@marc2> <003001c3ef16$a0184550$945702c3@digo> <16ca01c3ef36$779bd680$0303a8c0@marc2> <188601c3ef5b$564bdaa0$0303a8c0@marc2> <023401c3f341$dd431250$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > > > Okay. Here's some standalone code that demonstrates the problem. If > > you take out the line that strokes the header box, it doesn't show up. > > (BTW, this is running against the latest cl-typesetting without my > > patch. With my patch the problem doesn't manifest on this document but > > still does on more complex docs.) > > [snipped code example] > > Fixed! > It was layout time vs stroke time issue. The text style saving/restoring was > handled correctly during the layout but not during the stroke on the page. > Please tell me it it works for your real code now. Looks good! Thanks. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Mon Feb 16 20:03:03 2004 From: peter at javamonkey.com (Peter Seibel) Date: Mon, 16 Feb 2004 20:03:03 -0000 Subject: [cl-typesetting-devel] Non-macro interface to building documents. In-Reply-To: <1d6101c3f02a$2d27edb0$0303a8c0@marc2> References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net> <1d4d01c3f029$17509bf0$0303a8c0@marc2> <1d6101c3f02a$2d27edb0$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > Marc Battyani writes: > > > > (loop for (name tel age) in '(("Erik Enge" "555-1234" "25") > > ("Erik Enge" "555-1234" "25") > > ("Erik Enge" "555-1234" "25") > > ("Erik Enge" "555-1234" "25") > > ("Erik Enge" "555-1234" "25")) > > do > > (typeset:row () > > (typeset:cell () > > (typeset:paragraph () > > "Name")) > > (typeset:cell () > > (typeset:paragraph () > > name))) > > (typeset:row () > > (typeset:cell () > > (typeset:paragraph () > > "Telephone")) > > (typeset:cell () > > (typeset:paragraph () > > tel))) > > (typeset:row () > > (typeset:cell () > > (typeset:paragraph () > > "Age")) > > (typeset:cell () > > (typeset:paragraph () > > age)))))))) > > Warning: the table are not multi-page so far. So you should use a > table for each row if you don't want to have problems when the table > height exceed the draw-block height. So it seems that when a table is too big to fit in a page the typesetting engine gets stuck in a loop, allocating more and more memory. Unless someone's got a multi-page-table patch waiting in the wings it might be nice to at least detect that condition and emit a warning, giving up on the table? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Mon Feb 16 20:15:54 2004 From: peter at javamonkey.com (Peter Seibel) Date: Mon, 16 Feb 2004 20:15:54 -0000 Subject: [cl-typesetting-devel] keep-with-next and preventing widows and orphans Message-ID: What's the best way to implement a keep-with-next style that ensures that a given paragraph is not separated from the following paragraph. For instance, I don't want a subheading to be the last thing on a page--I'd rather it get moved to the next page so it is with the first paragraph of the subsection. On a related note, is there any way to prevent widows (the first line of a multiline paragraph set as the last line of a page) and orphans (the last line of a multiline paragraph set as the first line of a page)? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Mon Feb 16 23:04:59 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 17 Feb 2004 00:04:59 +0100 Subject: [cl-typesetting-devel] Non-macro interface to building documents. References: <4A3833F7-5C1A-11D8-B941-000A95CEC334@nittin.net><1d4d01c3f029$17509bf0$0303a8c0@marc2><1d6101c3f02a$2d27edb0$0303a8c0@marc2> Message-ID: <09a801c3f4e1$50209f40$0303a8c0@marc2> "Peter Seibel" writes: > "Marc Battyani" writes: > > > > > Warning: the table are not multi-page so far. So you should use a > > table for each row if you don't want to have problems when the table > > height exceed the draw-block height. > > So it seems that when a table is too big to fit in a page the > typesetting engine gets stuck in a loop, allocating more and more > memory. Unless someone's got a multi-page-table patch waiting in the > wings it might be nice to at least detect that condition and emit a > warning, giving up on the table? When an object is too big to fit in the rest of the page, cl-typesetting goes to the next page. If it can't fit the object in the new page it should signal an error "could not fit anything". I will look at this. My emptiness test is probably not good enough. The easy work around is to make one separate table for each line. It's a poor substitute but at least it works. Marc From marc.battyani at fractalconcept.com Mon Feb 16 23:05:13 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 17 Feb 2004 00:05:13 +0100 Subject: [cl-typesetting-devel] keep-with-next and preventing widows andorphans References: Message-ID: <09a901c3f4e1$56d192e0$0303a8c0@marc2> "Peter Seibel" writes: > What's the best way to implement a keep-with-next style that ensures > that a given paragraph is not separated from the following paragraph. > For instance, I don't want a subheading to be the last thing on a > page--I'd rather it get moved to the next page so it is with the first > paragraph of the subsection. > > On a related note, is there any way to prevent widows (the first line > of a multiline paragraph set as the last line of a page) and orphans > (the last line of a multiline paragraph set as the first line of a > page)? There is nothing for this now. And no work around either I'm afraid :( Marc From peter at javamonkey.com Fri Feb 20 20:44:05 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 20 Feb 2004 20:44:05 -0000 Subject: [cl-typesetting-devel] How to change line spacing? Message-ID: I may be missing something obvious but how do I change the spacing between lines in a paragraph? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Fri Feb 20 22:45:18 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 20 Feb 2004 23:45:18 +0100 Subject: [cl-typesetting-devel] How to change line spacing? References: Message-ID: <00c801c3f803$4c6a6fa0$0303a8c0@marc2> "Peter Seibel" writes: > I may be missing something obvious but how do I change the spacing > between lines in a paragraph? Nothing of this is obvious as there is no docs and the higher level functionalities are not finished. The *leading* variable is what you need. But as it is computed when you change the font or font size it will be difficult to use. For instance it will be recomputed when the style is restored at the beginning of a new page. I will add some *forced-leading* variable to handle this. Marc From peter at javamonkey.com Fri Feb 20 23:51:32 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 20 Feb 2004 23:51:32 -0000 Subject: [cl-typesetting-devel] How to change line spacing? In-Reply-To: <00c801c3f803$4c6a6fa0$0303a8c0@marc2> References: <00c801c3f803$4c6a6fa0$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > > > I may be missing something obvious but how do I change the spacing > > between lines in a paragraph? > > Nothing of this is obvious as there is no docs and the higher level > functionalities are not finished. > > The *leading* variable is what you need. But as it is computed when > you change the font or font size it will be difficult to use. For > instance it will be recomputed when the style is restored at the > beginning of a new page. I will add some *forced-leading* variable > to handle this. Hmmm. I was able to get most of what I want by binding typeset::*leading-ratio* to appropriate values at appropriate times. Though I was sort of hoping for something in the options to the typeset::paragraph macro to let my specify it directly per paragraph. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Tue Feb 24 18:10:36 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 24 Feb 2004 18:10:36 -0000 Subject: [cl-typesetting-devel] Problem with svn server? Message-ID: Is the subversion server for cl-typesetting (and cl-pdf) down? I'm suddenly getting this error when I try to update: [peter at xeon cl-typesetting]$ svn update svn: Unsupported repository version svn: PROPFIND request failed on '/svn/public/cl-typesetting' svn: Could not open the requested SVN filesystem [peter at xeon cl-typesetting]$ -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Tue Feb 24 18:16:03 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 24 Feb 2004 19:16:03 +0100 Subject: [cl-typesetting-devel] Problem with svn server? References: Message-ID: <0ada01c3fb02$458275f0$0303a8c0@marc2> "Peter Seibel" writes: > Is the subversion server for cl-typesetting (and cl-pdf) down? I'm > suddenly getting this error when I try to update: > > [peter at xeon cl-typesetting]$ svn update > svn: Unsupported repository version > svn: PROPFIND request failed on '/svn/public/cl-typesetting' > svn: > Could not open the requested SVN filesystem Yes, I made an apt-get upgrade on the Debian box. It has upgraded subversion and now all the repositories are down. :( Subversion should be written in Lisp! BTW if a subversion specialist reads this and has a clue, I'm interested. Marc From marc.battyani at fractalconcept.com Tue Feb 24 19:05:05 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 24 Feb 2004 20:05:05 +0100 Subject: [cl-typesetting-devel] Problem with svn server? References: <0ada01c3fb02$458275f0$0303a8c0@marc2> Message-ID: <0b2401c3fb09$1d7f3820$0303a8c0@marc2> "Marc Battyani" writes: > "Peter Seibel" writes: > > > Is the subversion server for cl-typesetting (and cl-pdf) down? I'm > > suddenly getting this error when I try to update: > > > > [peter at xeon cl-typesetting]$ svn update > > svn: Unsupported repository version > > svn: PROPFIND request failed on '/svn/public/cl-typesetting' > > svn: > > Could not open the requested SVN filesystem > > Yes, I made an apt-get upgrade on the Debian box. It has upgraded subversion > and now all the repositories are down. :( > Subversion should be written in Lisp! It seems that the subversion database schema has changed and I should have done a dump with the old subversion followed by a load with the new version. I will try to un-install the new version to put the old one back. Marc From peter at javamonkey.com Tue Feb 24 19:57:52 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 24 Feb 2004 19:57:52 -0000 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. Message-ID: Hmmm. The formatting across pages bug that we thought was fixed seems to be back. Check out the top of page 5 in: If I get a chance I'll try to investigate more but I figured I'd let you know while it's still somewhat fresh in your mind. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From erik at nittin.net Tue Feb 24 20:17:57 2004 From: erik at nittin.net (Erik Enge) Date: Tue, 24 Feb 2004 15:17:57 -0500 Subject: [cl-typesetting-devel] Letter, A4, etc. Message-ID: <88F39F79-6706-11D8-BBCC-000A95CEC334@nittin.net> Can I control whether the PDF created will be in letter or a4 format? Thanks, Erik. From marc.battyani at fractalconcept.com Tue Feb 24 20:38:22 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 24 Feb 2004 21:38:22 +0100 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. References: Message-ID: <0b8401c3fb16$25f7b970$0303a8c0@marc2> "Peter Seibel" writes: > Hmmm. The formatting across pages bug that we thought was fixed seems > to be back. Check out the top of page 5 in: > > > > If I get a chance I'll try to investigate more but I figured I'd let > you know while it's still somewhat fresh in your mind. I will look at this. Looking at your example, it seems that only 2 pages are affected. Are they different in some way ? BTW It's a nice example. Marc From marc.battyani at fractalconcept.com Tue Feb 24 20:43:33 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Tue, 24 Feb 2004 21:43:33 +0100 Subject: [cl-typesetting-devel] Letter, A4, etc. References: <88F39F79-6706-11D8-BBCC-000A95CEC334@nittin.net> Message-ID: <0b8d01c3fb16$df66e2a0$0303a8c0@marc2> "Erik Enge" writes: > Can I control whether the PDF created will be in letter or a4 format? In a PDF file, each page can have a different size. Just use a :bounds #(0 0 612 792) (8.5x11 inches in 1/72 inches units) in the pdf:with-page (pdf:with-page (:bounds #(0 0 612 792)) ...) Marc From peter at javamonkey.com Tue Feb 24 22:30:55 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 24 Feb 2004 22:30:55 -0000 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. In-Reply-To: <0b8401c3fb16$25f7b970$0303a8c0@marc2> References: <0b8401c3fb16$25f7b970$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > > > Hmmm. The formatting across pages bug that we thought was fixed seems > > to be back. Check out the top of page 5 in: > > > > > > > > If I get a chance I'll try to investigate more but I figured I'd let > > you know while it's still somewhat fresh in your mind. > > I will look at this. Looking at your example, it seems that only 2 pages are > affected. Are they different in some way ? Not from my point of view. The only pattern that I can see (given this limited data set) is that in both cases where the formatting is broken, the first line on the new page contains character formatting that gets broken across the line (i.e. it starts on the first line and ends on the second line). On page 3 it's the ":if-exists" which is set in Courier and on page 5 it's the "WRITE-CHAR" which is set in Courier-Bold. In both cases that same formatting seems to get picked up by the beginning of the line. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Tue Feb 24 22:52:12 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 24 Feb 2004 22:52:12 -0000 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. In-Reply-To: References: <0b8401c3fb16$25f7b970$0303a8c0@marc2> Message-ID: Peter Seibel writes: > "Marc Battyani" writes: > > > "Peter Seibel" writes: > > > > > Hmmm. The formatting across pages bug that we thought was fixed seems > > > to be back. Check out the top of page 5 in: > > > > > > > > > > > > If I get a chance I'll try to investigate more but I figured I'd let > > > you know while it's still somewhat fresh in your mind. > > > > I will look at this. Looking at your example, it seems that only 2 pages are > > affected. Are they different in some way ? > > Not from my point of view. The only pattern that I can see (given this > limited data set) is that in both cases where the formatting is > broken, the first line on the new page contains character formatting > that gets broken across the line (i.e. it starts on the first line and > ends on the second line). On page 3 it's the ":if-exists" which is set > in Courier and on page 5 it's the "WRITE-CHAR" which is set in > Courier-Bold. In both cases that same formatting seems to get picked > up by the beginning of the line. And that indeed seems to be the pattern as this standalone example shows: (defun bug (&optional (file #P"/tmp/hello.pdf")) (let ((width 612) (height 792) (margins '(108 36 108 108)) (header-height (- 108 36))) (pdf:with-document () (let ((content (typeset::compile-text () (dotimes (i 20) (typeset::paragraph (:h-align :left :font "Times-Roman" :font-size 12) (typeset::vspace 12) (dotimes (j 20) (cond ((and (= i 2) (= j 19)) (typeset::put-string (format nil "~d. " j)) (typeset::with-style (:font "Courier-Bold") (typeset::put-string "The quick")) (typeset::put-string " brown fox jumps over the lazy dog. ")) (t (typeset::put-string (format nil "~d. The quick brown fox jumps over the lazy dog. " j)))))))))) (loop for page-number from 1 for header = (typeset::compile-text () (typeset::paragraph (:h-align :right :font "Times-Roman" :font-size 12) (typeset::put-string "HEADER") :eol)) while (typeset::boxes content) do (destructuring-bind (left &optional (top left) (right left) (bottom top)) margins (let ((x left) (y (- height top)) (dx (- width left right)) (dy (- height top bottom))) (pdf:with-page (:bounds (vector 0 0 width height)) (pdf:with-saved-state (typeset::stroke (typeset::make-filled-vbox header dx header-height :top) x y)) (typeset::stroke (typeset::make-filled-vbox content dx (- dy header-height) :top) x (- y header-height))))))) (pdf:write-document file)))) -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Tue Feb 24 22:56:35 2004 From: peter at javamonkey.com (Peter Seibel) Date: Tue, 24 Feb 2004 22:56:35 -0000 Subject: [cl-typesetting-devel] A small layout glitch Message-ID: Here's what seems to be a glitch in the layout that I observed in the wild and reproduced in the lab. Certain (but not all) line breaks following a semicolon end up with an extra bit of space at the beginning of the following line. The function below demonstrates this. -Peter (defun weird-space-at-bol (&optional (file #P"/tmp/hello.pdf")) (let ((width 612) (height 792) (margins '(108 36 108 108)) (header-height (- 108 36))) (pdf:with-document () (let ((content (typeset::compile-text () (dotimes (i 20) (typeset::paragraph (:h-align :left :font "Times-Roman" :font-size 12) (typeset::vspace 12) (dotimes (j 20) (typeset::put-string (format nil "~d; The quick; brown; fox; jumps; over; the; lazy; dog; " j)))))))) (loop for page-number from 1 for header = (typeset::compile-text () (typeset::paragraph (:h-align :right :font "Times-Roman" :font-size 12) (typeset::put-string "HEADER") :eol)) while (typeset::boxes content) do (destructuring-bind (left &optional (top left) (right left) (bottom top)) margins (let ((x left) (y (- height top)) (dx (- width left right)) (dy (- height top bottom))) (pdf:with-page (:bounds (vector 0 0 width height)) (pdf:with-saved-state (typeset::stroke (typeset::make-filled-vbox header dx header-height :top) x y)) (typeset::stroke (typeset::make-filled-vbox content dx (- dy header-height) :top) x (- y header-height))))))) (pdf:write-document file)))) -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From erik at nittin.net Wed Feb 25 13:08:10 2004 From: erik at nittin.net (Erik Enge) Date: Wed, 25 Feb 2004 08:08:10 -0500 Subject: [cl-typesetting-devel] Border in printed document. Message-ID: I loop over boxes in content and do: (pdf:with-page (:bounds *letter-sized-page*) (pdf:set-line-width 0.0001) (typeset::draw-block content 20 800 545 700 0)))) for each. As you can see, I have been trying to manipulate the border using set-line-width and with the current setting I cannot see a line in my PDF viewer but when I print the document there is a faint line present. The same happen for the hello.pdf created by cl-typesetting. Without set-line-width or setting it to 0 or nil the line is much thicker. How can I make the line go away? Thanks, Erik. From peter at javamonkey.com Wed Feb 25 14:21:03 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 25 Feb 2004 14:21:03 -0000 Subject: [cl-typesetting-devel] Border in printed document. In-Reply-To: References: Message-ID: Erik Enge writes: > I loop over boxes in content and do: > > (pdf:with-page (:bounds *letter-sized-page*) > (pdf:set-line-width 0.0001) > (typeset::draw-block content 20 800 545 700 0)))) > > for each. As you can see, I have been trying to manipulate the border > using set-line-width and with the current setting I cannot see a line > in my PDF viewer but when I print the document there is a faint line > present. The same happen for the hello.pdf created by cl-typesetting. > Without set-line-width or setting it to 0 or nil the line is much > thicker. > > How can I make the line go away? Here's the function I use to draw pages. I think you just don't want to use draw-block (note, I have some other foo going on because I'm adding a header to each page): (defun draw-page (content header &key width height margins (header-height 12)) (destructuring-bind (left &optional (top left) (right left) (bottom top)) margins (let ((x left) (y (- height top)) (dx (- width left right)) (dy (- height top bottom))) (pdf:with-page (:bounds (vector 0 0 width height)) (pdf:with-saved-state (typeset::stroke (typeset::make-filled-vbox header dx header-height :top) x y)) (typeset::stroke (typeset::make-filled-vbox content dx (- dy header-height) :top) x (- y header-height)))))) -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Wed Feb 25 20:59:24 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 25 Feb 2004 21:59:24 +0100 Subject: [cl-typesetting-devel] Border in printed document. References: Message-ID: <015a01c3fbe2$48708460$0303a8c0@marc2> "Erik Enge" writes: > I loop over boxes in content and do: > > (pdf:with-page (:bounds *letter-sized-page*) > (pdf:set-line-width 0.0001) > (typeset::draw-block content 20 800 545 700 0)))) > > for each. As you can see, I have been trying to manipulate the border > using set-line-width and with the current setting I cannot see a line > in my PDF viewer but when I print the document there is a faint line > present. The same happen for the hello.pdf created by cl-typesetting. > Without set-line-width or setting it to 0 or nil the line is much > thicker. > > How can I make the line go away? typeset::draw-block is in test.lisp only as an example. For now cl-typesetting is missing the higher level features like page layout description (page size, header/footer, columns, etc.). You should rather use some more complete function like the one posted by Peter. Marc From marc.battyani at fractalconcept.com Wed Feb 25 22:43:34 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 25 Feb 2004 23:43:34 +0100 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. References: <0b8401c3fb16$25f7b970$0303a8c0@marc2> Message-ID: <01fb01c3fbf0$de4cbe00$0303a8c0@marc2> "Peter Seibel" writes: > > Not from my point of view. The only pattern that I can see (given this > > limited data set) is that in both cases where the formatting is > > broken, the first line on the new page contains character formatting > > that gets broken across the line (i.e. it starts on the first line and > > ends on the second line). On page 3 it's the ":if-exists" which is set > > in Courier and on page 5 it's the "WRITE-CHAR" which is set in > > Courier-Bold. In both cases that same formatting seems to get picked > > up by the beginning of the line. > > And that indeed seems to be the pattern as this standalone example shows: [example...] Thanks for this torture test which was particularly wicked... ;-) Saving the style context has to somewhat unwind the style changes if a line does not fit on the page. As the repositories are still down for some unknown amount of time, I attach the fixed layout.lisp file. (I hope I don't bother anybody by doing that.) Marc -------------- next part -------------- A non-text attachment was scrubbed... Name: layout.lisp Type: application/octet-stream Size: 7242 bytes Desc: not available URL: From peter at javamonkey.com Wed Feb 25 22:54:14 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 25 Feb 2004 22:54:14 -0000 Subject: [cl-typesetting-devel] Formatting across pages bug not quite dead. In-Reply-To: <01fb01c3fbf0$de4cbe00$0303a8c0@marc2> References: <0b8401c3fb16$25f7b970$0303a8c0@marc2> <01fb01c3fbf0$de4cbe00$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > As the repositories are still down for some unknown amount of time, > I attach the fixed layout.lisp file. Cool. Thanks. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Thu Feb 26 10:14:14 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 26 Feb 2004 11:14:14 +0100 Subject: [cl-typesetting-devel] The source code repositories are back References: <0b8401c3fb16$25f7b970$0303a8c0@marc2> <01fb01c3fbf0$de4cbe00$0303a8c0@marc2> Message-ID: <033801c3fc51$49708fd0$0303a8c0@marc2> The cl-pdf and cl-typesetting repositories are on-line again. Revision 10: Multi-page layout fixes A simple enumerate macro (Thanks to Manuel Giraud) Marc From peter at javamonkey.com Fri Feb 27 17:17:23 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 27 Feb 2004 17:17:23 -0000 Subject: [cl-typesetting-devel] Hanging indent? Message-ID: I have a vague recollection I asked about this before but can't find it in my archive. Anyway, what's the easiest way to typeset a paragraph with a hanging indent. E.g. 1. The quick brown fox jumps over the lazy dog. Now is the time for all good men to come to the aid of their party. As opposed to: 1. The quick brown fox jumps over the lazy dog. Now is the time for all good men to come to the aid of their party. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Fri Feb 27 20:40:13 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 27 Feb 2004 21:40:13 +0100 Subject: [cl-typesetting-devel] Hanging indent? References: Message-ID: <01bf01c3fd71$e819c2c0$0303a8c0@marc2> "Peter Seibel" writes: > I have a vague recollection I asked about this before but can't find > it in my archive. Anyway, what's the easiest way to typeset a > paragraph with a hanging indent. E.g. > > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > all good men to come to the aid of their party. > > As opposed to: > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > all good men to come to the aid of their party. > The :first-line-indent argument of paragraph allows you to specify an offset for the first line. Negative values are ok. Something like: (paragraph (:h-align :justified :left-margin 10 :first-line-indent -10) ...) Marc From peter at javamonkey.com Fri Feb 27 21:12:31 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 27 Feb 2004 21:12:31 -0000 Subject: [cl-typesetting-devel] Hanging indent? In-Reply-To: <01bf01c3fd71$e819c2c0$0303a8c0@marc2> References: <01bf01c3fd71$e819c2c0$0303a8c0@marc2> Message-ID: "Marc Battyani" writes: > "Peter Seibel" writes: > > > I have a vague recollection I asked about this before but can't find > > it in my archive. Anyway, what's the easiest way to typeset a > > paragraph with a hanging indent. E.g. > > > > > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > > all good men to come to the aid of their party. > > > > As opposed to: > > > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > > all good men to come to the aid of their party. > > > > The :first-line-indent argument of paragraph allows you to specify an offset > for the first line. Negative values are ok. > > Something like: > (paragraph (:h-align :justified :left-margin 10 :first-line-indent -10) ...) Yeah. I found that after I posted. But that doesn't quite do the trick unless the negative indentation happens to exactly match the width of the chars I want to stick out. Is there any way, while compiling the contents to find out things like how wide the "1. " is going to be? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From peter at javamonkey.com Fri Feb 27 23:15:17 2004 From: peter at javamonkey.com (Peter Seibel) Date: Fri, 27 Feb 2004 23:15:17 -0000 Subject: [cl-typesetting-devel] Hanging indent? In-Reply-To: References: <01bf01c3fd71$e819c2c0$0303a8c0@marc2> Message-ID: Peter Seibel writes: > "Marc Battyani" writes: > > > "Peter Seibel" writes: > > > > > I have a vague recollection I asked about this before but can't find > > > it in my archive. Anyway, what's the easiest way to typeset a > > > paragraph with a hanging indent. E.g. > > > > > > > > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > > > all good men to come to the aid of their party. > > > > > > As opposed to: > > > > > > 1. The quick brown fox jumps over the lazy dog. Now is the time for > > > all good men to come to the aid of their party. > > > > > > > The :first-line-indent argument of paragraph allows you to specify an offset > > for the first line. Negative values are ok. > > > > Something like: > > (paragraph (:h-align :justified :left-margin 10 :first-line-indent -10) ...) > > Yeah. I found that after I posted. But that doesn't quite do the > trick unless the negative indentation happens to exactly match the > width of the chars I want to stick out. Is there any way, while > compiling the contents to find out things like how wide the "1. " is > going to be? Actually, I realized what I really want is a way to put a box after the number that will take up the *remaining* space, i.e. like a tab stop. That is, if my :first-line-indent is -10, I want a box of width (- 10 (width-of "1. ")) so that all the text lines up appropriately. Any easy way to do that? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp