From: Marc Battyani
Subject: cl-typesetting news
Date: 
Message-ID: <bl54v1$19p@library2.airnews.net>
New features:
Images (JPEG for now)
Tables, at last something for which TeX is quite ugly... ;-)
Nested Tables (another thing TeX does not do well (if it does it))
Horizontal rules
Functional horizontal rules (I have a wavelet rule in the example pdf)
Left and right margins
etc...

As usual you can look the example at :
www.fractalconcept.com/ex.pdf (who said tacky ? ;-))
And the source of this example is below.

I'm still collecting the names of people wanting to contribute... ;-)

BTW I'm looking for a name less "lispnik only" than cl-typesetting.

Marc

Source for the example:

(defparameter *par1*
  "Lisp is a family of languages...")

(defparameter *par2*
  "MacLisp improved...")

(defparameter *par3*
  "Interlisp introduced...")

(defparameter *par4*
  "Although the first implementations of Lisp....'")

(defun draw-block (content x y dx dy rotation)
  (pdf:with-saved-state
      (pdf:translate x y)
    (pdf:rotate rotation)
    (pdf:set-gray-fill 1)
    (pdf:basic-rect -5 0 (+ dx 10) (- dy))
    (pdf:fill-and-stroke)
    (pdf:set-gray-fill 0)
    (let ((box (make-filled-vbox content dx dy)))
      (stroke box 0 0))))

;; example of extension

(defclass rotated-char-box (soft-box h-mode-mixin)
  ((boxed-char :accessor boxed-char :initarg :boxed-char)
   (rotation :accessor rotation :initarg :rotation)))

(defun put-rotated-char-string (string)
  (loop for char across string
 do (add-box (make-instance 'rotated-char-box :dx *font-size*
       :dy *font-size* :boxed-char char :offset *font-size*
       :rotation (- (random 120) 60)))))

(defmethod stroke ((box rotated-char-box) x y)
  (let ((dx (dx box))(dy (dy box))
 (width (pdf:get-char-width (boxed-char box) *font* *font-size*)))
    (pdf:with-saved-state
      (pdf:translate (+ x (* dx 0.5)) (- y (* dy 0.6)))
      (pdf:set-line-width 0.5)
      (pdf:set-gray-fill 0.8)
      (pdf:circle 0 0 (* dx 0.45))
      (pdf:fill-and-stroke)
      (pdf:set-gray-fill 0)
      (pdf:rotate (rotation box))
      (pdf:in-text-mode
       (pdf:move-text (* -0.5 width)(* -0.18 *font-size*))
       (pdf:set-font *font* (* *font-size* 0.8))
       (pdf::show-text (make-string 1 :initial-element (boxed-char box)))))))

;; a draw function for the functional rule...

(defun draw-wavelet-rule (box x0 y0)
  (let ((dx/2 (* (dx box) 0.5))
 (dy/2 (* (dy box) 0.5)))
    (pdf:with-saved-state
      (pdf:translate (+ x0 dx/2) (- y0 dy/2))
      (pdf:set-line-width 1)
      (pdf:set-color-fill (color box))
      (pdf:move-to (- dx/2) 0)
      (loop for x from (- dx/2) by 0.2
     for y = (* dy/2 (cos (* x 0.8)) (exp (* x x -0.006)))
     while (< x dx/2)
     do (pdf:line-to x y))
      (pdf:stroke))))

;;example document

