home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / Documents / Others / viCourse+ / WriteAbook.txt < prev   
Text File  |  1993-01-25  |  14KB  |  465 lines

  1.                                                                        
  2.                                Table of Contents
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.         1. What is Unix? ............................................. 1
  14.         2. Writing A Book ............................................ 3
  15.         3. Format And Commands For Writing A Book .................... 5
  16.         4. What To Do After The Writing .............................. 7
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                         i                                    
  59.  
  60.  
  61.  
  62.  
  63.                           HOW TO WRITE A BOOK IN UNIX
  64.  
  65.  
  66.                                  Adrian Carter
  67.                         Copyright 1992 by Adrian Carter
  68.                            Put in the public domain.
  69.                                        1.
  70.  
  71.  
  72.  
  73.  
  74.  
  75.                                  What is Unix?
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.              Unix is an operating system that was developed at Bell Labs
  87.         in  the  70's.    An  operating  system is what makes a computer
  88.         useful.  It runs programs, it tells  programs  what  section  of
  89.         memory  they can use, it allocates time for each program run, it
  90.         allows you to use disks to store programs.   In  Dos  a  program
  91.         uses  all  the  memory  and  all the time.  This only allows one
  92.         program to run at a time.  In Unix a program has it's own memory
  93.         and  it's  own slice of time to run.  This means that unlike Dos
  94.         Unix can run more programs at the same time.
  95.              With Unix on your computer you can read into your documents
  96.         from  your  database like this with out having to exit your pro-
  97.         gram at all.  And with Unix there is usually 3 ways or  more  to
  98.         do anything.
  99.  
  100.                225  Dorthy Smith         Smith       (555)555-5555
  101.                227  Mr.& Mrs. Dorsey P.  Smith         (555)555-5555
  102.                228  Mr.& Mrs. Warren     Smith         (555)555-5555
  103.                229  Mrs. Claude          Smith         (555)555-5555
  104.                230  Ms. Carla            Smith         (555)555-5555
  105.                232  Al & Elane           Smith         (555)555-5555
  106.                233  Fred & Bessie        Smith         (555)555-5555
  107.                234  Paul & Sandy         Smith         (555)555-5555
  108.  
  109.              Because  Unix  is  a  file  system with only a few compiled
  110.         programs this allows you to read any file  you  have  permission
  111.         to.    You  may use any part of any file in any document you are
  112.         working on.  This is if you have  permission.    Therefore  when
  113.         your  boss  wants  a  report  it  is  usually easy to get it for
  114.         him/her simply using what is available.  No  other  system  that
  115.         will run on a PC is as good.  There are many flavors of Unix but
  116.  
  117.  
  118.  
  119.                                         1                                    
  120.         they all work the same.
  121.              In Dos if you are writing a book you can use any editor  or
  122.         word processing program to write with.  Some have spell checkers
  123.         built in.  In Unix spell is a shell file (like  a  bat  file  in
  124.         Dos)  in  newer  versions  spell is a "c" program it uses a dic-
  125.         tionary file that is a straight ascii file that can  be  updated
  126.         with  any  editor.   This means that the editor program does not
  127.         have to be humongous therefore your disk can hold more.
  128.              In Dos each program you use is like a  black  box  ie.  you
  129.         must  learn  a lot of new commands for the program to be of use.
  130.         Even in windows each program has different commands.    In  Unix
  131.         there are over 150 small programs to learn as needed.  After you
  132.         learn these then you can do anything you want.   You  will  have
  133.         programs to sort your data, to remove duplicates, to change from
  134.         lower to upper case, to do math on rows  or  columns,  to  print
  135.         what  you  to printer or typesetter, to format what you write in
  136.         any way possible .ie book, manuscript, term paper ect.
  137.              To write a book in Unix you need an editor.  Vi comes  with
  138.         it or you can purchase WordPerfect or any other editor you want.
  139.         To check your spelling Unix already has spell to find the errors
  140.         and  sed  to make the corrections.  After you finish writing you
  141.         need to print what you have done. Unix has roff,  nroff,  troff,
  142.         Tex ect.  In Dos your editor has most of this built in therefore
  143.         it is a much larger program. In Unix with so many small programs
  144.         your  editor  is smaller because the other programs do the work.
  145.         This lets your editor be an editor not a spelling checker.  Also
  146.         being smaller means that these programs run faster.
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.                                        2.
  177.                                  Writing A Book
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.              In  this  book  we  will be using Vi as it is very good and
  189.         comes with the system.  Many people say that Vi is too  hard  to
  190.         use  and  they like using other editors like Emacs.  If you take
  191.         the time to learn Vi you will be able  to  work  on  ANY  system
  192.         using  Unix  as Vi is on all.  The book will be written and for-
  193.         matted for nroff.  Spelling will be checked with spell.
  194.              The first thing in a book is to set up the  formatting  ie.
  195.         line  width  which is defaulted to 6.5 inches, hyphenation, line
  196.         spacing defaulted to single space, page numbers top  or  bottom,
  197.         title on every page or just the first.
  198.              A good start is:
  199.  
  200.                              .ad
  201.                              .hy 1
  202.                              .HM 15 80-15
  203.                              .ls 2
  204.                              .fi
  205.  
  206.              The  .ad  starts  adjusting  the  lines in the book to jus-
  207.         tification for a straight right margin line.  The .hy  1  allows
  208.         for hyphenation. .HM 15 80-15 sets line length to 50 and that in
  209.         the center of the page. .ls 2 sets line spacing  to  2  and  .fi
  210.         fills the line.
  211.              The  title  is  the  next command to put in a book .TL this
  212.         centers the title and bold or double strikes the title.  This is
  213.         followed  by  .AU  for  the  author  which centers and bolds the
  214.         authors name.
  215.              Each of these commands must start a line and have no effect
  216.         on number of lines.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.                                         3                                    
  234.               .ad
  235.               .hy 1
  236.               .fi
  237.               .FO "/ /- % -/ /"
  238.               .TL
  239.               HOW TO WRITE A BOOK IN UNIX
  240.               .AU
  241.               Adrian Carter
  242.               .ce
  243.               Copyright 1992 by Adrian Carter
  244.               .sp 5
  245.               .CH 1 "What is Unix?" 1
  246.               .PP
  247.  
  248.              This is how this book starts.  The .FO sets the page number
  249.         to the bottom of the page and centered. The .ce centers the next
  250.         line  and  by  putting  a number after it like .ce 5 centers the
  251.         next 5 lines.  The .sp 5 puts 5 lines after  the  copyright  and
  252.         .PP starts a new paragraph.
  253.              With this out of the way we can now start writing the book.
  254.         Following is the chapter title and first paragraph of this book.
  255.               .CH 1 "What is Unix?" 1
  256.               .PP
  257.              Unix is an operating system that was developed at Bell Labs
  258.              in  the 70's.  An operating system is what makes a computer
  259.              useful.  It runs programs, it tells programs  what  section
  260.              of  memory they can use, it allocates time for each program
  261.              run, it allows you to use disks to store programs.  In  Dos
  262.              a  program uses all the memory and all the time.  This only
  263.              allows one program to run at a time.  In Unix a program has
  264.              it's  own  memory  and it's own slice of time to run.  This
  265.              means that unlike Dos Unix can run  more  programs  at  the
  266.              same time.
  267.               .PP
  268.              As  you  can  see  each paragraph is a solid bunch of words
  269.         with no formatting except wordwrap.  Which we will discus later.
  270.         This  means  that when your formatting is set up your creativity
  271.         is all that is left.  At this point you need to know how to exit
  272.         from  the program.  In Vi you hit <esc> then [:x] <return>.  The
  273.         <esc> puts you in command mode.  The [:x]  <return>  saves  your
  274.         work and leaves the program.  This pre writing formatting is the
  275.         same as finding paper making sure the pencil is  sharp  ect.  we
  276.         used  to  do  before  computers.   This also takes about as much
  277.         time.  Of course you need to save your formatting  to  disk  for
  278.         latter use.  One for each type of writing you do.
  279.              Computers  have  made it very easy for us by saving to disk
  280.         everything we need to work effectively.  We  store  formats  for
  281.         manuscripts  (that is the one for this book) a different one for
  282.         term papers (they need real footnotes not page number footnotes)
  283.         and  a  different  one for tech. manuals.  Each type of document
  284.         has different formatting but uses a lot  of  the  same  internal
  285.         commands ie. .PP .TL .CH .LP .QP.
  286.  
  287.  
  288.  
  289.  
  290.                                        3.
  291.                      Format And Commands For Writing A Book
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.              Format  for  a book with page numbers at the bottom center.
  303.         Line spacing  2.    Line  length  5  inches.    Hyphenation  on.
  304.         Justification and line fill on.
  305.  
  306.                              .ad
  307.                              .hy 1
  308.                              .HM 15 80-15
  309.                              .ls 2
  310.                              .fi
  311.  
  312.         After  setting  up  your format the next step is your title (.TL
  313.         HOW TO WRITE A BOOK IN UNIX) command.  This puts  the  title  in
  314.         the center of the page and makes it bold.
  315.              The next command is (.AU Adrian Carter) the author command.
  316.         This puts the authors name center under the title and  makes  it
  317.         bold.
  318.              The  Chapter  command  is (.CH 1 "What is Unix?" 1) for the
  319.         first use and (.CH 1 "Format And Commands For Writing  A  Book")
  320.         for  the  rest.   If you want to change chapter numbers adding a
  321.         number after the last parenthesis resets  the  counter  to  that
  322.         number.   Useful if your boss wants another chapter and you have
  323.         erased the original.
  324.              Put it all together and you have:
  325.  
  326.               .ad
  327.               .hy 1
  328.               .fi
  329.               .FO "/ /- % -/ /"
  330.               .TL
  331.               HOW TO WRITE A BOOK IN UNIX
  332.               .AU
  333.               Adrian Carter
  334.               .ce
  335.               Copyright 1992 by Adrian Carter
  336.               .sp 5
  337.               .CH 1 "What is Unix?" 1
  338.               .PP
  339.  
  340.              By using .PP .QP .LP you can write a book  with  everything
  341.         except Table of Contents, Index, Footnotes, and endnotes.
  342.              For  Table of Contents add the following to the end of your
  343.         document.
  344.  
  345.  
  346.  
  347.                                         5                                    
  348.                      .rn _c Tc
  349.                      .CH 0 "Table of Contents" -1
  350.                      .Tc
  351.  
  352.         This puts the Table of Contents at the back of the book so after
  353.         printing  it  is  moved to the front.  This formats the Table of
  354.         Contents to fill the page no matter what line length you use.
  355.              This format is the most general for use.  To change it  for
  356.         scholarly  papers  all you need add is .AB for abstract, .NH for
  357.         number headings, .SH .SS for section and sub headings,  .NX  for
  358.         index,  .FS  .FE  for  footnotes, and .HE for heading.  Also .FO
  359.         tells where to put the footnotes whereas .FS .FE delineates  the
  360.         footnote.
  361.              For  manuals  you would use the same as the scholarly.  For
  362.         fiction you would use the general format.
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.                                        4.
  405.                           What To Do After The Writing
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.              After saving your work comes spell checking ie. [spell *  ]
  417.         >tmp.    Then  you  edit  the list of misspelled words in tmp to
  418.         remove those that are right. Then look up the  correct  spelling
  419.         and  put  it  beside the incorrect spelling with a / separating.
  420.         Then put / in front and at  back.    I  should  look  like  this
  421.         /bad/good/.    Add  an 's in front and a g' in back so that each
  422.         bad word looks like this 's/bad/good/g'.
  423.              At this point you are ready  to  correct  every  misspelled
  424.         word  in  the document.  Give this command sed -f tmp doc >doc1.
  425.         Now doc1 has no misspellings.
  426.              After spell checking and grammar checking  then  comes  the
  427.         printing.    This  can  be  to  printer,  to disk, to screen, to
  428.         typesetter, or a filter to TeX for typesetting on  a  postscript
  429.         printer.
  430.              We  have  setup  our  document  as  an  nroff -ms document.
  431.         Therefore our next command is nroff -ms doc1.  This  will  print
  432.         to screen.  Nroff -ms doc1 |lp will print to printer.  Nroff -ms
  433.         doc1 >file name will print to file.  This is used when we  don't
  434.         want  to  print  now  but we don't want to waste time when it is
  435.         time to print. Nroff -ms doc1 |filter >file name will  put  doc1
  436.         through a filter and set it up for LaTeX, TeX ect.
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.   A BOom,youyouyyouy, to f, to f,
  462.  
  463.  
  464.  
  465. title