the Olive Leaf - Newsletter of the Arizona Interleaf Users Group

June 1992

Indicating A Blank Page Follows

Some document conventions require that the page number field inform the reader if the following page is blank. For example, if page 2 contains text and page 3 is blank, then the page 2 would show "2/(3 blank)".

If you do not have the full Interleaf capabilities (which would make this task easier) then you may use the following procedure.

The frame can now be pulled up whenever you need a blank page number. Select the frame, open, select text and backspace to the number that is blank. Change it to the desired number, type "blank)" and you are ready for the page. Make a new component and have it start a new page, then make another component and have it start another page. Now you have a blank page that can be thrown away and you can go on to the next page number without interrupting the page number sequence.

You may find other uses for this technique.

Sherry Anderson
Garrett Auxiliary Power, Allied-Signal, Phoenix

Deleting Interleaf Backup Files

Does your Interleaf desktop occupy more disk space than it needs to because of "backup" copies of documents and catalogs (style sheets) which you no longer need? The Interleaf 5 command:
Custom->Misc->Cleanup
will take care of the backups for documents, but not for catalogs.

Charley Lough of McDonnell Douglas Helicopter has offered the following script to help with this cleanup. It will execute under UNIX System 5 in either a Bourne shell or Korn shell environment. You may need to precede it with an appropriate line defining the shell, such as:

     #!/sys5/bin/ksh
depending upon your computer platform. It may be modified easily for use in BSD environments if needed.
     SRC_DIR=`pwd`
     echo "doing a cleanup of the present"
     echo "  directory $SRC_DIR?"
     echo "Is this correct? (y/n) : \c"
     read answer
     if [ "$answer" = "y" ]
     then
     	find . -print >/tmp/clean.log
     	grep ,1 /tmp/clean.log > /tmp/clean.new
     	for fn
     	in `cat /tmp/clean.new`
     	do
     	rm $fn
     	done
     	rm /tmp/clean.log /tmp/clean.new
     	else
     	echo "Try again from correct directory\n"
     fi

You may wish to enhance this script to provide additional checking. For example, you may not wish to delete a backup file if there is a crash copy or if there is no primary copy of the file, or you may wish to delete checkpoint copies of the file as well. We hope it serves as a starting point to help you solve this problem.

Thanks to
Charley Lough
McDonnell Douglas Helicopter Company, Mesa
[]

An Easy Way To Make Fractions

Interleaf's David Weinberger created a Lisp script to make it easier to provide fractions in documents (it converts 1/2 into 1 2) and posted it on the LeafLine bulletin board. (This is not a product of Interleaf, Inc.) He supplied the following documentation of the script:

This little fractionizer lisp script is NOT of professional quality but it seems to work most of the time. It takes selected text and, if there is a slash in it, turns it into a fraction, superscripting the first number, replacing the backslash with the fraction virgule (char 0x120), and subscripting the second number. It does not check to see if there are any non-char tokens in the selection (e.g., a frame).

To use, either:

;; Fractionizer: fractions.lsp 1-8-92 D. Weinberger
;; Not a product of Interleaf, Inc.
(lisp-set-implementation "Interleaf Lisp" "2.0")

(defun set-props (prop val)
  (tell *text-editor* mid:set-props prop val) )

(defun fractionizer ()
  (let (virgule m1 m2 m3 markers text virg-pos)
    (setq virgule "\x120\")

(setq markers (tell *text-editor* mid:get-selection))
    (setq m1 (car markers))
   (setq m2 (cdr markers))

 ; selection?
    (if (not markers)
        (progn
          (stk-open "No text selected")
          (quit)))

    ; get text
    (setq text (tell m1 mid:get-substring m2 t t))

    ; check for non-text elements -- not implemented

    ; virgule in it?
    (if (setq virg-pos (string-contained "/" text))
    (progn
    ; --superscript the first part
    ; select to before virgule
    (setq m3 (tell m1 mid:copy))
    (tell m3 mid:move-by virg-pos)
    (tell *text-editor* mid:select m1 m3)
    (set-props :superscript t)

  ; -- cut and replace slash with virgule
    (setq m1 m3)
    (tell m3 mid:move-by 1)
    (tell *text-editor* mid:select m1 m3)
    (tell *text-editor* mid:cut)
    (tell m1 mid:insert virgule)
    ; return virgule to normal
    (setq m3 (tell m1 mid:copy))
    (tell  m3 mid:move-by 1)
    (tell *text-editor* mid:select m1 m3)
    (set-props :superscript nil)
    ;subscript what's after it
    (tell m1 mid:move-by 2)
    (tell *text-editor* mid:select m1 m2)
    (set-props :subscript t)
    ; turn off subscript for rest of cmpn
    (tell *text-editor* mid:deselect)
    (tell *text-editor* mid:set-props :subscript nil))
    ; else not slash
    (stk-open "No slash to indicate fraction"))

    ))

;; if loading off the NoSelect custom menu, uncomment
;; the next line:
(fractionizer)
;; uncomment the next line if you put this script in your
;; profile.drw and want it bound to ^Xf
; (kbd-bind-doc kbd-doc-map "\^Xf" 'fractionizer
 "frac-\ntion")

[Newsletter TOC] (Updated 03 JUN 96)
This Web site is provided by Artronic Development.
Contact webmaster@www.arde.com with questions or problems. Copyright 1996 Arizona Interleaf Users Group