\title{{\sl Introduction to ACSDOC}\\ \bigskip \bigskip } \author{\bf Piet Hut and Jun Makino} \maketitle \thispagestyle{empty} :tableofcontents: = Preface This is a short introduction to ACSDOC, a document-processing system which can generate latex or html files from a common, easy-to-write text. = Simple Example :command: cd examples; ruby ../acsdoc.rb simpleexample.ok :command: cd examples; ruby ../acsdoc.rb --tolatex simpleexample.ok :command: cd examples; latex simpleexample :command: cd examples; dvips -E -l 1 -x 1900 -o simpleexample.ps simpleexample :command: cd examples; convert simpleexample.ps simpleexample.jpeg The following is a simple example. :include: examples/simpleexample.ok This one creates the output shown in figure ref(fig1) :figure: examples/simpleexample.jpeg 8cm fig1 TeX output of simpleexample.ok Here, what is shown is the LaTeX output created by acsdoc.rb --tolatex simplexample.ok latex simplexample.tex You can also create an HTML page by acsdoc.rb simpleexample.ok This command create a single HTML file, simpleexample.html, at the same directory as the source .ok file lives. ../examples/simpleexample.html|Here is the created HTML file. = Installation and other requirements. == Installing acsdoc Acsdoc is provided as part of the ACS software system. It can be installed as a stand-alone software. acsdoc.rb is a single Ruby source program which require no other Ruby library files or whatsoever. So you can just copy it to your preferred location. Documents are all written in acsdoc format, and can be created by make documents at the directory where the files are extracted from the archive. We plan to offer some more "packaged" way to install the command and documents. == System requirements Acsdoc has been tested on some distributions of Linux. It depends on UNIX operating system, and uses following commands/softwares * mv, rm, cp, cat, csh * convert from ImageMagick * latex, dvips * latex "subsubsection" package Dvips needs to understand options -E, -l, -x. If these options are not available with your dvips, well, you need to modify ascdoc.rb to supply appropriate options. = Running acsdoc. Syntax to invoke acsdoc is the following. % acsdoc.rb [options] [source files] infile ... Here, [options] are command line options, [source files] are name of the program source file used in listing, infile is the input text file. In the following I'll describe the meaning of command line arguments. == Input text file. Infile is the input text file. Its format is described in more details in chapter ref(sect:acsfunctionalities). One can supply multiple input files in the case of the HTML generation. For Latex, only one file can be used. The name of an input text file should end with .ok. == Source files. Source files are the files used in including partial codes. The use of them is described in sections ref(sect:includefragments) and ref(sect:includefunctions). Currently, files with extention .rb are recognized as Ruby source file, .c C program, .C and .cc C++ programs. Support on C/C++ programs is rather primitive and might not serve your need. == Options :label: options --directory dirname This option makes the generate HTML file and additional image files etc to be moved to directory +dirname+. Option argument +dirname+ must exist. If directory +dirname+ does not exist, it is created. Note that this option is ignored if --tolatex option is specified. --keep-dot-files This option is retained for backward compatibility. It has no effect. --reuseoutput This option controls if the output of inline commands (see section ref(sect:includecommand) for details) will be reused from previous run of acsdoc. If this option is not specified, all commands are newly ran on the fly. If this option is specified, and if the command appears in the same line of the text input file in the same form, the output of previous ran is reused. --tolatex Generate a Latex output instead of HTML. Default is HTML. If this option is specified with multiple text input files, the result might not correct. Latex mode is meant to be used with single input file. If you want to process multiple input files for generating single Latex file, just create one input file by using +cat+. == Output files. By default, one HTML file is created for each of one text input file. If --tolatex option is specified, one Latex file is created for one text input file, and you are not supposed to give multiple input files. There are quite a few other files generated. The image files will be stored in .imgs directory. Thus, if you have multiple input files which are processed separetely, i.e., if you do % acsdoc.rb text1.ok % acsdoc.rb text2.ok In one directory, The content of .imgs directory created in the first command is overwritten by that of the second command. To avoid this, use --directory option (see section ref(sect:options) for more details) to put output files to subdirectories. Acsdoc also create a CSS file, .acsdoc-style.css, which is referenced from HTML file. By default, the content of this CSS file is the same for any output, but it would change when the version of acsdoc.rb changes. Finaly, acsdoc creates a number of fragment files from source files specified in the command line. For example, for file foo.rb, there will be a number of files with name starting with .foo.rb (since the name of generated files start with a ".", they do not appear when you do normal +ls+ without -a option). == Examples % acsdoc.rb introduction.ok createss a single HTML file introduction.html. % acsdoc.rb -d documents introduction.ok creates a single HTML file introduction.html and store it to directory documents. % acsdoc.rb test.rb segmentsample.rb introduction.ok process the source files test.rb and segmentsample.rb to prepare fragment files used in introduction.ok, and then creates an HTML file. % acsdoc.rb introduction.ok sample.ok creates two HTML files, introduction.html sample,html, and add navigation links to these HTML files. The section (or chapter) numbers are as if these two HTML files are part of a single document. = Tour over acsdoc funtionalities. :label: acsfunctionalities Markups in acsdoc is largely similar to that of Rdoc or RD, but not exactly the same. Here we overview what is available with acsdoc. == Sections. One can start a new section (or subsection or chapter) by "=" (multiple "=" such as "==" or "===" result in deeper level, like 1.1 or 1.1.1) The following is a sample for deep sections. :include: examples/sectionssample.ok :command: cd examples; ruby ../acsdoc.rb sectionssample.ok :command: cd examples; ruby ../acsdoc.rb --tolatex sectionssample.ok :command: cd examples; latex sectionssample :command: cd examples; dvips -E -l 1 -x 1900 -o sectionssample.ps sectionssample :command: cd examples; convert sectionssample.ps sectionssample.jpeg examples/sectionssample.html|Here is the created HTML file. Up to five levels are supported, at least with HTML document. Number of levels available in Latex document depends on what is available on Latex. By default it is three. == Itemized list What you can do with