(defun ex (&optional (file #P"/tmp/ex.pdf"))
  (pdf:with-document ()
    (pdf:with-page ()
      (pdf:with-outline-level ("Example" (pdf:register-page-reference))
 (pdf:set-line-width 0.1)
 (let ((content
        (compile-text ()
   (paragraph (:h-align :centered :font "Helvetica-Bold" :font-size 30 :color
'(0.0 0 0.8))
       "cl-typesetting" :eol
       (hrule :dy 1)
       (with-style (:font "Times-Italic" :font-size 13)
         "The cool Common Lisp typesetting system"))
   (paragraph (:h-align :justified :top-margin 10 :first-line-indent 10
          :font "Times-Italic" :font-size 10)
         "This typesetting system's goal is to be an alternative to the TeX
typesetting system. It is written in Common Lisp and uses cl-pdf as its
backend. This will enable it to be powerful, extensible and fast. Though it
is not considered very difficult, it is already better than Word...")
   (paragraph (:h-align :centered :font "Helvetica-BoldOblique" :font-size 20
:color '(1.0 0 0))
       "Now in Color!")
   (paragraph (:h-align :centered :font "Times-Italic" :font-size 12 :color
'(0.0 0.6 0.3))
       "With user defined "
       (put-rotated-char-string "extensions") :eol
       (with-style (:font "Times-Italic" :font-size 11)
         "Support for images and functional rules" :eol
         (image :file #P"/tmp/banner.jpg" :dx 100 :dy 20)))
   (hrule :dy 15 :stroke-fn 'draw-wavelet-rule)
   (table (:col-widths '(60 80 80) :border 0.5)
   (row ()
        (cell ()(paragraph (:h-align :left :font "Times-Italic" :font-size 9)
      "Left aligned"))
        (cell ()(paragraph (:h-align :centered :font "Times-Roman" :font-size
9)
      "Centered cell content"))
        (cell ()(paragraph (:h-align :right :font "Times-Bold" :font-size 9)
      "Right cell content")))
   (row ()
        (cell ()(paragraph (:h-align :left :font "Times-Italic" :font-size 9)
      "This cell content should takes 2 lines"))
        (cell ()(paragraph (:h-align :centered :font "Times-Italic"
:font-size 9)
      "A jpeg "
      (image :file #P"/tmp/fractal.jpg" :dx 15 :dy 15 :inline t :offset 9)
      " in the text"))
        (cell ()(paragraph (:h-align :left :font "Times-Italic" :font-size
11)
      (put-rotated-char-string "common lisp is cool"))))
   (row ()
        (cell ()(paragraph (:h-align :left :font "Times-Italic" :font-size 9)
      "An example of table inside a cell"))
        (cell ()(table (:col-widths '(14 14 21) :border 0.2)
         (row () (cell () "12")(cell () "34")(cell () "567"))
         (row () (cell () "ab")(cell () "cd")(cell () "efg"))))
        (cell ()(paragraph (:h-align :left :font "Times-Italic" :font-size 9)
      "You can nest as many tables as you want, like you do in HTML."))))
   (paragraph (:h-align :justified :top-margin 5 :first-line-indent 10 :color
'(0 0 0)
          :font "Times-Roman" :font-size 10)
       *par1*)
   (paragraph (:h-align :left :top-margin 9 :first-line-indent 10
          :left-margin 20 :right-margin 20 :font "Helvetica" :font-size 10)
       *par2*)
   (paragraph (:h-align :centered :top-margin 9 :font "Helvetica-Oblique"
:font-size 10)
      *par3*)
   (paragraph (:h-align :justified :top-margin 9 :first-line-indent 10
          :left-margin 20 :right-margin 20 :font "Helvetica" :font-size 10)
       *par4*)
   (paragraph (:h-align :centered :top-margin 20 :font "Times-Bold"
:font-size 20)
       "Kerning test" :eol
       (with-style (:font "Helvetica" :font-size 40 :left-margin 20
:right-margin 20)
         "Yes, AWAY"))
   (paragraph (:h-align :centered :top-margin 20 :font "Helvetica"
          :font-size 40 :color '(0.8 0 0))
       "Warning!" :eol
       (with-style (:font "Times-Italic" :font-size 12)
         "This test pdf file has been made with an early version 0.1 of
cl-typesetting. A lot of basic features, like a correct hypenation, are still
missing, though micro-typography is already there" :eol :eol "Marc
Battyani")))))
   (draw-block content 40 800 250 380 5)
   (draw-block content 50 425 250 380 -5)
   (draw-block content 330 800 250 380 -2)
   (draw-block content 310 400 250 380 2))))
    (pdf:write-document file)))

From: Thomas F. Burdick
Subject: Re: cl-typesetting news
Date: 
Message-ID: <xcvn0cpz8oq.fsf@famine.OCF.Berkeley.EDU>
"Marc Battyani" <·············@fractalconcept.com> writes:

> New features:
> Images (JPEG for now)
> Tables, at last something for which TeX is quite ugly... ;-)

No kidding.

> Nested Tables (another thing TeX does not do well (if it does it))

Uhm ... do we have to talk about this?!?!  It was a traumatic
experience for me.  Emacs lisp saved me.  I don't want to talk about
it. ;-)

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Marc Battyani
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl7afj$86b@library2.airnews.net>
"Thomas F. Burdick" <···@famine.OCF.Berkeley.EDU> wrote
> "Marc Battyani" <·············@fractalconcept.com> writes:
>
> > New features:
> > Images (JPEG for now)
> > Tables, at last something for which TeX is quite ugly... ;-)
>
> No kidding.
>
> > Nested Tables (another thing TeX does not do well (if it does it))
>
> Uhm ... do we have to talk about this?!?!  It was a traumatic
> experience for me.  Emacs lisp saved me.  I don't want to talk about
> it. ;-)

It's trying to make a rather simple table in TeX that made me think that
there should be a Lisp typesetting system... That or an anonymous TeX users
psychological support group...

Marc
From: Thomas F. Burdick
Subject: Re: cl-typesetting news
Date: 
Message-ID: <xcvhe2wzq0c.fsf@famine.OCF.Berkeley.EDU>
"Marc Battyani" <·············@fractalconcept.com> writes:

> "Thomas F. Burdick" <···@famine.OCF.Berkeley.EDU> wrote
> > "Marc Battyani" <·············@fractalconcept.com> writes:
> >
> > > New features:
> > > Images (JPEG for now)
> > > Tables, at last something for which TeX is quite ugly... ;-)
> >
> > No kidding.
> >
> > > Nested Tables (another thing TeX does not do well (if it does it))
> >
> > Uhm ... do we have to talk about this?!?!  It was a traumatic
> > experience for me.  Emacs lisp saved me.  I don't want to talk about
> > it. ;-)
> 
> It's trying to make a rather simple table in TeX that made me think that
> there should be a Lisp typesetting system... That or an anonymous TeX users
> psychological support group...

No human being should have to generate TeX tables.  Just for those
reading who may have to, don't do it!  There's a wonderful WYSIWYM
("... what you mean") table package for Emacs that can generate LaTeX
<http://table.sf.net/>.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Marc Battyani
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl7ln7$o3f@library2.airnews.net>
"Thomas F. Burdick" <···@famine.OCF.Berkeley.EDU> wrote

> No human being should have to generate TeX tables.  Just for those
> reading who may have to, don't do it!  There's a wonderful WYSIWYM
> ("... what you mean") table package for Emacs that can generate LaTeX
> <http://table.sf.net/>.

6022 lines of code!!! This is amazing...
My table.lisp has 112 lines of code so far. Ok it's not fully finished but I
can't imagine it going more than 500 lines even with a lot of features.
That alone gives an idea of the difference of expressive power between TeX
and cl-typesetting. :)

BTW I've just added support for table and cells color in my tables
(increasing the file from 100 lines to 112 ;-)

The updated example is still there:
www.fractalconcept.com/ex.pdf

(Who said tacky ???)

Marc
From: Robert Amble
Subject: Re: cl-typesetting news
Date: 
Message-ID: <slrnbnch10.1pr.techpriest@andromeda.local>
In article <··········@library2.airnews.net>, Marc Battyani wrote:
> BTW I'm looking for a name less "lispnik only" than cl-typesetting.

How about express-type from s-expression typesetting?

Good luck with the project,
rca
From: Kenny Tilton
Subject: Re: cl-typesetting news
Date: 
Message-ID: <AKtdb.19284$lZ6.5038371@twister.nyc.rr.com>
Robert Amble wrote:
> In article <··········@library2.airnews.net>, Marc Battyani wrote:
> 
>>BTW I'm looking for a name less "lispnik only" than cl-typesetting.
> 
> 
> How about express-type from s-expression typesetting?

Hmmm. If we are going to emphasize sexprs--not a bad idea at all since 
secretly we are trying to suck the world into sexpr-based languages 
(guess which), and if we are hoping to steal market share from TeX, and 
if we are going to make Erann happy by throwing substance to the wind 
and focusing on the gawdy bauble of a fancy name as if the programming 
community were so many magpies...what else?: SeX.

kenny
From: Eric Daniel
Subject: Re: cl-typesetting news
Date: 
Message-ID: <3f772467$1_3@corp.newsgroups.com>
In article <·······················@twister.nyc.rr.com>, Kenny Tilton wrote:
>  
>  
>  Robert Amble wrote:
> > In article <··········@library2.airnews.net>, Marc Battyani wrote:
> > 
> >>BTW I'm looking for a name less "lispnik only" than cl-typesetting.
> > 
> > 
> > How about express-type from s-expression typesetting?
>  
>  Hmmm. If we are going to emphasize sexprs--not a bad idea at all since 
>  secretly we are trying to suck the world into sexpr-based languages 
>  (guess which), and if we are hoping to steal market share from TeX, and 
>  if we are going to make Erann happy by throwing substance to the wind 
>  and focusing on the gawdy bauble of a fancy name as if the programming 
>  community were so many magpies...what else?: SeX.
>  

How about going with the old tradition of silly recursive acronyms?
XinT -> XinT is not TeX
XnT, XiT, Xain'tT, etc...

(replace X with a suitable letter :-p)

Eric Daniel



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----
From: Marc Battyani
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl7afi$86b@library2.airnews.net>
"Eric Daniel" <···········@barberic.vancouver.wa.us> wrote
> In article <·······················@twister.nyc.rr.com>, Kenny Tilton
wrote:
> >
> >
> >  Robert Amble wrote:
> > > In article <··········@library2.airnews.net>, Marc Battyani wrote:
> > >
> > >>BTW I'm looking for a name less "lispnik only" than cl-typesetting.
> > >
> > >
> > > How about express-type from s-expression typesetting?
> >
> >  Hmmm. If we are going to emphasize sexprs--not a bad idea at all since
> >  secretly we are trying to suck the world into sexpr-based languages
> >  (guess which), and if we are hoping to steal market share from TeX, and
> >  if we are going to make Erann happy by throwing substance to the wind
> >  and focusing on the gawdy bauble of a fancy name as if the programming
> >  community were so many magpies...what else?: SeX.
> >
>
> How about going with the old tradition of silly recursive acronyms?
> XinT -> XinT is not TeX
> XnT, XiT, Xain'tT, etc...
>
> (replace X with a suitable letter :-p)

I think we should drop any reference to TeX to avoid religious wars...

Marc
From: Kenny Tilton
Subject: Re: cl-typesetting news
Date: 
Message-ID: <Ghudb.19288$lZ6.5049230@twister.nyc.rr.com>
Marc Battyani wrote:
> New features:
> Images (JPEG for now)
> Tables, at last something for which TeX is quite ugly... ;-)
> Nested Tables (another thing TeX does not do well (if it does it))
> Horizontal rules
> Functional horizontal rules (I have a wavelet rule in the example pdf)
> Left and right margins
> etc...
> 
> As usual you can look the example at :
> www.fractalconcept.com/ex.pdf (who said tacky ? ;-))

Lovely. Under a very old Acrobat (3.0) I got "There was a problem 
reading this document [28].", probably on the JPGs because they showed 
as gray rectangles, but AOK under the latest (6.0).

> And the source of this example is below.
> 
> I'm still collecting the names of people wanting to contribute... ;-)

Got mine? :)

kenny
From: Marc Battyani
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl79hc$pb@library2.airnews.net>
"Kenny Tilton" <·······@nyc.rr.com> wrote
>
> Marc Battyani wrote:
> > New features:
> > Images (JPEG for now)
> > Tables, at last something for which TeX is quite ugly... ;-)
> > Nested Tables (another thing TeX does not do well (if it does it))
> > Horizontal rules
> > Functional horizontal rules (I have a wavelet rule in the example pdf)
> > Left and right margins
> > etc...
> >
> > As usual you can look the example at :
> > www.fractalconcept.com/ex.pdf (who said tacky ? ;-))
>
> Lovely. Under a very old Acrobat (3.0) I got "There was a problem
> reading this document [28].", probably on the JPGs because they showed
> as gray rectangles, but AOK under the latest (6.0).
>
> > And the source of this example is below.
> >
> > I'm still collecting the names of people wanting to contribute... ;-)
>
> Got mine? :)

Sure. At least twice  :)

Marc
From: Nikodemus Siivola
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl614u$qoh$1@nyytiset.pp.htv.fi>
Marc Battyani <·············@fractalconcept.com> wrote:

> BTW I'm looking for a name less "lispnik only" than cl-typesetting.

Heh, I was just wondering what would be an aprropriate hint about the
non-universality of your chosen name. ;)

How about "Clayout", "Clatter", or "XeT?

Nice work!

Cheers,

 -- Nikodemus
From: Jesper Harder
Subject: Re: cl-typesetting news
Date: 
Message-ID: <m3oex4n51e.fsf@defun.localdomain>
"Marc Battyani" <·············@fractalconcept.com> writes:

> BTW I'm looking for a name less "lispnik only" than cl-typesetting.

setq = (type)SET(ting) Q(uality) = Simply Excellent Type Quality
     = Setq Exceeds Tex Quality

hint = Hint Is Not Tex

hit = His Isn't Tex

clit = Common LIsp Typesetting ... hmm, maybe that's a bit to sleazy ;-)
From: Marc Battyani
Subject: Re: cl-typesetting news
Date: 
Message-ID: <bl7afg$86b@library2.airnews.net>
"Jesper Harder" <······@myrealbox.com> wrote
> "Marc Battyani" <·············@fractalconcept.com> writes:
>
> > BTW I'm looking for a name less "lispnik only" than cl-typesetting.
>
> setq = (type)SET(ting) Q(uality) = Simply Excellent Type Quality

nice one

>      = Setq Exceeds Tex Quality

I prefer avoid flame war with TeX...

> hint = Hint Is Not Tex
>
> hit = His Isn't Tex
>
> clit = Common LIsp Typesetting ... hmm, maybe that's a bit to sleazy ;-)

Hmm, this or Kenny's SeX + "Lisp" will insure several millions downloads...
;-)

Marc
From: Duane Rettig
Subject: Re: cl-typesetting news
Date: 
Message-ID: <465jcowgs.fsf@beta.franz.com>
"Marc Battyani" <·············@fractalconcept.com> writes:

> >
> > clit = Common LIsp Typesetting ... hmm, maybe that's a bit to sleazy ;-)
> 
> Hmm, this or Kenny's SeX + "Lisp" will insure several millions downloads...
> ;-)

or an ignominious end in several million spam filters.


-- 
Duane Rettig    ·····@franz.com    Franz Inc.  http://www.franz.com/
555 12th St., Suite 1450               http://www.555citycenter.com/
Oakland, Ca. 94607        Phone: (510) 452-2000; Fax: (510) 452-0182