From nedenis at gmail.com Mon Mar 5 13:50:07 2007 From: nedenis at gmail.com (Denis Mashkevich) Date: Mon, 5 Mar 2007 15:50:07 +0200 Subject: [cl-typesetting-devel] Paragraph Justification Message-ID: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> Hello, when generating paragraphs with (paragraph (:h-align :justify) ...), text is indeed justified, but so is the last (short) line of the paragraph, giving very ugly output (something like "last short line of the paragraph"). Is there a way around this issue? On a related note, how do I indent a first line of the paragraph? Thank you, Denis. From nedenis at gmail.com Mon Mar 5 13:57:33 2007 From: nedenis at gmail.com (Denis Mashkevich) Date: Mon, 5 Mar 2007 15:57:33 +0200 Subject: [cl-typesetting-devel] Non-breaking space Message-ID: Is there a way to put a non-breaking space, so that line won't be broken at this point? Thank you, Denis. From brian.sorg at liberatinginsight.com Mon Mar 5 14:24:21 2007 From: brian.sorg at liberatinginsight.com (Brian Sorg) Date: Mon, 05 Mar 2007 09:24:21 -0500 Subject: [cl-typesetting-devel] Paragraph Justification In-Reply-To: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> References: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> Message-ID: <45EC2815.3090303@liberatinginsight.com> Denis - Not sure how to solve your justification problem, but you can indent the first line of a paragraph using the :indent-first-line keyword to it. For example: (paragraph (:h-align :justified :top-margin 10 :first-line-indent 10 :font "Times-Italic" :font-size 9) "This typesetting system's goal is to be an alter") See the example function "full-example" in the typesetting test.lisp file for a working example. Brian Sorg Director & Founder Liberating Insight LLC Phone: 260-918-0490 Mobile: 260-602-1086 brian.sorg at liberatinginsight.com www.LiberatingInsight.com Denis Mashkevich wrote: > Hello, > > when generating paragraphs with (paragraph (:h-align :justify) ...), > text is indeed justified, but so is the last (short) line of the > paragraph, giving very ugly output (something like "last > short line of the paragraph"). Is there a way > around this issue? > > On a related note, how do I indent a first line of the paragraph? > > Thank you, Denis. > _______________________________________________ > 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 Mon Mar 5 22:08:29 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 5 Mar 2007 23:08:29 +0100 Subject: [cl-typesetting-devel] Calling functions within 'compile-text' References: <49201.68.44.154.215.1172330044.squirrel@reedlarkeygroup.com> Message-ID: <0c5e01c75f72$ce79aea0$1402a8c0@marcx2> "Jonathon McKitrick" wrote: >Question: if I am building a rather large document and the code within >'compile-text' is becoming long and unwieldy, is there a way that I can >break this into functions whose results are returned and appended to the >content compile-text is building? Until now, I've been using function >calls inside a with-document block and each function calls with-page. But >since I've moved to more of a typesetting approach, the entire document is >build inside compile-text, and it's becoming a very long, involved piece >of code. > >Is there a simple way to call functions within compile-text such that each >will add content by accessing the lexical environment being built within >the compile-text block and without having to be a macro ? Yes, it's the with-text-compilation macro. Example: (defun flux-otfr2-from-search (flux) (with-text-compilation (table (:col-widths '(80 80 80 70 70 80 70) :border 0.2 :padding 0) (row (:background-color *ref-ent-tab-chain*) ... Marc From marc.battyani at fractalconcept.com Mon Mar 5 22:13:42 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 5 Mar 2007 23:13:42 +0100 Subject: [cl-typesetting-devel] page breaks using draw-pages References: <49849.68.44.154.215.1172345940.squirrel@reedlarkeygroup.com> <49946.68.44.154.215.1172348236.squirrel@reedlarkeygroup.com> Message-ID: <0c6b01c75f73$8921a5f0$1402a8c0@marcx2> "Jonathon McKitrick" wrote >Here's some code: > >(defun add-par () > (paragraph (:font "Times-Roman" :font-size 24) > "old page") > :eop > (paragraph (:font "Times-Roman" :font-size 24) > "new page")) > >(defun report-write-to-file (filename) > (tt:with-document () > (let* ((header (lambda (pdf:*page*) > (compile-text () "Header"))) > (footer (lambda (pdf:*page*) > (compile-text (:font "Times-Roman" :font-size 12) > (paragraph (:h-align :center) >(verbatim (format nil "~D" pdf:*page-number*)))))) > (content > (compile-text () (add-par)))) > (draw-pages content :margins '(108 72 72 72) :header header :footer >footer) > (when pdf:*page* (finalize-page pdf:*page*)) > (pdf:write-document (concatenate 'string "web/data/" filename))))) > > >What I need to be able to do is generate content via function calls, since >there is too much to fit into just this function. But those function >calls need to be able to generate page breaks. In this example, 'add-par' >is not able to create a new page. This works OK for me: (defun add-par () (with-text-compilation (paragraph (:font "Times-Roman" :font-size 24) "old page") :eop (paragraph (:font "Times-Roman" :font-size 24) "new page"))) Marc From marc.battyani at fractalconcept.com Mon Mar 5 22:18:28 2007 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 5 Mar 2007 23:18:28 +0100 Subject: [cl-typesetting-devel] Paragraph Justification References: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> Message-ID: <0c8801c75f74$33168f30$1402a8c0@marcx2> "Denis Mashkevich" wrote: > when generating paragraphs with (paragraph (:h-align :justify) ...), > text is indeed justified, but so is the last (short) line of the > paragraph, giving very ugly output (something like "last > short line of the paragraph"). Is there a way > around this issue? This should work. Have you tried the examples? You can try to add a :eol. > On a related note, how do I indent a first line of the paragraph? Brian already replied :) Marc From divanov at aha.ru Tue Mar 6 07:15:24 2007 From: divanov at aha.ru (Dmitriy Ivanov) Date: Tue, 6 Mar 2007 10:15:24 +0300 Subject: [cl-typesetting-devel] Paragraph Justification References: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> Message-ID: <000401c75fbf$3e5e7b00$8100a8c0@digo> Hello Denis, | when generating paragraphs with (paragraph (:h-align :justify) ...), | text is indeed justified, but so is the last (short) line of the | paragraph, giving very ugly output (something like "last | short line of the paragraph"). Is there a way | around this issue? I believe that adding :hfill at the very end should help, that is (paragraph (:h-align :justify) ... :hfill) -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From nedenis at gmail.com Tue Mar 6 23:25:33 2007 From: nedenis at gmail.com (Denis Mashkevich) Date: Wed, 7 Mar 2007 01:25:33 +0200 Subject: [cl-typesetting-devel] Paragraph Justification In-Reply-To: <000401c75fbf$3e5e7b00$8100a8c0@digo> References: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com> <000401c75fbf$3e5e7b00$8100a8c0@digo> Message-ID: Thank you Dmitriy, Marc and Brian. Dmitriy's suggestion to add :hfill at the end of the paragraph solved the justification issue. I have another question: Is it possible to specify horizontal and maybe vertical non-breaking space somehow? I want to try using vertical non-breaking space to try and deal with "widows" and "orphans", and horizontal one to fix the problem I have when printing superscript footnote references separated by a space from the preceding word -- they may get moved to the next line. (Btw is there any progress on "printing footnotes on the page they belong" problem?) Thank you, Denis. On Mar 6, 2007, at 9:15 AM, Dmitriy Ivanov wrote: > Hello Denis, > > | when generating paragraphs with (paragraph (:h-align :justify) ...), > | text is indeed justified, but so is the last (short) line of the > | paragraph, giving very ugly output (something like "last > | short line of the paragraph"). Is there a > way > | around this issue? > > I believe that adding :hfill at the very end should help, that is > > (paragraph (:h-align :justify) ... :hfill) > -- > Sincerely, > Dmitriy Ivanov > lisp.ystok.ru > From divanov at aha.ru Wed Mar 7 07:16:01 2007 From: divanov at aha.ru (Dmitriy Ivanov) Date: Wed, 7 Mar 2007 10:16:01 +0300 Subject: [cl-typesetting-devel] Paragraph Justification References: <623B6FED-D6BC-4E51-A145-DB0C225264E7@gmail.com><000401c75fbf$3e5e7b00$8100a8c0@digo> Message-ID: <000001c76088$7f4d2750$8100a8c0@digo> Hello Denis, | Is it possible to specify horizontal and maybe vertical non-breaking | space somehow? I want to try using vertical non-breaking space to try | and deal with "widows" and "orphans", and horizontal one to fix the | problem I have when printing superscript footnote references | separated by a space from the preceding word -- they may get moved to | the next line. (Btw is there any progress on "printing footnotes on | the page they belong" problem?) For horizontal non-breaking space, use the raw nbsp character, e.g. on LispWorks: (char-code #\No-Break-Space) => 160 The corresponding "space" glyph is mentioned at least in WinAnsiEncoding and Win1251Encoding. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru