Loading ...
Sorry, an error occurred while loading the content.

[jasspa] Re: Justifying Lines/paragraphs

Expand Messages
  • Jon
    ... In answer to your question here is a document (hopefully the mail will not distort it too much). Regards Jon. -- Snip -- Snip -- Snip -- Snip -- Snip --
    Message 1 of 6 , Feb 2, 2000
    • 0 Attachment
      fourje wrote:
      >
      > I'm missing something here - Just a mental block it seems.
      > But how do I justify (right, left, center) a paragraph or a line.
      > It's probably something so very obvious I'm bound to miss it.
      > thanks in advance.
      > Dave E.

      In answer to your question here is a document (hopefully
      the mail will not distort it too much).

      Regards
      Jon.

      -- Snip -- Snip -- Snip -- Snip -- Snip -- Snip-- Snip -- Snip
      > -!- document; pseudo-code -!-
      > Author: Jon Green
      > Created: Wed Feb 2 20:23:35 2000
      > Modified: <20000202.2258>

      1.0 In answer to your question

      1.1 Question Posed

      > I'm missing something here - Just a mental block it seems.
      > But how do I justify (right, left, center) a paragraph or a line.
      > It's probably something so very obvious I'm bound to miss it.
      > thanks in advance.
      > Dave E.

      Heres a document that might help you.

      The document modes are not quite conventional so your
      question is perfectly valid.

      This started off as a quick mail response, but I got carried
      away. Hope it's of some use !!

      Jon.

      1.2 Bit of background

      The document mode (enabled on files with extensions of ".doc"
      or ".txt"), is a manual text layout mode that retains
      formatting. What that basically means is that you do an
      initial layout and there after the editor endeavors to
      preserve it when you make changes.

      When you run in document mode we typically run in a
      $fill-mode "N". This is the automatic mode that attempts to
      identify the format of the text, this is based on the word(s)
      position on the line and adjacent text. As this mode is
      automatic mistakes are sometimes made (i.e. it drops to
      center rather than justified).

      The advantage of running like this is once the text is
      reasonably formatted you can then re-format the whole
      document as you make changes (i.e. add and delete things).

      There is a quick pop-up help page that shows you the key
      bindings. (I was planning on putting these on the mouse but
      never got round to it). Get the help using:-

      M-h or Esc-h

      1.3 Cursor Position

      The cursor position is always left, this is a little
      unfamiliar when you are used to center or right cursor
      positions.

      The general rule is you enter a paragraph and then format the
      paragraph to the appropriate position. Generally we edit
      justified left or justified both, it is rare that we edit
      center or right. Hence left or both is always on.

      1.4 Quick Summary

      @ C-c C-b Justify about both margins
      C-C C-c Justify center
      C-C C-l Justify left
      C-c C-r Justify right

      @ M-o to fill the paragraph

      If you fill in the middle of a paragraph the cursor stays
      where it is. If you fill on a blank line it fills the
      next paragraph and advances to the next.

      There are other keys to change the justification mode as
      indicated on the help pop-up. Paragraph formatting may be
      performed from the menu.

      2.0 Tips and Tricks.

      Well there are bound to be some tips and tricks. I have to
      write specifications all day. Everything gets done in ME like
      this and then it gets shunted up into Microsoft Word. I'll
      tell you about that later.

      2.1 Whats a paragraph ??

      A paragraph in ME is anything that is separated by a
      blank line. There are no control characters in the text
      so this really is WYSIWYG !!

      This is the next paragraph. So in mode "N" it uses the
      context of the surrounding text to work our what to do
      next. I admit it is crude, but 95% of the time it works
      OK.

      The layout of the text allows the formatter to work out
      where things should go.

      2.1.1 The Fill Column

      There is a fill column on the right which determines how
      long the paragraph is. I'm using a short one so this does
      not get wrapped by the mailer, the typical value is 78.

      $fill-col ..................... "65"

      2.2 Left Text (Work off the margin or column 0)

      The margin is magic, anything on column 0 is assumed to
      be hard left justified text i.e.

      This should not
      format because it is
      hard left

      Most text in the document should be off the margin (or
      gutter). Text on the gutter should be restricted to
      titles for it to work correctly.

      2.2.1 On a re-format

      Starting at column 0, you are allowed up to 50% of
      the fill column before it decides you probably want
      to hit the right margin.

      2.3 Right Text

      Right text is not as you normally expected because the
      cursor is on the left. We are aware of this but have not
      sorted it out. Best thing to do is bash the text in and
      then format it to the right i.e.

      My Address
      My Street
      My County
      My Country
      My Zip code

      Then do a quick right para on it i.e. "C-c C-r" and you
      should get it flying to the right .... whoosh !!

      My Address
      My Street
      My County
      My Country
      My Zip code

      2.3.1 On a re-format

      With right text when you format it looks for the
      lines extending from 50% of the fill column to the
      end of the line. The end of the line should be on the
      fill column and it knows this is right justified.

      2.4 Center Text

      Center is the same, but a bit more manageable, again bang
      in on the left and then use "C-c C-c" to center justify.
      Lines are preserved.

      This is in the center
      This is a bit more

      2.3.1 On a re-format

      If the number of spaces either side of the margins is
      the same (+/-1) then it knows you are left. This
      sometimes causes problems when you want justified.
      Simply delete the end of the line and re-format.

      2.5 Justified Text

      The rest of it is assumed to be justified, for nice mails
      and everything else.

      Indentation commences from the first column where a
      text character appears so this line will wrap in line
      with the first.

      Indent again and the same thing happens, this bit
      of text (when I write enough) will keep in line.

      2.6 Absolute Text

      Often you want to put text in the document that is not
      subject to justification. This is controlled by the
      "$fill-ignore" variable (use "M-x list-variables" to see
      them all).

      The default is:-

      $fill-ignore .................. ">_@"

      Any paragraph that commences with the above characters is
      not filled so:-

      > This is a paragraph
      > that is not subject to re-formatting
      > spaces
      > are
      > retained.

      @ This is another
      note that only the first character
      of the
      paragraph
      is marked
      when you re-format
      this should be still as you left it.


      _ And
      another - I think this is enough !!

      2.7 Bullets

      Bullets are useful for lists and alike. As with the
      absolute text there are a few of characters which are
      recognized as bullet characters. These are defined with:-

      @ $fill-bullet .................. "*)].-"
      $fill-bullet-len .............. "15"

      The "$fill-bullet" characters are obviously the
      characters recognized as bullets. "$fill-bullet-len" is
      the number of characters into the paragraph to look for
      bullets. Examples include:-

      * Simple bullet

      * Note that there is a paragraph space between them, also
      note that bullets should be aligned to the left and
      right. You get prompted to do this when you re-format.
      If you re-format again you will not be prompted because
      it works out that the first 2 lines of the paragraph
      text are in alignment.

      a) Can have letters, the ")" is the bullet character,
      again we should be aligned.

      12345] Can have digits, the "]" is the bullet character,
      again we should be aligned.

      Note - This time the bullet character is '-', again we
      wrap and square up after the bullet.

      This one sometime gives me problems when I forget
      it's a bullet so I tend to use a 'soft' character
      when I do not want the indent i.e.

      Note: This is what I call a soft bullet, ME does
      not recognize this one so it wraps OK.

      ix. Maybe a few Roman numerals, it's nice to see these
      from time to time. The bullet here is '.'.

      2.8 Editing the Document

      So now you have a text document and you start to edit it
      and make changes or run the speller over it. The columns
      go out of alignment.

      If you have obeyed all of the above then you should be
      able to fill all of the paragraphs and get them looking
      nice again. you can do this by:-

      Menu -> Format -> Fill all Paragraphs

      Or if you do not like the menu goto the top line and do

      Esc 10000 M-x fill-paragraph

      this should fix them all up.

      2.8.1 What is IQ Fill paragraph ??

      IQ Fill paragraph as shown in the menus, or the
      "ifill-paragraph" command is a macro alternative to the
      built in "fill-paragraph". This deals with bullets that
      are adjacent (i.e. no intervening blank lines). This
      makes for better presentation but you have to be a little
      careful that you always use "ifill-paragraph" for
      formatting. i.e.

      @ * ifill-paragraph can cope with bullets that
      are tightly packed.
      * ifill-paragraph can cope with bullets that
      are tightly packed.

      I'm not using "ifill-paragraph" here so I have escaped
      the above.

      2.9 Whats the advantage of the above

      The advantage of doing everything above is primarily to
      get a reasonable looking document for the minimum amount
      of work on behalf of the author.

      Maybe I'm not familiar enough with Word Processors, but I
      can do a document in double time like this because I do
      not get distracted with my styles blowing up, fontifying
      things and everything else going wrong. You tend to
      concentrate on the text and not all the pretty bits that
      are not really important until you have actually created
      the appropriate words for your masterpiece.

      3.0 Going Back To The Word Processor

      So we have now finished our masterpiece of literature, now we
      want to get it into our presentation engine i.e. our Word
      Processor.

      Word processors tend to put paragraphs on one line. Cutting
      and pasting the document as it stands will not make for good
      WP text unless we are pasting into a fixed font destination
      (i.e. Netscape for mail - not sure about Microsoft Outlook
      that probably wants pretty fonts everywhere !!)

      So to prepare we need to do the following:

      a) Reformat your document for single line paragraphs. Do this
      like:-

      Menu -> Format -> All Paragraphs to Lines

      or on the command line.

      @ top of buffer
      Esc 100000 M-x paragraph-to-line

      b) Now get rid of all the leading spaces

      M-x replace-string "^[ \t]+" ""

      You need to be in magic mode to do this, or do it from the
      "Replace" dialog with magic mode enabled.

      You should now have the whole of your document reduced to
      a few lines. Simply select the whole lot and drop it into
      your favorite word processor.

      c) Format away ....

      You now have a bit of work to do re-formatting you new
      document text in your word processor. This can be a bit
      tedious but it's simply adding emboldening and italicizing
      here and there with a few tables and pictures thrown in
      for good measure. You know the text is good so this makes
      for a relaxing brain dead afternoon !!

      4.0 Extensions

      There are a number of extensions on the standard theme
      outlined above.

      4.1 Sectioned Documents

      Sectioned documents are documents with a bit of
      hilighting applied. These documents are tagged as
      follows:-

      > -!- document; sectioned -!-
      > Author: Jon Green
      > Created: Wed Feb 2 20:23:35 2000
      > Modified: <20000202.2100>

      Note a few other editor fields have been thrown in for
      good measure. The hilighting brings out the section
      headers and bullets. "strings" are colored.

      4.2 Pseudo Code Documents

      Pseudo code documents are sectioned documents with a few
      pseudo code tokens thrown in for good measure, these
      tokens are hilighted again. This document is a
      pseudo-code document, primarily because of this section.
      A pseudo code document is introduced with:-

      > -!- document; pseudo-code -!-
      > Author: Jon Green
      > Created: Wed Feb 2 20:23:35 2000
      > Modified: <20000202.2100>

      So now you can write a bit of hilighted pseudo code as
      follows:-

      > // A days work
      FUNCTION a days work
      BEGIN
      // A comment for my pseudo code.
      WHILE (NOT bored)
      DO
      IF (this condition is true)
      THEN
      do something
      ELSE
      do something else
      ENDIF
      DONE
      RETURN home
      END

      Note that we still have to protect the text from
      formatting. Once we have done this we can still format
      the whole document.

      Be careful not to leave blank lines in your pseudo code
      because this is a new paragraph. I typically plug them
      all with comments.

      4.3 Other Extensions

      The previous sections have dealt with the standard macros
      that are shipped. Other extensions may be written on top
      of what's supplied. I must admit my "hkdoc.emf" is a
      little different from the standard macros and is tailored
      to the types of document that I have to deal with on a
      daily basis.

      Follows are a few of the extensions that I have made:-

      4.3.1 Folding

      The folding feature of ME using narrowing allows an
      overview of the document to be created. You can then open
      up the folds when you need to change a section. This is
      simply added by defining your own hook file called
      "mydoc.emf" in your user area as follows:-

      @
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;
      ; Author : $Author$
      ; Created By : Jon Green
      ; Created : Wed Feb 2 21:52:09 2000
      ; Last Modified : <000202.2153>
      ;
      ; Description ; Extensions to the standard document template
      ;
      ; Notes
      ;
      ; History
      ;
      ; Copyright (c) 2000 Jon Green.
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ; my-fhook-doc; Extend the document bindings
      0 define-macro my-fhook-doc
      ; setup doc buffer folding support used in section
      ; and pseudo code modes.
      buffer-bind-unbound-key fold-current "f2"
      buffer-bind-unbound-key fold-all "f3"
      !emacro
      ; Define the folding definitions.
      set-variable .fhook-doc.fold-open "^ *[0-9]\\.[0-9.]* +\\w"
      set-variable .fhook-doc.fold-close "^ *[0-9]\\.[0-9.]* +\\w"
      set-variable .fhook-doc.fold-mopen "1"
      set-variable .fhook-doc.fold-mnext "-1"
      ;
      ml-write "[Jon's document file extensions loaded]"

      With you document hook loaded the whole document may be
      folded with "f3" (or whatever binding you have assigned)
      the resultant output of this document looks exactly like
      this:

      > > -!- document; pseudo-code -!-
      > > Author: Jon Green
      > > Created: Wed Feb 2 20:23:35 2000
      > > Modified: <20000202.2153>
      >
      > It is obvious and it's not !!
      > Heres a document that might help you.
      >
      > 1.0 In answer to your question
      > 1.1 Bit of background
      > 1.2 Quick Summary
      > 2.0 Tips and Tricks.
      > 2.1 Whats a paragraph ??
      > 2.1.1 The Fill Column
      > 2.2 Left Text (Work off the margin or column 0)
      > 2.2.1 On a re-format
      > 2.3 Right Text
      > 2.3.1 On a re-format
      > 2.4 Center Text
      > 2.3.1 On a re-format
      > 2.5 Justified Text
      > 2.6 Absolute Text
      > 2.7 Bullets
      > 2.8 Editing the Document
      > 2.8.1 What is IQ Fill paragraph ??
      > 2.9 Whats the advantage of the above
      > 3.0 Going Back To The Word Processor
      > 4.0 Extensions
      > 4.1 Sectioned Documents
      > 4.2 Pseudo Code Documents
      > 4.3 Other Extensions
      > 4.3.1 Folding
      > 5.0 End

      This makes it nice and easy to edit. Note that I
      typically add a dummy last section to make everything
      fold nicely. Single sections may be unfolded with "f2".

      You have to be a little bit carful not to edit over a
      folded section.

      4.3.2 Hilighting

      Other extensions (not included above) are typically to
      the hilighting. These are usually tailored to the kind of
      text that you work with. I use `...' as a bold encoding
      and hilight as such.

      4.3.3 Section Renumbering

      A number of macro solutions have been posted to the mail
      reflector on this subject. I suggest that you look over
      these.

      4.4 Other Tools

      Other tools used with the documentation include:-

      * spell-buffer (Command line or menu)

      Spell checker.

      * clean (command line or menu)

      Removes all of the trailing spaces.

      * count-words

      Counts all the words.

      5.0 Did you get this far ??

      If you got this far well done !!

      Exercise.

      Cut and paste this into a document and have a go !!
      You should be able to reformat the whole document and
      nothing will change.

      6.0 End
    • fourje
      ... ... It s getting better every day. a great editor. Thanks Dave E. dedwards@forje.uklinux.net
      Message 2 of 6 , Feb 3, 2000
      • 0 Attachment
        Jon wrote:
        >
        > fourje wrote:
        > >
        > > I'm missing something here - Just a mental block it seems.
        > > But how do I justify (right, left, center) a paragraph or a line.
        <SNIP>
        >
        > In answer to your question here is a document (hopefully
        > the mail will not distort it too much).
        <SNIP>

        It's getting better every day.
        a great editor.
        Thanks
        Dave E.
        dedwards@...
      • fourje
        ... ... Jon, This is real helpful as I said a week or two ago. Just 2 questions though. 1) How did you get the Modified date to show as
        Message 3 of 6 , Feb 16, 2000
        • 0 Attachment
          Jon wrote:
          >
          > fourje wrote:
          <SNIP>
          > In answer to your question here is a document (hopefully
          > the mail will not distort it too much).
          >
          > Regards
          > Jon.
          >
          > -- Snip -- Snip -- Snip -- Snip -- Snip -- Snip-- Snip -- Snip
          > > -!- document; pseudo-code -!-
          > > Author: Jon Green
          > > Created: Wed Feb 2 20:23:35 2000
          > > Modified: <20000202.2258>
          >
          Jon,
          This is real helpful as I said a week or two ago. Just 2 questions
          though.
          1) How did you get the "Modified" date to show as <20000202.2258>
          Or did you just enter it.
          2) When I first went into the document, I inadvertently made a change
          on one of the text lines. I noticed that the date and Time both
          changed??? I also noticed that the time was showing US time not UK time
          which is what I had set it to. Now, I connect to a LAN in the US
          regularly, and the system time changing is a frequent occurrence (don't
          now why), so I changed the system time back to the GMT value. Then the
          modified time wouldn't change any more??
          Now, these questions may be as a direct result of the hour and the
          workload I'm under, don't hesitate to let me now.

          Thanks in advance
          Dave E.
          <SNIP>
        • Henry Harpending
          I have two quick questions. 1. Does anyone have a macro handy that does previous-buffer , i.e. that reverses next-buffer ? 2. What is JASSPA? ... Thanks,
          Message 4 of 6 , Feb 16, 2000
          • 0 Attachment
            I have two quick questions.

            1. Does anyone have a macro handy that does "previous-buffer", i.e.
            that reverses "next-buffer"?

            2. What is JASSPA?

            > This is an unmoderated list. JASSPA is not responsible for the content of
            > any material posted to this list.


            Thanks, Henry Harpending

            --
            Henry Harpending, Dept. Anthropology, Stewart Building, U. of Utah,
            Salt Lake City, UT, 84112, USA. email: harpend@...
            phone 801 581 3776: fax 801 581 6252: home 801 582 7760
          • Steven Phillips
            ... I would expect -1 next-buffer to do this but it currently doesn t, I will add this. It can be done as follows: define-macro previous-buffer set-variable
            Message 5 of 6 , Feb 17, 2000
            • 0 Attachment
              > Subject: [jasspa] Re: Justifying Lines/paragraphs
              > From: Henry Harpending <harpend@...>
              > Date: Wed, 16 Feb 2000 22:19:38 -0700
              > To: jasspa@egroups.com
              >
              > I have two quick questions.
              >
              > 1. Does anyone have a macro handy that does "previous-buffer", i.e.
              > that reverses "next-buffer"?

              I would expect -1 next-buffer to do this but it currently doesn't, I will add
              this. It can be done as follows:

              define-macro previous-buffer
              set-variable #l0 ""
              set-variable $buffer-names ".*"
              !while ¬ &seq &set #l1 $buffer-names ""
              !if &and ¬ &seq #l0 "" &seq #l1 $buffer-bname
              !goto found-buffer
              !endif
              set-variable #l0 #l1
              !done
              *found-buffer
              find-buffer #l0
              !emacro

              >
              > 2. What is JASSPA?

              I think we're keeping quiet about that (got to have at least one secret) but
              any suggestions welcome.

              >
              > > This is an unmoderated list. JASSPA is not responsible for the content of
              > > any material posted to this list.
              >
              >
              > Thanks, Henry Harpending
              >
              > --
              > Henry Harpending, Dept. Anthropology, Stewart Building, U. of Utah,
              > Salt Lake City, UT, 84112, USA. email: harpend@...
              > phone 801 581 3776: fax 801 581 6252: home 801 582 7760
              >
              >
              > ------------------------------------------------------------------------
              > __________________________________________________________________________
              >
              > This is an unmoderated list. JASSPA is not responsible for the content of
              > any material posted to this list.
              >
              >
              > ------------------------------------------------------------------------
              > *** Got Questions? Get Answers. Got Answers? Get Paid. ***
              > Sign up at Infomarco.com and you can win $30,000 cash or a trip to China.
              > http://click.egroups.com/1/1251/4/_/6009/_/950775411/
              >
              > -- Easily schedule meetings and events using the group calendar!
              > -- http://www.egroups.com/cal?listname=jasspa&m=1
              >
              >
              >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.