diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/Makefile ../rdoc-f95-20070112/Makefile
--- ruby-1.8.5-p12/lib/rdoc/Makefile	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20070112/Makefile	2006-11-15 20:44:13.000000000 +0900
@@ -0,0 +1,51 @@
+all:
+
+doc: doc-stamp
+	rdoc -U --op doc --title "RDoc-F95 Documentations" \
+	--charset euc-jp --inline-source --line-numbers \
+	--main README.ja \
+	README README.ja README.org *.rb */*.rb */*/*.rb || eval "rm $< ; false"
+	rm $<
+
+doc-stamp:
+	touch $@
+
+clean:
+	test "`find . -name '*~'`" = "" || rm `find . -name '*~'`
+	test -f doc-stamp || rm doc-stamp
+
+clean-doc:
+	test ! -d doc || rm -rf -v doc
+
+patch:
+	if [ ! -d patch_dir ] ; then \
+	    mkdir patch_dir ;\
+	    cd patch_dir ;\
+	    cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login ;\
+	    cvs -z4 -d :pserver:anonymous@cvs.ruby-lang.org:/src co ruby ;\
+	fi
+	cd patch_dir/ruby ; cvs update
+	test -L patch_dir/ruby/lib/rdoc-f95 || \
+		eval "cd patch_dir/ruby/lib ; ln -s ../../../ rdoc-f95"
+	cd patch_dir/ruby ; \
+	diff \
+		--exclude=rdoc \
+		--exclude=parse_c.rb \
+		--exclude=parse_rb.rb \
+		--exclude=install.rb \
+		--exclude=README* \
+		--exclude=Makefile \
+		--exclude=*~ \
+		--exclude=CVS \
+		--exclude=patch_dir \
+		--exclude=rdoc-cvs.patch \
+		--exclude=rdoc-cvs.patch.tmp \
+		-Nur lib/rdoc/ lib/rdoc-f95/ > ../../rdoc-cvs.patch.tmp \
+		|| true
+	sed "s|^diff.*$$|diff -Nur lib/rdoc/ lib/rdoc-`date +%Y-%m-%d`/|" rdoc-cvs.patch.tmp > rdoc-cvs.patch
+	rm rdoc-cvs.patch.tmp
+
+clean-patch:
+	-rm -v rdoc-cvs.patch.tmp rdoc-cvs.patch
+	-rm -v -rf patch_dir/ruby
+	-rmdir patch_dir
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/README ../rdoc-f95-20070112/README
--- ruby-1.8.5-p12/lib/rdoc/README	2006-08-05 07:00:25.000000000 +0900
+++ ../rdoc-f95-20070112/README	2007-01-12 20:17:53.000000000 +0900
@@ -1,489 +1,389 @@
-= RDOC - Ruby Documentation System
+({Japanese}[link:files/README_ja.html] | English)
 
-This package contains Rdoc and SimpleMarkup. Rdoc is an application
-that produces documentation for one or more Ruby source files. We work
-similarly to JavaDoc, parsing the source, and extracting the
-definition for classes, modules, and methods (along with includes and
-requires).  We associate with these optional documentation contained
-in the immediately preceding comment block, and then render the result
-using a pluggable output formatter. (Currently, HTML is the only
-supported format. Markup is a library that converts plain text into
-various output formats. The Markup library is used to interpret the
-comment blocks that Rdoc uses to document methods, classes, and so on.
-
-This library contains two packages, rdoc itself and a text markup
-library, 'markup'. 
-
-== Roadmap
-
-* If you want to use Rdoc to create documentation for your Ruby source
-  files, read on.
-* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
-* For information on the various markups available in comment
-  blocks, see markup/simple_markup.rb.
-* If you want to drive Rdoc programatically, see RDoc::RDoc.
-* If you want to use the library to format text blocks into HTML,
-  have a look at SM::SimpleMarkup.
-* If you want to try writing your own HTML output template, see
-  RDoc::Page.
-
-== Summary
-
-Once installed, you can create documentation using the 'rdoc' command
-(the command is 'rdoc.bat' under Windows)
-
-  % rdoc [options]  [names...]
-
-Type "rdoc --help" for an up-to-date option summary.
-
-A typical use might be to generate documentation for a package of Ruby
-source (such as rdoc itself). 
-
-  % rdoc
-
-This command generates documentation for all the Ruby and C source
-files in and below the current directory. These will be stored in a
-documentation tree starting in the subdirectory 'doc'.
-
-You can make this slightly more useful for your readers by having the
-index page contain the documentation for the primary file. In our
-case, we could type
-
-  % rdoc --main rdoc/rdoc.rb
-
-You'll find information on the various formatting tricks you can use
-in comment blocks in the documentation this generates.
-
-RDoc uses file extensions to determine how to process each file. File
-names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
-source. Files ending <tt>.c</tt> are parsed as C files. All other
-files are assumed to contain just SimpleMarkup-style markup (with or
-without leading '#' comment markers). If directory names are passed to
-RDoc, they are scanned recursively for C and Ruby source files only.
-
-== Credits
-
-* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
-  work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
-  parser for irb and the rtags package.
-
-* Code to diagram classes and modules was written by Sergey A Yanovitsky
-  (Jah) of Enticla. 
-
-* Charset patch from MoonWolf.
-
-* Rich Kilmer wrote the kilmer.rb output template.
-
-* Dan Brickley led the design of the RDF format.
-
-== License
-
-RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.  It
-is free software, and may be redistributed under the terms specified
-in the README file of the Ruby distribution.
-
-= Usage
-
-RDoc is invoked from the command line using:
-
-   % rdoc <options> [name...]
-
-Files are parsed, and the information they contain collected, before
-any output is produced. This allows cross references between all files
-to be resolved. If a name is a directory, it is traversed. If no
-names are specified, all Ruby files in the current directory (and
-subdirectories) are processed.
-
-Options are:
-
-[<tt>--accessor</tt> <i>name[,name...]</i>]
-    specifies the name(s) of additional methods that should be treated
-    as if they were <tt>attr_</tt><i>xxx</i> methods. Specifying
-    "--accessor db_opt" means lines such as
-
-         db_opt :name, :age
-  
-    will get parsed and displayed in the documentation. Each name may have an
-    optional "=flagtext" appended, in which case the given flagtext will appear
-    where (for example) the 'rw' appears for attr_accessor.
-
-[<tt>--all</tt>]
-    include protected and private methods in the output (by default
-    only public methods are included)
-
-[<tt>--charset</tt> _charset_]
-    Set the character set for the generated HTML.
-
-[<tt>--diagram</tt>]
-    include diagrams showing modules and classes.  This is currently
-    an experimental feature, and may not be supported by all output
-    templates. You need dot V1.8.6 or later to use the --diagram
-    option correctly (http://www.research.att.com/sw/tools/graphviz/).
-
-[<tt>--exclude</tt> <i>pattern</i>]
-    exclude files and directories matching this pattern from processing
-
-[<tt>--extension</tt> <i>new=old</i>]
-    treat files ending <i>.new</i> as if they ended
-    <i>.old</i>. Saying '--extension cgi=rb' causes RDoc to treat .cgi
-    files as Ruby source.
-
-[<tt>fileboxes</tt>]
-    Classes are put in boxes which represents files, where these
-    classes reside. Classes shared between more than one file are
-    shown with list of files that sharing them.  Silently discarded if
-    --diagram is not given Experimental.
-
-[<tt>--fmt</tt> _fmt_]
-    generate output in a particular format.
-
-[<tt>--help</tt>]
-    generate a usage summary.
-
-[<tt>--help-output</tt>]
-    explain the various output options.
-
-[<tt>--image-format</tt> <i>gif/png/jpg/jpeg</i>]
-    sets output image format for diagrams. Can be png, gif, jpeg,
-    jpg. If this option is omitted, png is used. Requires --diagram.
-
-[<tt>--include</tt> <i>dir,...</i>]
-    specify one or more directories to be searched when satisfying
-    :+include+: directives. Multiple <tt>--include</tt> options may be
-    given. The directory containing the file currently being processed
-    is always searched.
-
-[<tt>--inline-source</tt>]
-    By default, the source code of methods is shown in a popup. With
-    this option, it's displayed inline.
-
-[<tt>line-numbers</tt>]
-    include line numbers in the source code
-
-[<tt>--main</tt> _name_]
-    the class of module _name_ will appear on the index page. If you
-    want to set a particular file as a main page (a README, for
-    example) simply specifiy its name as the first on the command
-    line.
-
-[<tt>--merge</tt>]
-    when generating _ri_ output, if classes being processed already
-    exist in the destination directory, merge in the current details
-    rather than overwrite them.
-
-[<tt>--one-file</tt>]
-    place all the output into a single file
-
-[<tt>--op</tt> _dir_]
-    set the output directory to _dir_ (the default is the directory
-    "doc")
-
-[<tt>--op-name</tt> _name_]
-    set the name of the output. Has no effect for HTML.
-    "doc")
-
-[<tt>--opname</tt> _name_]
-    set the output name (has no effect for HTML).
-
-[<tt>--promiscuous</tt>]
-    If a module or class is defined in more than one source file, and
-    you click on a particular file's name in the top navigation pane,
-    RDoc will normally only show you the inner classes and modules of
-    that class that are defined in the particular file. Using this
-    option makes it show all classes and modules defined in the class,
-    regardless of the file they were defined in.
-
-[<tt>--quiet</tt>]
-    do not display progress messages
-
-[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>]
-    generate output than can be read by the _ri_ command-line tool.
-    By default --ri places its output in ~/.rdoc, --ri-site in
-    $datadir/ri/<ver>/site, and --ri-system in
-    $datadir/ri/<ver>/system. All can be overridden with a subsequent
-    --op option. All default directories are in ri's default search
-    path.
-
-[<tt>--show-hash</tt>]
-    A name of the form #name in a comment is a possible hyperlink to
-    an instance method name. When displayed, the '#' is removed unless
-    this option is specified
-
-[<tt>--style</tt> <i>stylesheet url</i>]
-    specifies the URL of an external stylesheet to use (rather than
-    generating one of our own)
-
-[<tt>tab-width</tt> _n_]
-    set the width of tab characters (default 8)
-
-[<tt>--template</tt> <i>name</i>]
-    specify an alternate template to use when generating output (the
-    default is 'standard'). This template should be in a directory
-    accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
-    depends on the output formatter.
-
-[<tt>--version</tt>]
-   display  RDoc's version
-
-[<tt>--webcvs</tt> _url_]
-    Specify a URL for linking to a web frontend to CVS. If the URL
-    contains a '\%s', the name of the current file will be
-    substituted; if the URL doesn't contain a '\%s', the filename will
-    be appended to it.
-
-= Example
-
-A typical small Ruby program commented using RDoc might be as follows. You
-can see the formatted result in EXAMPLE.rb and Anagram.
-
-      :include: EXAMPLE.rb
-
-= Markup
-
-Comment blocks can be written fairly naturally, either using '#' on
-successive lines of the comment, or by including the comment in 
-an =begin/=end block. If you use the latter form, the =begin line
-must be flagged with an RDoc tag:
-
-  =begin rdoc
-  Documentation to 
-  be processed by RDoc.
-  =end
-
-Paragraphs are lines that share the left margin. Text indented past
-this margin are formatted verbatim.
-
-1. Lists are typed as indented paragraphs with:
-   * a '*' or '-' (for bullet lists)
-   * a digit followed by a period for 
-     numbered lists
-   * an upper or lower case letter followed
-     by a period for alpha lists.
-
-   For example, the input that produced the above paragraph looked like
-       1. Lists are typed as indented 
-          paragraphs with:
-          * a '*' or '-' (for bullet lists)
-          * a digit followed by a period for 
-            numbered lists
-          * an upper or lower case letter followed
-            by a period for alpha lists.
-
-2. Labeled lists (sometimes called description
-   lists) are typed using square brackets for the label.
-      [cat]   small domestic animal
-      [+cat+] command to copy standard input
-
-3. Labeled lists may also be produced by putting a double colon
-   after the label. This sets the result in tabular form, so the
-   descriptions all line up. This was used to create the 'author'
-   block at the bottom of this description.
-      cat::   small domestic animal
-      +cat+:: command to copy standard input
-
-   For both kinds of labeled lists, if the body text starts on the same
-   line as the label, then the start of that text determines the block
-   indent for the rest of the body. The text may also start on the line
-   following the label, indented from the start of the label. This is
-   often preferable if the label is long. Both the following are
-   valid labeled list entries:
-
-      <tt>--output</tt> <i>name [, name]</i>::
-          specify the name of one or more output files. If multiple
-          files are present, the first is used as the index.
-
-      <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
-                          index areas, or bit ratios of units as
-                          they are processed.
-
-4. Headings are entered using equals signs
-
-      = Level One Heading
-      == Level Two Heading
-   and so on
-
-5. Rules (horizontal lines) are entered using three or
-   more hyphens.
-
-6. Non-verbatim text can be marked up:
-
-   _italic_::     \_word_ or \<em>text</em>
-   *bold*::       \*word* or \<b>text</b>
-   +typewriter+:: \+word+ or \<tt>text</tt>
-
-   The first form only works around 'words', where a word is a
-   sequence of upper and lower case letters and underscores. Putting a
-   backslash before inline markup stops it being interpreted, which is
-   how I created the table above:
-
-     _italic_::     \_word_ or \<em>text</em>
-     *bold*::       \*word* or \<b>text</b>
-     +typewriter+:: \+word+ or \<tt>text</tt>
-
-7. Names of classes, source files, and any method names
-   containing an underscore or preceded by a hash
-   character are automatically hyperlinked from
-   comment text to their description. 
-
-8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
-   recognized. An HTTP url that references an external image file is
-   converted into an inline <IMG..>.  Hyperlinks starting 'link:' are
-   assumed to refer to local files whose path is relative to the --op
-   directory.
-
-   Hyperlinks can also be of the form <tt>label</tt>[url], in which
-   case the label is used in the displayed text, and <tt>url</tt> is
-   used as the target. If <tt>label</tt> contains multiple words,
-   put it in braces: <em>{multi word label}[</em>url<em>]</em>.
-       
-9. Method parameter lists are extracted and displayed with
-   the method description. If a method calls +yield+, then
-   the parameters passed to yield will also be displayed:
-
-      def fred
-        ...
-        yield line, address
-
-   This will get documented as
-
-      fred() { |line, address| ... }
-
-   You can override this using a comment containing 
-   ':yields: ...' immediately after the method definition
-
-      def fred      # :yields: index, position
-        ...
-        yield line, address
-
-   which will get documented as
-
-       fred() { |index, position| ... }
-
-
-10. ':yields:' is an example of a documentation modifier. These appear
-    immediately after the start of the document element they are modifying.
-    Other modifiers include
-
-    [<tt>:nodoc:</tt><i>[all]</i>]
-         don't include this element in the documentation.  For classes
-         and modules, the methods, aliases, constants, and attributes
-         directly within the affected class or module will also be
-         omitted.  By default, though, modules and classes within that
-         class of module _will_ be documented. This is turned off by
-         adding the +all+ modifier.
-
-              module SM  #:nodoc:
-                class Input
-                end
-              end
-              module Markup #:nodoc: all
-                class Output
-                end
-              end
-
-         In the above code, only class <tt>SM::Input</tt> will be
-         documented.
-
-    [<tt>:doc:</tt>]
-         force a method or attribute to be documented even if it
-         wouldn't otherwise be. Useful if, for example, you want to
-         include documentation of a particular private method.
-
-    [<tt>:notnew:</tt>]
-         only applicable to the +initialize+ instance method. Normally
-         RDoc assumes that the documentation and parameters for
-         #initialize are actually for the ::new method, and so fakes
-         out a ::new for the class. THe :notnew: modifier stops
-         this. Remember that #initialize is protected, so you won't
-         see the documentation unless you use the -a command line
-         option.
-
-
-11. RDoc stops processing comments if it finds a comment
-    line containing '<tt>#--</tt>'. This can be used to 
-    separate external from internal comments, or 
-    to stop a comment being associated with a method, 
-    class, or module. Commenting can be turned back on with
-    a line that starts '<tt>#++</tt>'.
-
-        # Extract the age and calculate the
-        # date-of-birth.
-        #--
-        # FIXME: fails if the birthday falls on
-        # February 29th
-        #++
-        # The DOB is returned as a Time object.
-
-        def get_dob(person)
-           ...
-
-12. Comment blocks can contain other directives:
-
-    [<tt>:section: title</tt>]
-        Starts a new section in the output. The title following
-	<tt>:section:</tt> is used as the section heading, and the
-	remainder of the comment containing the section is used as
-	introductory text. Subsequent methods, aliases, attributes,
-	and classes will be documented in this section. A :section:
-	comment block may have one or more lines before the :section:
-	directive. These will be removed, and any identical lines at
-	the end of the block are also removed. This allows you to add
-	visual cues such as
-
-           # ----------------------------------------
-	   # :section: My Section
-	   # This is the section that I wrote.
-	   # See it glisten in the noon-day sun.
-           # ----------------------------------------
-
-    [<tt>call-seq:</tt>]
-        lines up to the next blank line in the comment are treated as
-        the method's calling sequence, overriding the
-        default parsing of method parameters and yield arguments.
-
-    [<tt>:include:</tt><i>filename</i>] 
-         include the contents of the named file at this point. The
-         file will be searched for in the directories listed by
-         the <tt>--include</tt> option, or in the current
-         directory by default.  The contents of the file will be
-         shifted to have the same indentation as the ':' at the
-         start of the :include: directive.
-
-    [<tt>:title:</tt><i>text</i>]
-         Sets the title for the document. Equivalent to the --title command
-         line parameter. (The command line parameter overrides any :title:
-         directive in the source).
-
-    [<tt>:enddoc:</tt>]
-         Document nothing further at the current level.
-
-    [<tt>:main:</tt><i>name</i>]
-         Equivalent to the --main command line parameter.
-
-    [<tt>:stopdoc: / :startdoc:</tt>]
-         Stop and start adding new documentation elements to the
-         current container. For example, if a class has a number of
-         constants that you don't want to document, put a
-         <tt>:stopdoc:</tt> before the first, and a
-         <tt>:startdoc:</tt> after the last. If you don't specifiy a
-         <tt>:startdoc:</tt> by the end of the container, disables
-         documentation for the entire class or module.
-
-
----
-
-See also markup/simple_markup.rb.
-
-= Other stuff
-
-Author::   Dave Thomas <dave@pragmaticprogrammer.com>
-Requires:: Ruby 1.8.1 or later
-License::  Copyright (c) 2001-2003 Dave Thomas.
-           Released under the same license as Ruby.
-
-== Warranty
-
-This software is provided "as is" and without any express or
-implied warranties, including, without limitation, the implied
-warranties of merchantibility and fitness for a particular
-purpose.
+= Enhanced version of RDoc Fortran 90/95 parser
+
+Here is a patch file to improve
+the RDoc[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+analysis feature 
+for Fortran 90/95 source codes.
+A patched package of RDoc source is also available. 
+
+== Operation verification 
+
+Operation of the package has been verified with Ruby 1.8.2.
+
+== Download
+
+The latest version (Version $Name: rdoc-f95-20070112 $)
+
+* {Patch for Ruby 1.8.5-p12}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.8.5-p12.patch]
+
+* {TGZ file of patched RDoc resources}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95.tgz]
+
+Archives of old versions
+
+* {Patch files, TGZ packages, source code trees (only JAPANESE)}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/arch/SIGEN.htm]
+
+* {Binary packages for Debian GNU/Linux}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/debian]
+
+
+== Installation
+
+You have the following three ways for installation.
+
+=== Installation by applying the patch to original Ruby package
+
+To use the patch file, follow the steps described below:
+
+* Download
+  ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.tar.gz
+  from {Ruby Home Page}[http://www.ruby-lang.org/].
+
+* Unpack the archive file as
+
+    % tar -zxvf ruby-1.8.5-p12.tar.gz
+
+* Put the patch file (rdoc-f95_ruby1.8.5-p12.patch)
+  in the directory where you executed the tar command 
+  and apply the patch; 
+
+    % patch -p0 < rdoc-f95_ruby1.8.5-p12.patch
+
+* Install RDoc package as written in 
+  {Site of the Ruby}[http://www.ruby-lang.org/].
+
+
+=== Installation by using patched RDoc package
+
+To install the patched RDoc package, 
+follow the steps described below: 
+
+* Download archive file rdoc-f95.tgz
+
+* Unpack:
+
+    % tar -zxvf rdoc-f95.tgz
+
+* Go into the Ruby source directory:
+
+    % cd rdoc-f95
+
+* Install the package:
+
+    % ruby install.rb
+
+<b>If rdoc is already installed, the original rdoc will be overritten</b>.
+
+Use --help option to show options and the directory to which
+rdoc is installed:
+
+  % ruby install.rb --help
+
+=== Installation by using binary packages for Debian GNU/Linux
+
+Add following URL to sources.list of APT (/etc/apt/sources.list).
+You can use "ftp" protocol instead of "http".
+
+  deb http://www.gfd-dennou.org/library/cc-env/Linux/debian-dennou stable/
+
+Install by APT commands.
+
+  % apt-get update
+  % apt-get install rdoc-f95
+
+This "rdoc-f95" package disables original "rdoc" package
+because "rdoc-f95" moves files of "rdoc" to diverted location.
+If you want to use original "rdoc" package, please remove "rdoc-f95".
+Then files of original "rdoc" package will be returned to proper location.
+
+Following suggested packages enable you to use "diagram" and
+"mathml" options (see below).
+
+  % apt-get install graphviz libmathml-ruby
+
+
+== Usage
+
+Set the environment variable *PATH* to include
+the directory where the execution program is installed, 
+and *RUBYLIB* to include the directory 
+where the libraries are installed.
+
+Move to a directory where your Fortran 90/95 files exist, 
+and execute the following command.  HTML documents will be generated in
+*doc* directory.
+
+  % rdoc -U --ignore-case --inline-source
+
+Files ending <tt>.f90</tt>, <tt>.F90</tt>, <tt>.f95</tt>, <tt>.F95</tt>
+are parsed as Fortran 90/95 programs.
+All Fortran 90/95 programs in subdirectories are parsed recursively.
+
+Just as in the original RDoc, files ending with <tt>.rb</tt> and <tt>.rbw</tt>
+are parsed as Ruby programs and files ending with <tt>.c</tt>, <tt>.cc</tt>,
+<tt>.cpp</tt>, <tt>.CC</tt>, <tt>.cxx</tt> are parsed as C programs.
+
+With the option <tt>--op</tt>,  
+the directory where HTML documents are generated can be changed.
+<tt>--title</tt> option sets title of HTML documents.
+When <tt>--all</tt> option is used, 
+private subroutines, functions etc. in
+Fortran 90/95 programs are shown in HTML documents (for developers).
+If files or directories are specified as arguments (for example,
+"<tt>src/*.f90</tt>" or "<tt>test/</tt>"), the particular files
+are parsed.
+In the following example, files with suffix "<tt>.f90</tt>" in a
+directory "<tt>src/</tt>" and files in a directory "<tt>test/</tt>"
+are parsed.
+
+  % rdoc -U --ignore-case --inline-source  \
+         --op rdoc --title "RDoc documentations" src/*.f90 test/
+
+Alternatively, you can parse only a part of files by creating a
+"<tt>.document</tt>" file and writing names of the files and the
+directories to the file.
+
+For more information, 
+see {README of original RDoc}[link:files/README_org.html].
+
+
+== Rules for RDoc Document
+
+Refer to <b>parsers/parse_f95.rb</b> which
+explains parsed information, way of looking at documents,
+the format of comment blocks in Fortran 90/95 source code.
+If you use "--mathml" option (see below),
+refer to <b>Generators::TexParser</b>, too.
+For general information, see
+{README of original RDoc}[link:files/README_org.html] .
+
+== Samples
+
+* {Code reference of data I/O library gt4f90io (only JAPANESE)}[http://www.gfd-dennou.org/library/gtool4/gt4f90io/gt4f90io_current/doc/develop_reference/]
+
+* {Code reference of planetary atmospheric general circulation model DCPAM (only JAPANESE)}[http://www.gfd-dennou.org/library/dcpam/dcpam3/dcpam3_current/doc/code_reference/htm]
+
+== Differences from original RDoc
+
+This patch has been created for enhancing the Fortran 90/95 parser of RDoc .
+{The Fortran 90/95 parse script parse_f95.rb}[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/rdoc/parsers/parse_f95.rb] 
+is mainly modified, and other programs are also improved.
+
+
+The original RDoc has been developed by Dave Thomas and is now
+maintained by Ryan Davis. RDoc is available from Ruby CVS
+repository http://www.ruby-lang.org/ja/20020106.html .
+For more information about RDoc, 
+see
+{README of original RDoc}[link:files/README_org.html] .
+
+Differences to the original one are given below.
+Note that some differences were lost because
+this patch (2005/12/17 version) has been already included into
+the original RDoc package.
+
+--
+#<b>Enhancement of an analytical performance of Fortran 90/95 source codes</b> ::
+#    See parsers/parse_f95.rb for details.
+
+#<b>Modification of format of comment blocks</b> ::
+#    See parsers/parse_f95.rb for details.
+++
+
+<b>Addition of <tt>--ignore-case</tt> option </b> ::
+    In the Fortran 90/95 Standard,  
+    upper case letters are not distinguished from lower case letters, 
+    although original RDoc produces case-dependently 
+    cross-references of Class and  Methods.
+    When this options is specified, 
+    upper cases are not distinguished from lower cases.
+
+<b>Cross-reference of file names</b> ::
+    Cross-reference of file names is available as well as
+    modules, subroutines, and so on.
+
+<b>Modification of <tt>--style</tt> option</b> ::
+    Original RDoc can not treat relative path stylesheet.
+    Application of this patch modifies this function.
+
+<b>Conversion of TeX formula into MathML</b>::
+    TeX formula can be converted into MathML format
+    with --mathml option, 
+    if <b>MathML library for Ruby version 0.6b</b> is installed.
+    This library is available from {Bottega of Hiraku (JAPANESE only)}[http://www.hinet.mydns.jp/~hiraku/].
+    See <b>Generators::TexParser</b> about format.
+
+    <b>*** Caution ***</b>
+    Documents generated with "--mathml" option are not displayed correctly
+    according to browser and/or its setting.
+    We have been confirmed that 
+    documents generated with "--mathml" option are displayed correctly
+    with {Mozilla Firefox}[http://www.mozilla.or.jp/products/firefox/]
+    and Internet Explorer
+    (+ {MathPlayer}[http://www.dessci.com/en/products/mathplayer/]).
+    See {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html]
+    for other browsers.
+
+Some formats of comments in HTML document are changed
+to improve the analysis features.
+See <b>parsers/parse_f95.rb</b> for details.
+
+
+== Remarks on usage
+
+The enhanced version of the RDoc Fortran 90/95 parser
+has been constructed on the premise of
+educational and academic usages only. 
+For these uses, usage and modification of the resources
+withiout notification to the authors is permitted.
+Licence of the enhanced version of RDoc Fortran 90/95 parser 
+conforms to that of original RDoc.
+See {README of original RDoc}[link:files/README_org.html] .
+
+When you publish your scientific/technological works
+using the enhanced version of RDoc Fortran 90/95 parser, 
+we will be very glad if you cite our resources 
+in the following way:
+
+  Morikawa,Y., Ishiwatari,M., Horinouchi,T., Odaka,M., Hayashi,Y.-Y.,
+  dcmodel: Numerical Model Project, 2007:
+  Enhanced version of RDoc Fortran 90/95 parser,
+  http://www.gfd-dennou.org/library/dcmodel/, GFD Dennou Club.
+
+== Contact
+
+To contact us, please send an email to link:../rdoc-f95-mailto.png .
+
+== History
+
+==== 2007/01/12
+
+* A bug that Fortran 90/95 source code like
+  "FUNCTION Get_Platform() RESULT(platform)" is converted to
+  "Get_Platform( platform ) result(platform)" is fixed.
+  (by the advice from Hani Andreas Ibrahim).
+
+==== 2007/01/09
+
+* <b>Generators::TexParser</b> is modified.
+
+==== 2007/01/05
+
+* Contact address is changed.
+* Ruby version of a patch file is updated to 1.8.5-p12.
+* Document "Usage of \newcommand and \newenvironment" is added in
+  <b>Generators::TexParser</b>.
+* Document "Cross-reference of defined operators and defined
+  assignments" is added in <b>parsers/parse_f95.rb</b>.
+* Document "The sequence of displayed entities" in
+  <b>parsers/parse_f95.rb</b> is modified.
+* A bug that '--ignore-case' option is invalid partly is fixed.
+
+==== 2006/12/15
+
+* Ruby version of a patch file is updated to 1.8.5-p2
+
+==== 2006/12/13
+
+* The sequence of displayed entities can be ordered manually by
+  the comment like "!:doc-priority 100:".
+
+==== 2006/11/20
+
+* Description about ".docuemnt" file is added.
+* Some subprograms which have different names in one interface block
+  are parsed correctly.
+* Import updates of RDoc in original Ruby CVS.
+
+==== 2006/11/16
+
+* Generators::TexParser is modified/
+  * A way to write equations across multiple lines is described in document.
+  * The format of CVS keywords, that is "$ID: ... $" or
+    "$LOG: ... $ etc. is ignored.
+* All methods added to "code_object.rb" for "parse_f95.rb" are moved
+  to "parse_f95.rb". Therefore "parse_f95.rb" works alone in Ruby
+  1.8.5 .
+
+==== 2006/11/14
+
+* Ruby version of a patch file is updated to 1.8.5
+* Patch filename is changed.
+* Debian GNU/Linux binary packages are modified.
+* XHTML version of documents is changed from "XHTML 1.0 Transitional"
+  to "XHTML 1.1 plus MathML 2.0".
+* Interpreter of continuous lines is modified.
+* Import updates of RDoc in original Ruby CVS.
+* English is corrected with comments of Dr. Geiger (Institute for
+  Plasma Physics)
+* File names beginning "../" are parsed correctly.
+* A version of MathML library for Ruby is changed from 0.5 to 0.6b.
+* Syntax error with MathML library for Ruby is avoided.
+
+==== 2006/08/15
+
+* Description about installation with binary packages for Debian GNU/Linux
+  is modified.
+* Bugs about parsing comments of NAMELIST is modified.
+
+==== 2006/08/14
+
+* Package name is changed as "rdoc-f95" from "rdoc-dennou".
+* Address is changed as
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/
+* README and README.ja are modified.
+* Conversion of TeX formula into MathML is enable.
+* Modification of --style option.
+* Main programs are added to 'Methods' too.
+* The NAMELIST group names scattered in each file are collected on one page.
+* Names of modules provided by F90 files are added to documents of the files
+  automatically.
+
+
+==== 2006/02/24
+
+* English version of README is created.
+
+==== 2006/01/18
+* Comment formats for arguments of subroutines and functions 
+  are slightly modified.
+
+  * A space is inserted below the argument described in HTML document.
+
+* Patched package is rebulid with
+  updated Ruby resources in CVS repository.
+
+==== 2005/12/28
+* Patch file for ruby 1.8.4 is released.
+
+==== 2005/12/17
+
+* Some bugs are fixed.
+* Parsing external subroutines specified interface are improved.
+* Handling of Continuation lines are improved.
+
+==== 2005/12/13
+
+* Remarks and Todo are added in parsers/parse_f95.rb 
+* Sample is added in README
+* Parsing part of  public, private statements
+  are improved. 
+
+==== 2005/12/08
+
+* "Remarks in use" and "Contact" are added in README .
+* Address is changed as 
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/
+
+==== 2005/11/28
+
+* ":nodoc:" tag are available.
+* Parsing "contains" in subroutines and functions are improved.
+* Title is changed.
+* Old version of the patches are placed in web page.
+
+==== 2005/11/17
+
+* Improvement of analysis features, checking HTML documents 
+  which are produced by RDoc.
+  release of preliminary version.
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/README.ja ../rdoc-f95-20070112/README.ja
--- ruby-1.8.5-p12/lib/rdoc/README.ja	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20070112/README.ja	2007-01-12 20:17:53.000000000 +0900
@@ -0,0 +1,436 @@
+(Japanese | {English}[link:files/README.html])
+
+= RDoc Fortran 90/95 ソースコード解析機能強化版
+
+{RDoc - Ruby Documentation System}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+の Fortran 90/95 ソースコード解析機能を強化するためのパッチを
+配布しています. パッチを適用したパッケージも配布しています.
+
+== 動作確認
+
+このパッケージは Ruby 1.8.2 での動作を確認しています.
+
+== ダウンロード
+
+最新版 (バージョン $Name: rdoc-f95-20070112 $)
+
+* {Ruby 1.8.5-p12 用のパッチ}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95_ruby1.8.5-p12.patch]
+
+* {rdoc-f95 tar.gz パッケージ (Ruby 1.8.5-p12 の rdoc の部分を取り出し, 上記パッチを適用して tar ボールにしたもの)}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/rdoc-f95.tgz]
+
+過去のアーカイブ
+
+* {パッチ ・ TGZ パッケージ ・ ソースツリーのリスト}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/arch/SIGEN.htm]
+
+* {Debian GNU/Linux 用バイナリパッケージ}[http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/debian]
+
+== インストール
+
+インストールには以下の 3 つの方法があります.
+
+=== パッチファイルを利用する方法
+
+パッチファイルを Ruby のオリジナル資源に適用する手順は
+以下の通りです.
+
+* まず, {Ruby のホームページ}[http://www.ruby-lang.org/] から
+  ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.tar.gz
+  をダウンロードしてください
+
+* 上記 TGZ ファイルを展開してください.
+
+    % tar xvfz ruby-1.8.5-p12.tar.gz
+
+* このコマンドを実行したディレクトリに上記のパッチファイル
+  rdoc-f95_ruby1.8.5-p12.patch を置き, 以下のコマンドでパッチを
+  適用してください.
+
+    % patch -p0 < rdoc-f95_ruby1.8.5-p12.patch
+
+* パッチを適用した後に, Ruby のインストール作業を行ってください.
+  Ruby のインストール方法は
+  {オブジェクト指向スクリプト言語 Ruby のホームページ}[http://www.ruby-lang.org/]
+  を参照してください.
+
+=== パッチが適用されたパッケージを利用する方法
+
+パッチが適用された rdoc-f95.tgz パッケージを使用するには
+以下のようにします.
+
+アーカイブファイル rdoc-f95.tgz をダウンロードした後に, 
+以下のように tar コマンドで展開後,
+install.rb でインストールを行ってください.
+<b>既に rdoc がインストールされている場合, 上書きする可能性があります</b>.
+
+  % tar xvfz rdoc-f95.tgz
+  % cd rdoc-f95
+  % ruby install.rb
+
+インストール先のディレクトリや, 変更のためのオプションに関しては,
+以下のコマンドで知ることが出来ます.
+
+  % ruby install.rb --help
+
+=== Debian GNU/Linux 用バイナリパッケージを利用する方法
+
+以下の URL を APT のソースリスト (/etc/apt/sources.list) に加えます.
+プロトコルとして http の代わりに ftp を用いることも可能です.
+
+  deb http://www.gfd-dennou.org/library/cc-env/Linux/debian-dennou stable/
+
+APT のコマンドでインストールを行ないます.
+
+  % apt-get update
+  % apt-get install rdoc-f95
+
+このパッケージはオリジナルの rdoc パッケージのファイル群を退避した場所
+へ移動させるため, オリジナルの rdoc パッケージが使用できなくなります.
+オリジナルの rdoc パッケージを使用する場合は rdoc-f95
+パッケージを削除してください. 退避されたオリジナルの rdoc パッケージの
+ファイル群が本来の場所に復帰します.
+
+以下の提案パッケージをインストールしておくと,
+diagram オプションや mathml オプション (下記参照) が使用可能になります.
+
+  % apt-get install graphviz libmathml-ruby
+
+
+== RDoc の使用方法
+
+実行プログラムがインストールされた場所を環境変数 *PATH*
+に設定し, ライブラリがインストールされた場所を環境変数 *RUBYLIB*
+に設定してください.
+
+Fortran 90/95 ファイルが置いてあるディレクトリまで移動し, 以下のコマンドを
+実行してください. *doc* ディレクトリ以下にドキュメントが作成されます.
+
+  % rdoc -U --ignore-case --charset euc-jp --inline-source
+
+拡張子が <tt>.f90</tt>, <tt>.F90</tt>, <tt>.f95</tt>, <tt>.F95</tt>
+であるファイルは Fortran 90/95 プログラムとして解析されます.
+サブディレクトリ以下の全ての Fortran 90/95 プログラムも解析されます.
+
+なお, オリジナルの RDoc と同様, 拡張子が <tt>.rb</tt>,
+<tt>.rbw</tt> であるファイルは Ruby プログラムとして, 拡張子が 
+<tt>.c</tt>, <tt>.cc</tt>, <tt>.cpp</tt>, <tt>.CC</tt>, <tt>.cxx</tt> 
+であるファイルは C プログラムとして解析されます.
+
+*doc* ディレクトリ以外に出力したい場合は, 
+<tt>--op</tt> オプションをつけてください. 
+タイトルは
+<tt>--title</tt> オプションで変更できます.
+また, デフォルトでは Fortran 90/95 の private 属性のサブルーチンや関数
+などはドキュメントに出力されませんが, <tt>--all</tt> オプションを
+つけることで, 全てがドキュメントに出力されます.
+<tt>--charset</tt>オプションは, ドキュメントに反映されるコメントに
+日本語など 2 バイト文字が含まれる場合に用います.
+コメントの文字コードに合わせ, <tt>euc-jp</tt>, <tt>Shift_JIS</tt>,
+<tt>iso-2022-jp</tt> などを指定してください.
+
+一部のファイルのみを
+ドキュメント化したい場合は, 引数に <tt>src/*.f90</tt> などと
+ファイル名やディレクトリ名を明示的に指定してください.
+以下の例では, "<tt>src/</tt>" 以下のディレクトリに存在する
+拡張子 "<tt>.f90</tt>" のファイルと,
+"<tt>test</tt>" ディレクトリ以下のファイルがドキュメント化されます.
+
+  % rdoc -U --ignore-case --charset euc-jp --inline-source  \
+         --op rdoc --title "RDoc documentations" src/*.f90 test/
+
+この方法以外にも, "<tt>.document</tt>" ファイルを作成し, その中に
+ファイル名やディレクトリ名を記述しておくことでドキュメント化する
+ファイルを限定することが出来ます.
+
+詳しいことは
+{RDoc オリジナルの README}[link:files/README_org.html] 
+を参照ください.
+
+
+== 書法
+
+解析される情報やドキュメントの見方, コメント部の書き方に関しては,
+<b>parsers/parse_f95.rb</b> を参照ください. --mathml オプション (下記参照)
+を使用する場合には, <b>Generators::TexParser</b> も参照ください.
+ただし, これらに記述されるのは Fortran 90/95 などに特有な部分なので,
+一般的な部分に関しては
+{RDoc オリジナルの README}[link:files/README_org.html] 
+を参照ください.
+大林さんによる日本語訳が http://www.kmc.gr.jp/~ohai/rdoc.ja.html にあります.
+
+== サンプル
+
+* {データ I/O ライブラリ gt4f90io のコードリファレンス}[http://www.gfd-dennou.org/library/gtool4/gt4f90io/gt4f90io_current/doc/develop_reference/]
+
+* {惑星大気モデル DCPAM のコードリファレンス (製作中)}[http://www.gfd-dennou.org/library/dcpam/dcpam3/dcpam3_current/doc/code_reference/htm]
+
+
+== オリジナルの RDoc との違い
+
+ここで配布するパッチは, RDoc の Fortran 90/95 ソースコードの
+解析能力を大幅に向上させ, Fortran 90/95 プログラムから
+自動生成されるドキュメントの情報量を充実させます.
+主に改良されているのは, 元々の RDoc に付属される
+{Fortran 90/95 解析プログラム parse_f95.rb}[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/rdoc/parsers/parse_f95.rb]
+ですが, 他のいくつかのプログラムにも改良を施しています.
+
+オリジナルの RDoc は Dave Thomas さんによって開発され, 
+現在では Ryan Davis さんによってメンテナンスされています.
+オリジナルの RDoc は
+Ruby の CVS レポジトリ
+http://www.ruby-lang.org/ja/20020106.html
+より取得できます.
+オリジナルの RDoc に関しては
+{RDoc オリジナルの README}[link:files/README_org.html]
+を参照してください.
+
+
+オリジナルからの変更点の主なものは以下の通りです.
+なお, 既にこのパッチ (2005/12/17 バージョン) は
+Ruby 本家の CVS リポジトリへとフィードバックされているので,
+一部は既に「オリジナルとの変更点」
+ではなくなっていることに注意してください.
+
+<b><tt>--ignore-case</tt> オプションの追加</b> ::
+    Fortran 90/95 規格では大文字小文字の区別はありません.
+    これに対して, オリジナルの RDoc はクラス名やメソッド名の
+    クロスリファレンスの際に大文字小文字を区別します. 
+    このオプションを与えることにより,
+    その区別を行わないようにします.
+
+<b>ファイルのクロスリファレンス</b> ::
+    クラスやモジュール, メソッドと同様に, ファイル名に関しても
+    クロスリファレンスを可能にしました.
+
+<b><tt>--style</tt> オプションの改良</b> ::
+    オリジナルの RDoc では, 相対パスでスタイルシートを指定した場合,
+    各ドキュメントのスタイルシートへのパスが正しく設定されません.
+    このパッチを適用することで, 正しく設定されるようになります.
+
+<b>TeX で書かれた数式の MathML への変換</b> ::
+    {ひらくの工房}[http://www.hinet.mydns.jp/~hiraku/]
+    にて公開されている
+    <b>Ruby 用 MathML ライブラリのバージョン 0.6b</b> を
+    インストールすることで, TeX で書かれた数式を
+    MathML の形式に変換することが可能です. この機能を有効
+    にするためには rdoc コマンドに --mathml オプションを
+    指定してください.
+    TeX で数式を書く際の書式に関しては
+    <b>Generators::TexParser</b> を参照してください.
+
+    <b>※ 注意 ※</b> --mathml オプションを使用した際に作成される
+    ドキュメントはブラウザによっては正しく表示されないことも
+    あります.
+    {Mozilla Firefox}[http://www.mozilla.or.jp/products/firefox/]
+    および Internet Explorer
+    (+ {MathPlayer}[http://www.dessci.com/en/products/mathplayer/])
+    では正しく表示されることを確認しています.
+    その他のブラウザの MathML 対応に関しては,
+    {MathML 日本語情報}[http://washitake.com/MathML/] 
+    や {MathML Software - Browsers}[http://www.w3.org/Math/Software/mathml_software_cat_browsers.html]
+    などを参照してください.
+
+--
+# 以降は Fortran とは関係の無い改変
+#
+#<b>Ruby ライブラリ IRB::SLex の読み込みについて</b> ::
+#    Ruby 1.8.2 でも動作するよう, 最新の parse_rb.rb を１つ以前の
+#    バージョンに戻しています.
+#
+#
+#<b>拡張子<tt>cxx</tt>も C パーサで解釈</b> ::
+#    これは全く Fortran 90/95 とは関係ありません.
+#    この拡張子 <tt>cxx</tt> は <tt>c++</tt> ファイルから
+#    SWIG[http://swig.shibu.jp/] によって作成されるファイルの拡張子です.
+++
+
+解析能力が向上されたのに伴い, ドキュメントに反映されるコメントの書法の
+多少変更されています. 
+<b>parsers/parse_f95.rb</b> を参照してください.
+
+
+== 使用上の注意
+
+RDoc Fortran 90/95 ソースコード解析機能強化版のパッチもしくはパッケージ
+(以下, 本パッチもしくはパッケージ)は, 
+研究・教育の場で用いられることを前提としております. 教育現場においては自由に使用・改変していただいて結構です. 
+ライセンス規定は本家 RDoc に準拠します.
+{RDoc オリジナルの README}[link:files/README_org.html] 
+を参照ください.
+
+本パッチもしくはパッケージを利用して得られた科学技術的成果を
+論文や Web 等にて発表する際には, その旨を記し, リファレンスに挙げて
+頂きますようお願いします.
+
+* 引用例 (和文)
+
+    森川 靖大, 石渡 正樹, 堀之内 武, 小高 正嗣, 林 祥介,
+    数値モデリングプロジェクト dcmodel, 2007:
+    RDoc Fortran 90/95 ソースコード解析機能強化版,
+    http://www.gfd-dennou.org/library/dcmodel/, 地球流体電脳倶楽部.
+
+* 引用例 (英文)
+
+    Morikawa,Y., Ishiwatari,M., Horinouchi,T., Odaka,M., Hayashi,Y.-Y.,
+    dcmodel: Numerical Model Porject, 2007:
+    Enhanced version of RDoc Fortran 90/95 parser,
+    http://www.gfd-dennou.org/library/dcmodel/, GFD Dennou Club.
+
+
+== 連絡先
+
+コメントや意見, 質問などは link:../rdoc-f95-mailto.png までお寄せください.
+
+
+== 履歴
+
+==== 2007/01/12
+
+* "FUNCTION Get_Platform() RESULT(platform)" のような
+  Fortran 90/95 ソースコードが
+  "Get_Platform( platform ) result(platform)" のように表示されてしまう
+  バグの修正 (Hani Andreas Ibrahim 氏による報告より).
+
+==== 2007/01/09
+
+* <b>Generators::TexParser</b> の修正.
+
+==== 2007/01/05
+
+* 連絡先アドレスを変更.
+* パッチファイルを Ruby バージョン 1.8.5-p12 に対応.
+* <b>Generators::TexParser</b> に
+  解説「\newcommand, \newenvironment の使用方法」を追加.
+* <b>parsers/parse_f95.rb</b> に
+  解説「利用者定義演算子, 利用者定義代入のクロスリファレンス」を追加.
+* <b>parsers/parse_f95.rb</b> の
+  解説「言語要素の表示順序」を修正
+* クロスリファレンス時に一部 '--ignore-case' オプションが効かない
+  問題を修正.
+
+==== 2006/12/15
+
+* パッチファイルを Ruby バージョン 1.8.5-p2 に対応.
+
+
+==== 2006/12/13
+
+* "!:doc-priority 100:" といったコメントの記述により,
+  表示される言語要素の順番を明示的に変更可能にする.
+
+==== 2006/11/20
+
+* ".document" ファイルについて追記.
+* 一つの interface ブロック内に記述される異なる名前の複数の
+  副プログラムを正しく解析できるよう修正.
+* Ruby 本家の CVS の更新内容を移植.
+
+==== 2006/11/16
+
+* Generators::TexParser の改良.
+  * 解説文書に, 数式を複数行で表示する場合の例を追記.
+  * "$ID: ... $" や "$LOG: ... $ といった,
+    CVS のキーワードとして用いられている書き方は数式として扱わない.
+* parse_f95.rb のために code_object.rb に追加した
+  全てのメソッドを parse_f95.rb へ移動した. これにより,
+  parse_f95.rb 単体を Ruby 1.8.5 に組み込んで使用することが可能となった.
+
+==== 2006/11/14
+
+* パッチファイルを Ruby バージョン 1.8.5 に対応.
+* パッチのファイル名を変更.
+* Debian GNU/Linux のバイナリパッケージの作成方法を修正.
+* 生成されるドキュメントの XHTML のバージョン を XHTML 1.0
+  Transitional から XHTML 1.1 plus MathML 2.0 へ変更.
+* Fortran 90/95 パーサにおいて, 継続行の処理方法を修正.
+* Ruby 本家の CVS の更新内容を移植.
+* Institute for Plasma Physics の Giger 氏のコメントを受けて英語を修正
+* "../" で始まるファイル名をパースできないバグを修正.
+* 使用する Ruby 用 MathML ライブラリのバージョンを 0.5 から 0.6a へ.
+* Ruby 用 MathML ライブラリを使用する際, エラーが生じても警告を発して
+  動作を継続するよう修正.
+
+==== 2006/08/15
+
+* Debian GNU/Linux 用バイナリパッケージのインストール方法を改定.
+* NAMELIST のコメントを取得するプログラムのバグを修正.
+
+==== 2006/08/14
+
+* パッケージ名を rdoc-dennou から rdoc-f95 に変更.
+* 公開アドレスを
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/ から
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-f95/ へ変更.
+  (過去の URL もしばらく残しておきます).
+* README, README.ja の修正.
+* TeX で書かれた数式を MathML への変換する機能を追加.
+* style オプションの改良.
+* 主プログラムも 'Methods' の欄に追加.
+* 各ファイルに点在している NAMELIST 変数群を自動的に一箇所に
+  集約して表示するよう改良.
+* F90 ファイルが提供するモジュール群の名前を,
+  自動的にファイルのドキュメントに追記するよう改良.
+
+
+==== 2006/02/24
+
+* 英語版 README の作成
+
+* README.ja の修正.
+
+
+==== 2006/01/18
+* サブルーチン, 関数の引数の情報をコメントとして出力する際の書式を
+  少しだけ修正.
+
+  * 引数情報をコメントに出力する際, 引数の後ろに空白を挿入した.
+    これにより, メソッドの並び替えを行う際 (メソッドはメソッド名,
+    引数, コメントの順に大きさを比較し, 並べる順序を決める),
+    "args" が "args(:)" よりも前に来るようになる.
+
+* 本家 Ruby の CVS リポジトリ内の更新を受け, 最新版をこちらの
+  パッケージ版にも移植.
+
+==== 2005/12/28
+* ruby 1.8.4 のリリースに伴い, パッチを 1.8.4 用に変更.
+
+==== 2005/12/17
+
+* 同名の手続き同士で公開・非公開属性を誤って設定してしまうバグを修正.
+* 以下のバグを修正
+  * program, module, subroutine, function の end 文は必ず
+    end program, end module, end subroutine, end function のように
+    記述しないと, 書法を正しく解析出来ない.
+  * program 〜 end program 文の, 最初と最後の program という文字を
+    省略した場合, program 文の内部で定義されるものは全て public だと
+    認識される.
+  * ";" の文字をコメント内でも改行に変換してしまう
+* !-- 〜 !++ によるコメント削除の指定の際に, "!" よりも前に空白を
+  含んでよいように修正.
+* interface 文で指定される外部手続きの解析を修正.
+* 継続行の扱いを修正.
+
+==== 2005/12/13
+
+* parsers/parse_f95.rb に注意事項と Todo を追加.
+* 「サンプル」を追加.
+* public, private 文を解析する部分のバグを修正.
+
+==== 2005/12/08
+
+* 「使用上の注意」, 「連絡先」を追加.
+* 公開アドレスを
+  http://www.gfd-dennou.org/library/dcmodel/doc/rdoc-dennou/ から
+  http://www.gfd-dennou.org/library/dcmodel/rdoc-dennou/ へ変更.
+  (過去の URL もしばらく残しておきます).
+
+==== 2005/11/28
+
+* ":nodoc:" の指定を可能にする.
+* サブルーチンや関数内の "contains" 文の処理方法を修正する.
+* 表題を変更する.
+* 過去のバージョンを公開する.
+
+==== 2005/11/17
+
+* 一通り欲しい機能が揃い, ドキュメントのチェックも行ったので,
+  タグをつけて公開する.
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/README.org ../rdoc-f95-20070112/README.org
--- ruby-1.8.5-p12/lib/rdoc/README.org	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20070112/README.org	2006-07-08 14:56:44.000000000 +0900
@@ -0,0 +1,502 @@
+= RDOC - Ruby Documentation System
+
+== Annotation
+
+This is a copy from 
+{RDoc original README}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
+
+See README or README.ja .
+
+== Overview
+
+This package contains Rdoc and SimpleMarkup. Rdoc is an application
+that produces documentation for one or more Ruby source files. We work
+similarly to JavaDoc, parsing the source, and extracting the
+definition for classes, modules, and methods (along with includes and
+requires).  We associate with these optional documentation contained
+in the immediately preceding comment block, and then render the result
+using a pluggable output formatter. (Currently, HTML is the only
+supported format. Markup is a library that converts plain text into
+various output formats. The Markup library is used to interpret the
+comment blocks that Rdoc uses to document methods, classes, and so on.
+
+This library contains two packages, rdoc itself and a text markup
+library, 'markup'. 
+
+== Roadmap
+
+* If you want to use Rdoc to create documentation for your Ruby source
+  files, read on.
+* If you want to include extensions written in C, see rdoc/parsers/parse_c.rb.
+* For information on the various markups available in comment
+  blocks, see markup/simple_markup.rb.
+* If you want to drive Rdoc programatically, see RDoc::RDoc.
+* If you want to use the library to format text blocks into HTML,
+  have a look at SM::SimpleMarkup.
+* If you want to try writing your own HTML output template, see
+  RDoc::Page.
+
+== Summary
+
+Once installed, you can create documentation using the 'rdoc' command
+(the command is 'rdoc.bat' under Windows)
+
+  % rdoc [options]  [names...]
+
+Type "rdoc --help" for an up-to-date option summary.
+
+A typical use might be to generate documentation for a package of Ruby
+source (such as rdoc itself). 
+
+  % rdoc
+
+This command generates documentation for all the Ruby and C source
+files in and below the current directory. These will be stored in a
+documentation tree starting in the subdirectory 'doc'.
+
+You can make this slightly more useful for your readers by having the
+index page contain the documentation for the primary file. In our
+case, we could type
+
+  % rdoc --main rdoc/rdoc.rb
+
+You'll find information on the various formatting tricks you can use
+in comment blocks in the documentation this generates.
+
+RDoc uses file extensions to determine how to process each file. File
+names ending <tt>.rb</tt> and <tt>.rbw</tt> are assumed to be Ruby
+source. Files ending <tt>.c</tt> are parsed as C files. All other
+files are assumed to contain just SimpleMarkup-style markup (with or
+without leading '#' comment markers). If directory names are passed to
+RDoc, they are scanned recursively for C and Ruby source files only.
+
+== Credits
+
+* The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
+  work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
+  parser for irb and the rtags package.
+
+* Code to diagram classes and modules was written by Sergey A Yanovitsky
+  (Jah) of Enticla. 
+
+* Charset patch from MoonWolf.
+
+* Rich Kilmer wrote the kilmer.rb output template.
+
+* Dan Brickley led the design of the RDF format.
+
+== License
+
+RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.  It
+is free software, and may be redistributed under the terms specified
+in the README file of the Ruby distribution.
+
+
+= Usage
+
+RDoc is invoked from the command line using:
+
+   % rdoc <options> [name...]
+
+Files are parsed, and the information they contain collected, before
+any output is produced. This allows cross references between all files
+to be resolved. If a name is a directory, it is traversed. If no
+names are specified, all Ruby files in the current directory (and
+subdirectories) are processed.
+
+Options are:
+
+[<tt>--accessor</tt> <i>name[,name...]</i>]
+    specifies the name(s) of additional methods that should be treated
+    as if they were <tt>attr_</tt><i>xxx</i> methods. Specifying
+    "--accessor db_opt" means lines such as
+
+         db_opt :name, :age
+  
+    will get parsed and displayed in the documentation. Each name may have an
+    optional "=flagtext" appended, in which case the given flagtext will appear
+    where (for example) the 'rw' appears for attr_accessor.
+
+[<tt>--all</tt>]
+    include protected and private methods in the output (by default
+    only public methods are included)
+
+[<tt>--charset</tt> _charset_]
+    Set the character set for the generated HTML.
+
+[<tt>--diagram</tt>]
+    include diagrams showing modules and classes.  This is currently
+    an experimental feature, and may not be supported by all output
+    templates. You need dot V1.8.6 or later to use the --diagram
+    option correctly (http://www.research.att.com/sw/tools/graphviz/).
+
+[<tt>--exclude</tt> <i>pattern</i>]
+    exclude files and directories matching this pattern from processing
+
+[<tt>--extension</tt> <i>new=old</i>]
+    treat files ending <i>.new</i> as if they ended
+    <i>.old</i>. Saying '--extension cgi=rb' causes RDoc to treat .cgi
+    files as Ruby source.
+
+[<tt>fileboxes</tt>]
+    Classes are put in boxes which represents files, where these
+    classes reside. Classes shared between more than one file are
+    shown with list of files that sharing them.  Silently discarded if
+    --diagram is not given Experimental.
+
+[<tt>--fmt</tt> _fmt_]
+    generate output in a particular format.
+
+[<tt>--help</tt>]
+    generate a usage summary.
+
+[<tt>--help-output</tt>]
+    explain the various output options.
+
+[<tt>--ignore-case</tt>]
+    The case of names of classes or modules or methods are ignored.
+
+[<tt>--image-format</tt> <i>gif/png/jpg/jpeg</i>]
+    sets output image format for diagrams. Can be png, gif, jpeg,
+    jpg. If this option is omitted, png is used. Requires --diagram.
+
+[<tt>--include</tt> <i>dir,...</i>]
+    specify one or more directories to be searched when satisfying
+    :+include+: directives. Multiple <tt>--include</tt> options may be
+    given. The directory containing the file currently being processed
+    is always searched.
+
+[<tt>--inline-source</tt>]
+    By default, the source code of methods is shown in a popup. With
+    this option, it's displayed inline.
+
+[<tt>line-numbers</tt>]
+    include line numbers in the source code
+
+[<tt>--main</tt> _name_]
+    the class of module _name_ will appear on the index page. If you
+    want to set a particular file as a main page (a README, for
+    example) simply specifiy its name as the first on the command
+    line.
+
+[<tt>--merge</tt>]
+    when generating _ri_ output, if classes being processed already
+    exist in the destination directory, merge in the current details
+    rather than overwrite them.
+
+[<tt>--one-file</tt>]
+    place all the output into a single file
+
+[<tt>--op</tt> _dir_]
+    set the output directory to _dir_ (the default is the directory
+    "doc")
+
+[<tt>--op-name</tt> _name_]
+    set the name of the output. Has no effect for HTML.
+    "doc")
+
+[<tt>--opname</tt> _name_]
+    set the output name (has no effect for HTML).
+
+[<tt>--promiscuous</tt>]
+    If a module or class is defined in more than one source file, and
+    you click on a particular file's name in the top navigation pane,
+    RDoc will normally only show you the inner classes and modules of
+    that class that are defined in the particular file. Using this
+    option makes it show all classes and modules defined in the class,
+    regardless of the file they were defined in.
+
+[<tt>--quiet</tt>]
+    do not display progress messages
+
+[<tt>--ri</tt>, <tt>--ri-site</tt>, _and_ <tt>--ri-system</tt>]
+    generate output than can be read by the _ri_ command-line tool.
+    By default --ri places its output in ~/.rdoc, --ri-site in
+    $datadir/ri/<ver>/site, and --ri-system in
+    $datadir/ri/<ver>/system. All can be overridden with a subsequent
+    --op option. All default directories are in ri's default search
+    path.
+
+[<tt>--show-hash</tt>]
+    A name of the form #name in a comment is a possible hyperlink to
+    an instance method name. When displayed, the '#' is removed unless
+    this option is specified
+
+[<tt>--style</tt> <i>stylesheet url</i>]
+    specifies the URL of an external stylesheet to use (rather than
+    generating one of our own)
+
+[<tt>tab-width</tt> _n_]
+    set the width of tab characters (default 8)
+
+[<tt>--template</tt> <i>name</i>]
+    specify an alternate template to use when generating output (the
+    default is 'standard'). This template should be in a directory
+    accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
+    depends on the output formatter.
+
+[<tt>--version</tt>]
+   display  RDoc's version
+
+[<tt>--webcvs</tt> _url_]
+    Specify a URL for linking to a web frontend to CVS. If the URL
+    contains a '\%s', the name of the current file will be
+    substituted; if the URL doesn't contain a '\%s', the filename will
+    be appended to it.
+
+= Example
+
+A typical small Ruby program commented using RDoc might be as follows. You
+can see the formatted result in EXAMPLE.rb and Anagram.
+
+      :include: EXAMPLE.rb
+
+= Markup
+
+Comment blocks can be written fairly naturally, either using '#' on
+successive lines of the comment, or by including the comment in 
+an =begin/=end block. If you use the latter form, the =begin line
+must be flagged with an RDoc tag:
+
+  =begin rdoc
+  Documentation to 
+  be processed by RDoc.
+  =end
+
+Paragraphs are lines that share the left margin. Text indented past
+this margin are formatted verbatim.
+
+1. Lists are typed as indented paragraphs with:
+   * a '*' or '-' (for bullet lists)
+   * a digit followed by a period for 
+     numbered lists
+   * an upper or lower case letter followed
+     by a period for alpha lists.
+
+   For example, the input that produced the above paragraph looked like
+       1. Lists are typed as indented 
+          paragraphs with:
+          * a '*' or '-' (for bullet lists)
+          * a digit followed by a period for 
+            numbered lists
+          * an upper or lower case letter followed
+            by a period for alpha lists.
+
+2. Labeled lists (sometimes called description
+   lists) are typed using square brackets for the label.
+      [cat]   small domestic animal
+      [+cat+] command to copy standard input
+
+3. Labeled lists may also be produced by putting a double colon
+   after the label. This sets the result in tabular form, so the
+   descriptions all line up. This was used to create the 'author'
+   block at the bottom of this description.
+      cat::   small domestic animal
+      +cat+:: command to copy standard input
+
+   For both kinds of labeled lists, if the body text starts on the same
+   line as the label, then the start of that text determines the block
+   indent for the rest of the body. The text may also start on the line
+   following the label, indented from the start of the label. This is
+   often preferable if the label is long. Both the following are
+   valid labeled list entries:
+
+      <tt>--output</tt> <i>name [, name]</i>::
+          specify the name of one or more output files. If multiple
+          files are present, the first is used as the index.
+
+      <tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
+                          index areas, or bit ratios of units as
+                          they are processed.
+
+4. Headings are entered using equals signs
+
+      = Level One Heading
+      == Level Two Heading
+   and so on
+
+5. Rules (horizontal lines) are entered using three or
+   more hyphens.
+
+6. Non-verbatim text can be marked up:
+
+   _italic_::     \_word_ or \<em>text</em>
+   *bold*::       \*word* or \<b>text</b>
+   +typewriter+:: \+word+ or \<tt>text</tt>
+
+   The first form only works around 'words', where a word is a
+   sequence of upper and lower case letters and underscores. Putting a
+   backslash before inline markup stops it being interpreted, which is
+   how I created the table above:
+
+     _italic_::     \_word_ or \<em>text</em>
+     *bold*::       \*word* or \<b>text</b>
+     +typewriter+:: \+word+ or \<tt>text</tt>
+
+7. Names of classes, source files, and any method names
+   containing an underscore or preceded by a hash
+   character are automatically hyperlinked from
+   comment text to their description. 
+
+8. Hyperlinks to the web starting http:, mailto:, ftp:, or www. are
+   recognized. An HTTP url that references an external image file is
+   converted into an inline <IMG..>.  Hyperlinks starting 'link:' are
+   assumed to refer to local files whose path is relative to the --op
+   directory.
+
+   Hyperlinks can also be of the form <tt>label</tt>[url], in which
+   case the label is used in the displayed text, and <tt>url</tt> is
+   used as the target. If <tt>label</tt> contains multiple words,
+   put it in braces: <em>{multi word label}[</em>url<em>]</em>.
+       
+9. Method parameter lists are extracted and displayed with
+   the method description. If a method calls +yield+, then
+   the parameters passed to yield will also be displayed:
+
+      def fred
+        ...
+        yield line, address
+
+   This will get documented as
+
+      fred() { |line, address| ... }
+
+   You can override this using a comment containing 
+   ':yields: ...' immediately after the method definition
+
+      def fred      # :yields: index, position
+        ...
+        yield line, address
+
+   which will get documented as
+
+       fred() { |index, position| ... }
+
+
+10. ':yields:' is an example of a documentation modifier. These appear
+    immediately after the start of the document element they are modifying.
+    Other modifiers include
+
+    [<tt>:nodoc:</tt><i>[all]</i>]
+         don't include this element in the documentation.  For classes
+         and modules, the methods, aliases, constants, and attributes
+         directly within the affected class or module will also be
+         omitted.  By default, though, modules and classes within that
+         class of module _will_ be documented. This is turned off by
+         adding the +all+ modifier.
+
+              module SM  #:nodoc:
+                class Input
+                end
+              end
+              module Markup #:nodoc: all
+                class Output
+                end
+              end
+
+         In the above code, only class <tt>SM::Input</tt> will be
+         documented.
+
+    [<tt>:doc:</tt>]
+         force a method or attribute to be documented even if it
+         wouldn't otherwise be. Useful if, for example, you want to
+         include documentation of a particular private method.
+
+    [<tt>:notnew:</tt>]
+         only applicable to the +initialize+ instance method. Normally
+         RDoc assumes that the documentation and parameters for
+         #initialize are actually for the ::new method, and so fakes
+         out a ::new for the class. THe :notnew: modifier stops
+         this. Remember that #initialize is protected, so you won't
+         see the documentation unless you use the -a command line
+         option.
+
+
+11. RDoc stops processing comments if it finds a comment
+    line containing '<tt>#--</tt>'. This can be used to 
+    separate external from internal comments, or 
+    to stop a comment being associated with a method, 
+    class, or module. Commenting can be turned back on with
+    a line that starts '<tt>#++</tt>'.
+
+        # Extract the age and calculate the
+        # date-of-birth.
+        #--
+        # FIXME: fails if the birthday falls on
+        # February 29th
+        #++
+        # The DOB is returned as a Time object.
+
+        def get_dob(person)
+           ...
+
+12. Comment blocks can contain other directives:
+
+    [<tt>:section: title</tt>]
+        Starts a new section in the output. The title following
+	<tt>:section:</tt> is used as the section heading, and the
+	remainder of the comment containing the section is used as
+	introductory text. Subsequent methods, aliases, attributes,
+	and classes will be documented in this section. A :section:
+	comment block may have one or more lines before the :section:
+	directive. These will be removed, and any identical lines at
+	the end of the block are also removed. This allows you to add
+	visual cues such as
+
+           # ----------------------------------------
+	   # :section: My Section
+	   # This is the section that I wrote.
+	   # See it glisten in the noon-day sun.
+           # ----------------------------------------
+
+    [<tt>call-seq:</tt>]
+        lines up to the next blank line in the comment are treated as
+        the method's calling sequence, overriding the
+        default parsing of method parameters and yield arguments.
+
+    [<tt>:include:</tt><i>filename</i>] 
+         include the contents of the named file at this point. The
+         file will be searched for in the directories listed by
+         the <tt>--include</tt> option, or in the current
+         directory by default.  The contents of the file will be
+         shifted to have the same indentation as the ':' at the
+         start of the :include: directive.
+
+    [<tt>:title:</tt><i>text</i>]
+         Sets the title for the document. Equivalent to the --title command
+         line parameter. (The command line parameter overrides any :title:
+         directive in the source).
+
+    [<tt>:enddoc:</tt>]
+         Document nothing further at the current level.
+
+    [<tt>:main:</tt><i>name</i>]
+         Equivalent to the --main command line parameter.
+
+    [<tt>:stopdoc: / :startdoc:</tt>]
+         Stop and start adding new documentation elements to the
+         current container. For example, if a class has a number of
+         constants that you don't want to document, put a
+         <tt>:stopdoc:</tt> before the first, and a
+         <tt>:startdoc:</tt> after the last. If you don't specifiy a
+         <tt>:startdoc:</tt> by the end of the container, disables
+         documentation for the entire class or module.
+
+
+---
+
+See also markup/simple_markup.rb.
+
+= Other stuff
+
+Author::   Dave Thomas <dave@pragmaticprogrammer.com>
+Requires:: Ruby 1.8.1 or later
+License::  Copyright (c) 2001-2003 Dave Thomas.
+           Released under the same license as Ruby.
+
+== Warranty
+
+This software is provided "as is" and without any express or
+implied warranties, including, without limitation, the implied
+warranties of merchantibility and fitness for a particular
+purpose.
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/code_objects.rb ../rdoc-f95-20070112/code_objects.rb
--- ruby-1.8.5-p12/lib/rdoc/code_objects.rb	2004-12-04 14:38:15.000000000 +0900
+++ ../rdoc-f95-20070112/code_objects.rb	2006-11-20 01:42:41.000000000 +0900
@@ -240,6 +240,22 @@
       add_to(@method_list, a_method)
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def add_method(a_method)
+#!#      if !(a_method.visibility == :public)      &&
+#!#           !(a_method.visibility == :private)   &&
+#!#           !(a_method.visibility == :protected)
+#!#        a_method.visibility = @visibility
+#!#      end
+#!#      puts "Adding #{a_method.visibility} method #{a_method.name} to #@name" if $DEBUG
+#!#      add_to(@method_list, a_method)
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     def add_attribute(an_attribute)
       add_to(@attributes, an_attribute)
     end
@@ -259,6 +275,27 @@
       end
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def add_alias(an_alias, ignore_case=nil)
+#!#      meth = find_instance_method_named(an_alias.old_name, ignore_case)
+#!#      if meth
+#!#        new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
+#!#        new_meth.is_alias_for = meth
+#!#        new_meth.singleton    = meth.singleton
+#!#        new_meth.params       = meth.params
+#!#        new_meth.comment = "Alias for \##{meth.name}"
+#!#        meth.add_alias(new_meth)
+#!#        add_method(new_meth)
+#!#      else
+#!#        add_to(@aliases, an_alias)
+#!#      end
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     def add_include(an_include)
       add_to(@includes, an_include)
     end
@@ -337,6 +374,43 @@
       parent && parent.find_module_named(name)
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    # Find a named module
+#!#    def find_module_named(name, ignore_case=nil)
+#!#      res = nil
+#!#      if !ignore_case
+#!#        return self if self.name == name
+#!#      else
+#!#        return self if self.name.upcase == name.upcase
+#!#      end
+#!#      if !ignore_case
+#!#        res = @modules[name] || @classes[name]
+#!#      else
+#!#        @modules.each{ |n, v|
+#!#          if n.upcase == name.upcase
+#!#            res = v ; break
+#!#          end
+#!#        }
+#!#        @classes.each{ |n, v|
+#!#          if n.upcase == name.upcase
+#!#            res = v ; break
+#!#          end
+#!#        } if !res
+#!#      end
+#!#      return res if res
+#!#      find_enclosing_module_named(name, ignore_case)
+#!#    end
+#!#
+#!#    # find a module at a higher scope
+#!#    def find_enclosing_module_named(name, ignore_case=nil)
+#!#      parent && parent.find_module_named(name, ignore_case)
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     # Iterate over all the classes and modules in
     # this object
 
@@ -357,6 +431,16 @@
       @constants.each {|c| yield c}
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def each_includes
+#!#      @includes.each {|i| yield i}
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     # Return the toplevel that owns us
 
     def toplevel
@@ -426,6 +510,97 @@
             find_module_named(symbol) 
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    # Look up the given filename.
+#!#    def find_file(file, method=nil, ignore_case=nil)
+#!#      find_file_named(file, method, ignore_case)
+#!#    end
+#!#
+#!#    # Look up the given symbol. If method is non-nil, then
+#!#    # we assume the symbol references a module that
+#!#    # contains that method
+#!#    def find_symbol(symbol, method=nil, ignore_case=nil)
+#!#      result = nil
+#!#      case symbol
+#!#      when /^::(.*)/
+#!#        result = toplevel.find_symbol($1, nil, ignore_case)
+#!#      when /::/
+#!#        modules = symbol.split(/::/)
+#!#        unless modules.empty?
+#!#          module_name = modules.shift
+#!#          result = find_module_named(module_name, ignore_case)
+#!#          if result
+#!#            modules.each do |module_name|
+#!#              result = result.find_module_named(module_name, ignore_case)
+#!#              break unless result
+#!#            end
+#!#          end
+#!#        end
+#!#      else
+#!#        # if a method is specified, then we're definitely looking for
+#!#        # a module, otherwise it could be any symbol
+#!#        if method
+#!#          result = find_module_named(symbol, ignore_case)
+#!#        else
+#!#          result = find_local_symbol(symbol, ignore_case)
+#!#          if result.nil?
+#!#            if symbol =~ /^[A-Z]/ ||
+#!#                       symbol =~ /^[A-Za-z]/ && ignore_case
+#!#              result = parent
+#!#              while result && result.name != symbol
+#!#                result = result.parent
+#!#              end
+#!#            end
+#!#          end
+#!#        end
+#!#      end
+#!#      if result && method
+#!#        if !result.respond_to?(:find_local_symbol)
+#!#          p result.name
+#!#          p method
+#!#          fail
+#!#        end
+#!#        result = result.find_local_symbol(method, ignore_case)
+#!#      end
+#!#      result
+#!#    end
+#!#
+#!#    def find_local_symbol(symbol, ignore_case=nil)
+#!#      res = find_method_named(symbol, ignore_case) ||
+#!#            find_constant_named(symbol, ignore_case) ||
+#!#            find_attribute_named(symbol, ignore_case) ||
+#!#            find_module_named(symbol, ignore_case) 
+#!#    end
+#!#
+#!#    def include_requires?(name, ignore_case=nil)
+#!#      if self.kind_of? TopLevel
+#!#        self.requires.each{|r|
+#!#          if r.name == name ||
+#!#              r.name.upcase == name.upcase && ignore_case
+#!#            return true
+#!#          end
+#!#        }
+#!#        return false
+#!#      else
+#!#        parent.include_requires?(name)
+#!#      end
+#!#    end
+#!#
+#!#    def include_includes?(name, ignore_case=nil)
+#!#      self.includes.each{|i|
+#!#        if i.name == name ||
+#!#            i.name.upcase == name.upcase && ignore_case
+#!#          return true
+#!#        end
+#!#      }
+#!#      return false
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     # Handle sections
 
     def set_current_section(title, comment)
@@ -455,6 +630,51 @@
       @attributes.find {|m| m.name == name}
     end
     
+
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    # Find a named method, or return nil
+#!#    def find_method_named(name, ignore_case=nil)
+#!#      if !ignore_case
+#!#        @method_list.find {|meth| meth.name == name}
+#!#      else
+#!#        @method_list.find {|meth| meth.name.upcase == name.upcase}
+#!#      end
+#!#    end
+#!#
+#!#    # Find a named instance method, or return nil
+#!#    def find_instance_method_named(name, ignore_case=nil)
+#!#      if !ignore_case
+#!#        @method_list.find {|meth| meth.name == name && !meth.singleton}
+#!#      else
+#!#        @method_list.find {|meth| 
+#!#          meth.name.upcase == name.upcase && !meth.singleton
+#!#        } 
+#!#      end
+#!#    end
+#!#
+#!#    # Find a named constant, or return nil
+#!#    def find_constant_named(name, ignore_case=nil)
+#!#      if !ignore_case
+#!#        @constants.find {|m| m.name == name}
+#!#      else
+#!#        @constants.find {|m| m.name.upcase == name.upcase}
+#!#      end
+#!#    end
+#!#
+#!#    # Find a named attribute, or return nil
+#!#    def find_attribute_named(name, ignore_case=nil)
+#!#      if !ignore_case
+#!#        @attributes.find {|m| m.name == name}
+#!#      else
+#!#        @attributes.find {|m| m.name.upcase == name.upcase}
+#!#      end
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
   end
 
 
@@ -468,10 +688,12 @@
     
     @@all_classes = {}
     @@all_modules = {}
+#!#    @@all_files   = {}
 
     def TopLevel::reset
       @@all_classes = {}
       @@all_modules = {}
+#!#      @@all_files   = {}
     end
 
     def initialize(file_name)
@@ -481,6 +703,7 @@
       @file_absolute_name = file_name
       @file_stat          = File.stat(file_name)
       @diagram            = nil
+#!#      @@all_files[file_name] = self
     end
 
     def full_name
@@ -519,6 +742,16 @@
       @@all_classes.values + @@all_modules.values
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def TopLevel.all_files
+#!#      @@all_files
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     def TopLevel.find_class_named(name)
      @@all_classes.each_value do |c|
         res = c.find_class_named(name) 
@@ -542,6 +775,56 @@
       find_class_or_module_named(name) || find_enclosing_module_named(name)
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def find_local_symbol(symbol, ignore_case=nil)
+#!#      find_class_or_module_named(symbol, ignore_case) || super
+#!#    end
+#!#
+#!#    def find_class_or_module_named(symbol, ignore_case=nil)
+#!#      if !ignore_case
+#!#        @@all_classes.each_value {|c| return c if c.name == symbol}
+#!#        @@all_modules.each_value {|m| return m if m.name == symbol}
+#!#      else
+#!#        @@all_classes.each_value {|c| return c if c.name.upcase == symbol.upcase}
+#!#        @@all_modules.each_value {|m| return m if m.name.upcase == symbol.upcase}
+#!#      end
+#!#      nil
+#!#    end
+#!#
+#!#    # Find a named module
+#!#    def find_module_named(name, ignore_case=nil)
+#!#      find_class_or_module_named(name, ignore_case) || find_enclosing_module_named(name, ignore_case)
+#!#    end
+#!#
+#!#    # Find a named file
+#!#    def find_file_named(name, method=nil, ignore_case=nil)
+#!#      return nil unless name
+#!#      result = nil
+#!#      @@all_files.each{|file_name, toplevel|
+#!#        result = toplevel if file_name == name
+#!#      }
+#!#      dir = File.dirname(@file_relative_name)
+#!#      @@all_files.each{|file_name, toplevel|
+#!#        if /^#{dir}\/(.*)/ =~ file_name
+#!#          result = toplevel if $1 == name
+#!#        end
+#!#      }
+#!#      if result
+#!#        if method
+#!#          result_method = result.find_local_symbol(method, ignore_case)
+#!#          return result_method
+#!#        else
+#!#          return result
+#!#        end
+#!#      else
+#!#        return nil
+#!#      end
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
 
   end
 
@@ -593,6 +876,17 @@
       @classes.each_value {|c| return c if c.find_class_named(name) }
       nil
     end
+
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def find_file_named(name, method=nil, ignore_case=nil)
+#!#      parent.find_file_named(name, method, ignore_case)
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
   end
 
   # Anonymous classes
@@ -651,6 +945,20 @@
       @name <=> other.name
     end
 
+########################################
+# moved to parse_f95.rb #
+#!#
+#!#    def <=>(other)
+#!#      t = @name <=> other.name
+#!#      return t if t != 0
+#!#      t = @params <=> other.params
+#!#      return t if t != 0
+#!#      t = @comment <=> other.comment
+#!#    end
+#!#
+# moved to parse_f95.rb #
+########################################
+
     def to_s
       res = self.class.name + ": " + @name + " (" + @text + ")\n"
       res << @comment.to_s
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/diagram.rb ../rdoc-f95-20070112/diagram.rb
--- ruby-1.8.5-p12/lib/rdoc/diagram.rb	2006-07-10 10:57:20.000000000 +0900
+++ ../rdoc-f95-20070112/diagram.rb	2006-11-20 05:32:53.000000000 +0900
@@ -39,6 +39,10 @@
       @counter = 0
       File.makedirs(DOT_PATH)
       @diagram_cache = {}
+      @html_suffix = ".html"
+      if @options.mathml
+        @html_suffix = ".xhtml"
+      end
     end
 
     # Draw the diagrams. We traverse the files, drawing a diagram for
@@ -126,7 +130,7 @@
       return if  @done_modules[mod.full_name] and not toplevel
 
       @counter += 1
-      url = mod.http_url("classes")
+      url = mod.http_url("classes").sub(/\.html$/, @html_suffix)
       m = DOT::DOTSubgraph.new('name' => "cluster_#{mod.full_name.gsub( /:/,'_' )}",
                                'label' => mod.name,
                                'fontname' => FONT,
@@ -150,7 +154,7 @@
           else
             unless @global_names.include?(m_full_name)
               path = m_full_name.split("::")
-              url = File.join('classes', *path) + ".html"
+              url = File.join('classes', *path) + @html_suffix
               @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
                                         'shape' => 'box',
                                         'label' => "#{m_full_name}",
@@ -196,7 +200,7 @@
 
         next if cl.name == 'Object' || cl.name[0,2] == "<<"
 
-        url = cl.http_url("classes")
+        url = cl.http_url("classes").sub(/\.html$/, @html_suffix)
         
         label = cl.name.dup
         if use_fileboxes && cl.in_files.length > 1
@@ -243,7 +247,7 @@
             else
               unless @global_names.include?(m_full_name)
                 path = m_full_name.split("::")
-                url = File.join('classes', *path) + ".html"
+                url = File.join('classes', *path) + @html_suffix
                 @global_graph << DOT::DOTNode.new('name' => "#{m_full_name.gsub( /:/,'_' )}",
                                           'shape' => 'box',
                                           'label' => "#{m_full_name}",
@@ -260,7 +264,7 @@
           sclass_full_name = find_full_name(sclass,cl)
           unless @local_names.include?(sclass_full_name) or @global_names.include?(sclass_full_name)
             path = sclass_full_name.split("::")
-            url = File.join('classes', *path) + ".html"
+            url = File.join('classes', *path) + @html_suffix
             @global_graph << DOT::DOTNode.new(
                        'name' => "#{sclass_full_name.gsub( /:/, '_' )}",
                        'label' => sclass_full_name,
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/generators/html_generator.rb ../rdoc-f95-20070112/generators/html_generator.rb
--- ruby-1.8.5-p12/lib/rdoc/generators/html_generator.rb	2006-07-10 10:57:21.000000000 +0900
+++ ../rdoc-f95-20070112/generators/html_generator.rb	2007-01-05 23:15:25.000000000 +0900
@@ -134,6 +134,30 @@
       end
     end
 
+    #
+    # CROSSREFFILE is similar to CROSSREF. But this pattern is
+    # hit to filenames or methods in files
+    #
+    def handle_special_CROSSREFFILE(special)
+      name = special.text
+
+      # Find file, or method in file
+      if /([\w\/\.].*\.\w+)[.\#](.*)/ =~ name
+        file_name = $1
+        method = $2
+        ref = @context.find_file(file_name, method)
+      else
+        ref = @context.find_file(name)
+      end
+
+      if ref and ref.document_self
+        "<a href=\"#{ref.as_href(@from_path)}\">#{name}</a>"
+      else
+        name
+      end
+
+    end
+
 
     # Generate a hyperlink for url, labeled with text. Handle the
     # special cases for img: and link: described under handle_special_HYPEDLINK
@@ -159,8 +183,11 @@
           url =~ /\.(gif|png|jpg|jpeg|bmp)$/
 
         "<img src=\"#{url}\" />"
-      else
+
+      elsif type == "link"
         "<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
+      else
+        "<a href=\"#{url}\" target=\"_top\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
       end
     end
 
@@ -213,8 +240,8 @@
 
         # class names, variable names, or instance variables
         @markup.add_special(/(
-                               \w+(::\w+)*[.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?  # A::B.meth(**) (for operator in Fortran95)
-                             | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))?  #  meth(**) (for operator in Fortran95)
+                               \b\w+(::\w+)*[\.\#]\w+(\([\.\w+\*\/\+\-\=\<\>]+\))?  # A::B.meth(**) (for operator and assignment in Fortran 90 or 95)
+                             | \#\w+(\([.\w\*\/\+\-\=\<\>]+\))?  #  meth(**) (for operator and assignment in Fortran 90 or 95)
                              | \b([A-Z]\w*(::\w+)*[.\#]\w+)  #    A::B.meth
                              | \b([A-Z]\w+(::\w+)*)       #    A::B..
                              | \#\w+[!?=]?                #    #meth_name 
@@ -222,6 +249,13 @@
                              )/x, 
                             :CROSSREF)
 
+        # file names
+        @markup.add_special(/(
+                               ((\/|\.\.\/|\.\/|\w)[\w\#\/\.\-\~\:]*[!?=]?) # file_name
+                             | ((\/|\.\.\/|\.\/|\w)[\w\#\/\.\-\~\:]*(\([\.\w+\*\/\+\-\=\<\>]+\))?)
+                             )/x, 
+                            :CROSSREFFILE)
+
         # external hyperlinks
         @markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
 
@@ -404,7 +438,8 @@
 #           end
 #         end
 
-        ref = @context.find_symbol(i.name)
+        ref = @context.find_symbol(i.name, nil, @options.ignore_case)  || \
+              @context.find_file(i.name)
         ref = ref.viewer if ref
 
         if !ref && block_given?
@@ -553,7 +588,16 @@
 
     # Find a symbol in ourselves or our parent
     def find_symbol(symbol, method=nil)
-      res = @context.find_symbol(symbol, method)
+      res = @context.find_symbol(symbol, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+    # Find a filenames in ourselves or our parent
+    def find_file(file, method=nil)
+      res = @context.find_file(file, method, @options.ignore_case)
       if res
         res = res.viewer
       end
@@ -614,7 +658,7 @@
       if path['<<']
         path.gsub!(/<<\s*(\w*)/) { "from-#$1" }
       end
-      File.join(prefix, path.split("::")) + ".html"
+      File.join(prefix, path.split("::")) + '.' + @options.template
     end
 
 
@@ -791,7 +835,7 @@
 
     def http_url(file_dir)
       File.join(file_dir, @context.file_relative_name.tr('.', '_')) +
-        ".html"
+        '.' + @options.template
     end
 
     def filename_to_label
@@ -1004,7 +1048,7 @@
       if p !~ /^\w/
         p = @context.params.gsub(/\s*\#.*/, '')
         p = p.tr("\n", " ").squeeze(" ")
-        p = "(" + p + ")" unless p[0] == ?(
+        p = "(" + p + ")" unless p[0] == ?( || p == ''
         
         if (block = @context.block_params)
          # If this method has explicit block parameters, remove any
@@ -1024,9 +1068,10 @@
     end
     
     def create_source_code_file(code_body)
-      meth_path = @html_class.path.sub(/\.html$/, '.src')
+      template_regexp = Regexp.new("\\." + @options.template + "$")
+      meth_path = @html_class.path.sub(template_regexp, '.src')
       File.makedirs(meth_path)
-      file_path = File.join(meth_path, @seq) + ".html"
+      file_path = File.join(meth_path, @seq) + '.' + @options.template
 
       template = TemplatePage.new(RDoc::Page::SRC_PAGE)
       File.open(file_path, "w") do |f|
@@ -1117,7 +1162,16 @@
     end
 
     def find_symbol(symbol, method=nil)
-      res = @context.parent.find_symbol(symbol, method)
+      res = @context.parent.find_symbol(symbol, method, @options.ignore_case)
+      if res
+        res = res.viewer
+      end
+      res
+    end
+
+    # Find a filenames in ourselves or our parent
+    def find_file(file, method=nil)
+      res = @context.parent.find_file(file, method, @options.ignore_case)
       if res
         res = res.viewer
       end
@@ -1147,6 +1201,7 @@
         to.shift
       end
       
+      from.delete_if{|f| f =~ /^\.$/}
       from.fill("..")
       from.concat(to)
       from << to_file
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/generators/ri_generator.rb ../rdoc-f95-20070112/generators/ri_generator.rb
--- ruby-1.8.5-p12/lib/rdoc/generators/ri_generator.rb	2005-02-12 19:57:20.000000000 +0900
+++ ../rdoc-f95-20070112/generators/ri_generator.rb	2006-11-09 01:58:56.000000000 +0900
@@ -69,7 +69,7 @@
 
     def initialize(options) #:not-new:
       @options   = options
-      @ri_writer = RI::RiWriter.new(options.op_dir)
+      @ri_writer = RI::RiWriter.new(".")
       @markup    = SM::SimpleMarkup.new
       @to_flow   = SM::ToFlow.new
     end
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/generators/template/html/html.rb ../rdoc-f95-20070112/generators/template/html/html.rb
--- ruby-1.8.5-p12/lib/rdoc/generators/template/html/html.rb	2006-01-13 19:26:10.000000000 +0900
+++ ../rdoc-f95-20070112/generators/template/html/html.rb	2006-08-07 22:07:22.000000000 +0900
@@ -214,10 +214,13 @@
     margin: 1em;
     padding: 0.5em;
     border: 1px dashed #999;
-    overflow: hidden;
+    overflow: scroll;
 }
 
-div.method-source-code pre { color: #ffdead; overflow: hidden; }
+div.method-source-code pre {
+    color: #ffdead;
+    overflow: visible;
+}
 
 /* --- Ruby keyword styles --------------------- */
 
diff -Nur --exclude=doc ruby-1.8.5-p12/lib/rdoc/generators/template/xhtml/ctop.xsl ../rdoc-f95-20070112/generators/template/xhtml/ctop.xsl
--- ruby-1.8.5-p12/lib/rdoc/generators/template/xhtml/ctop.xsl	1970-01-01 09:00:00.000000000 +0900
+++ ../rdoc-f95-20070112/generators/template/xhtml/ctop.xsl	2006-08-05 00:37:51.000000000 +0900
@@ -0,0 +1,1318 @@
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:mml="http://www.w3.org/1998/Math/MathML"
+>
+
+<!--
+$Id: ctop.xsl,v 1.1 2006/08/04 15:37:51 morikawa Exp $
+
+Copyright David Carlisle 2001, 2002.
+
+Use and distribution of this code are permitted under the terms of the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720"
+>W3C Software Notice and License</a>.
+-->
+
+<xsl:output method="xml" />
+
+<xsl:template mode="c2p" match="*">
+<xsl:copy>
+  <xsl:copy-of select="@*"/>
+  <xsl:apply-templates mode="c2p"/>
+</xsl:copy>
+</xsl:template>
+
+
+<!-- 4.4.1.1 cn -->
+
+<xsl:template mode="c2p" match="mml:cn">
+ <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='complex-cartesian']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo>+</mml:mo>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+    <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+    <mml:mi>i<!-- imaginary i --></mml:mi>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='rational']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo>/</mml:mo>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='integer']">
+  <xsl:choose>
+  <xsl:when test="not(@base) or @base=10">
+       <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+  </xsl:when>
+  <xsl:otherwise>
+  <mml:msub>
+    <mml:mn><xsl:apply-templates mode="c2p"/></mml:mn>
+    <mml:mn><xsl:value-of select="@base"/></mml:mn>
+  </mml:msub>
+  </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='complex-polar']">
+  <mml:mrow>
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/></mml:mn>
+    <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+    <mml:msup>
+    <mml:mi>e<!-- exponential e--></mml:mi>
+    <mml:mrow>
+     <mml:mi>i<!-- imaginary i--></mml:mi>
+     <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+     <mml:mn><xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+    </mml:mrow>
+    </mml:msup>
+  </mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:cn[@type='e-notation']">
+    <mml:mn><xsl:apply-templates mode="c2p" select="text()[1]"/>E<xsl:apply-templates mode="c2p" select="text()[2]"/></mml:mn>
+</xsl:template>
+
+<!-- 4.4.1.1 ci  -->
+
+<xsl:template mode="c2p" match="mml:ci/text()">
+ <mml:mi><xsl:value-of select="."/></mml:mi>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:ci">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.1.2 csymbol -->
+
+<xsl:template mode="c2p" match="mml:csymbol/text()">
+ <mml:mo><xsl:apply-templates mode="c2p"/></mml:mo>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:csymbol">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.1 apply 4.4.2.2 reln -->
+
+<xsl:template mode="c2p" match="mml:apply|mml:reln">
+ <mml:mrow>
+ <xsl:apply-templates mode="c2p" select="*[1]">
+  <xsl:with-param name="p" select="10"/>
+ </xsl:apply-templates>
+ <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+ <mml:mfenced open="(" close=")" separators=",">
+ <xsl:apply-templates mode="c2p" select="*[position()>1]"/>
+ </mml:mfenced>
+ </mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.3 fn -->
+<xsl:template mode="c2p" match="mml:fn">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.4 interval -->
+<xsl:template mode="c2p" match="mml:interval[*[2]]">
+ <mml:mfenced open="[" close="]"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='open']">
+ <mml:mfenced open="(" close=")"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='open-closed']">
+ <mml:mfenced open="(" close="]"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:interval[*[2]][@closure='closed-open']">
+ <mml:mfenced open="[" close=")"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:interval">
+ <mml:mfenced open="{{" close="}}"><xsl:apply-templates mode="c2p"/></mml:mfenced>
+</xsl:template>
+
+<!-- 4.4.2.5 inverse -->
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:inverse]]">
+ <mml:msup>
+  <xsl:apply-templates mode="c2p" select="*[2]"/>
+  <mml:mrow><mml:mo>(</mml:mo><mml:mn>-1</mml:mn><mml:mo>)</mml:mo></mml:mrow>
+ </mml:msup>
+</xsl:template>
+
+<!-- 4.4.2.6 sep -->
+
+<!-- 4.4.2.7 condition -->
+<xsl:template mode="c2p" match="mml:condition">
+ <mml:mrow><xsl:apply-templates mode="c2p"/></mml:mrow>
+</xsl:template>
+
+<!-- 4.4.2.8 declare -->
+<xsl:template mode="c2p" match="mml:declare"/>
+
+<!-- 4.4.2.9 lambda -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:lambda]]">
+ <mml:mrow>
+  <mml:mi>&#955;<!--lambda--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.2.10 compose -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:compose]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8728;<!-- o --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.2.11` ident -->
+<xsl:template mode="c2p" match="mml:ident">
+<mml:mo>id</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.12` domain -->
+<xsl:template mode="c2p" match="mml:domain">
+<mml:mo>domain</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.13` codomain -->
+<xsl:template mode="c2p" match="mml:codomain">
+<mml:mo>codomain</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.14` image -->
+<xsl:template mode="c2p" match="mml:image">
+<mml:mo>image</mml:mo>
+</xsl:template>
+
+<!-- 4.4.2.15` domainofapplication -->
+<xsl:template mode="c2p" match="mml:domainofapplication">
+ <mml:error/>
+</xsl:template>
+
+<!-- 4.4.2.16` piecewise -->
+<xsl:template mode="c2p" match="mml:piecewise">
+<mml:mrow>
+<mml:mo>{</mml:mo>
+<mml:mtable>
+ <xsl:for-each select="mml:piece|mml:otherwise">
+ <mml:mtr>
+ <mml:mtd><xsl:apply-templates mode="c2p" select="*[1]"/></mml:mtd>
+ <mml:mtd><mml:mtext>&#160; if &#160;</mml:mtext></mml:mtd>
+ <mml:mtd><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mtd>
+ </mml:mtr>
+ </xsl:for-each>
+</mml:mtable>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.1 quotient -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:quotient]]">
+<mml:mrow>
+<mml:mo>&#8970;<!-- lfloor--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>/</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[3]"/>
+<mml:mo>&#8971;<!-- rfloor--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.2 factorial -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:factorial]]">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mo>!</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.3 divide -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:divide]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>/</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.4 max  min-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:max]]">
+<mml:mrow>
+  <mml:mo>max</mml:mo>
+  <xsl:call-template name="set"/>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:min]]">
+<mml:mrow>
+  <mml:mo>max</mml:mo>
+  <xsl:call-template name="set"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.3.5  minus-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:minus] and count(*)=2]">
+<mml:mrow>
+  <mml:mo>&#8722;<!--minus--></mml:mo>
+  <xsl:apply-templates mode="c2p" select="*[2]">
+      <xsl:with-param name="p" select="5"/>
+  </xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:minus] and count(*)&gt;2]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8722;<!--minus--></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="2"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.6  plus-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:plus]]">
+  <xsl:param name="p" select="0"/>
+  <mml:mrow>
+  <xsl:if test="$p &gt; 2"><mml:mo>(</mml:mo></xsl:if>
+  <xsl:for-each select="*[position()&gt;1]">
+   <xsl:if test="position() &gt; 1">
+    <mml:mo>
+    <xsl:choose>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:apply/*[1][self::mml:minus] or self::mml:cn[not(mml:sep) and
+      (number(.) &lt; 0)]]]">&#8722;<!--minus--></xsl:when>
+      <xsl:otherwise>+</xsl:otherwise>
+    </xsl:choose>
+    </mml:mo>
+   </xsl:if>   
+    <xsl:choose>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:cn[not(mml:sep) and (number(.) &lt;0)]]]">
+     <mml:mrow>
+     <mml:mn><xsl:value-of select="-(*[2])"/></mml:mn>
+      <mml:mo><!--&#8290;--><!--invisible times--></mml:mo>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="first" select="2"/>
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+     </mml:mrow>
+      </xsl:when>
+      <xsl:when test="self::mml:apply[*[1][self::mml:times] and
+      *[2][self::mml:apply/*[1][self::mml:minus]]]">
+     <mml:mrow>
+     <xsl:apply-templates mode="c2p" select="./*[2]/*[2]"/>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="first" select="2"/>
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+     </mml:mrow>
+      </xsl:when>
+      <xsl:otherwise>
+     <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="p" select="2"/>
+   </xsl:apply-templates>
+   </xsl:otherwise>
+    </xsl:choose>
+  </xsl:for-each>
+  <xsl:if test="$p &gt; 2"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.7 power -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:power]]">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+<xsl:apply-templates mode="c2p" select="*[3]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.3.8 remainder -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:rem]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>mod</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.9  times-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:times]]" name="times">
+  <xsl:param name="p" select="0"/>
+  <xsl:param name="first" select="1"/>
+  <mml:mrow>
+  <xsl:if test="$p &gt; 3"><mml:mo>(</mml:mo></xsl:if>
+  <xsl:for-each select="*[position()&gt;1]">
+   <xsl:if test="position() &gt; 1">
+    <mml:mo>
+    <xsl:choose>
+      <xsl:when test="self::mml:cn">&#215;<!-- times --></xsl:when>
+      <xsl:otherwise><!--&#8290;--><!--invisible times--></xsl:otherwise>
+    </xsl:choose>
+    </mml:mo>
+   </xsl:if> 
+   <xsl:if test="position()&gt;= $first">
+   <xsl:apply-templates mode="c2p" select=".">
+     <xsl:with-param name="p" select="3"/>
+   </xsl:apply-templates>
+   </xsl:if>
+  </xsl:for-each>
+  <xsl:if test="$p &gt; 3"><mml:mo>)</mml:mo></xsl:if>
+  </mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.10 root -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:root] and not(mml:degree) or mml:degree=2]" priority="4">
+<mml:msqrt>
+<xsl:apply-templates mode="c2p" select="*[position()&gt;1]"/>
+</mml:msqrt>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:root]]">
+<mml:mroot>
+<xsl:apply-templates mode="c2p" select="*[position()&gt;1 and not(self::mml:degree)]"/>
+<mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/*"/></mml:mrow>
+</mml:mroot>
+</xsl:template>
+
+<!-- 4.4.3.11 gcd -->
+<xsl:template mode="c2p" match="mml:gcd">
+<mml:mo>gcd</mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.12 and -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:and]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8743;<!-- and --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.13 or -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:or]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8744;<!-- or --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.3.14 xor -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:xor]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>xor</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.15 not -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:not]]">
+<mml:mrow>
+<mml:mo>&#172;<!-- not --></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+
+
+<!-- 4.4.3.16 implies -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:implies]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8658;<!-- Rightarrow --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.3.17 forall -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:forall]]">
+ <mml:mrow>
+  <mml:mi>&#8704;<!--forall--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.18 exists -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:exists]]">
+ <mml:mrow>
+  <mml:mi>&#8707;<!--exists--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:bvar[not(current()/mml:condition)]/*|mml:condition/*"/></mml:mrow>
+ <mml:mo>.</mml:mo>
+ <mml:mfenced>
+  <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ </mml:mfenced>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.19 abs -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:abs]]">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+
+<!-- 4.4.3.20 conjugate -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:conjugate]]">
+<mml:mover>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#175;<!-- overline --></mml:mo>
+</mml:mover>
+</xsl:template>
+
+<!-- 4.4.3.21 arg -->
+<xsl:template mode="c2p" match="mml:arg">
+ <mml:mo>arg</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.3.22 real -->
+<xsl:template mode="c2p" match="mml:real">
+ <mml:mo>&#8475;<!-- real --></mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.23 imaginary -->
+<xsl:template mode="c2p" match="mml:imaginary">
+ <mml:mo>&#8465;<!-- imaginary --></mml:mo>
+</xsl:template>
+
+<!-- 4.4.3.24 lcm -->
+<xsl:template mode="c2p" match="mml:lcm">
+ <mml:mo>lcm</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.3.25 floor -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:floor]]">
+<mml:mrow>
+<mml:mo>&#8970;<!-- lfloor--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#8971;<!-- rfloor--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.3.25 ceiling -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:ceiling]]">
+<mml:mrow>
+<mml:mo>&#8968;<!-- lceil--></mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>&#8969;<!-- rceil--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.4.1 eq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:eq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>=</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.2 neq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:neq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8800;<!-- neq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.3 eq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:gt]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&gt;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.4 lt -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:lt]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&lt;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.5 geq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:geq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8805;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.6 geq -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:leq]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8804;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.7 equivalent -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:equivalent]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8801;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.4.8 approx -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:approx]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="1"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8771;</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+
+<!-- 4.4.4.9 factorof -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:factorof]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>|</mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.5.1 int -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:int]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mi>&#8747;<!--int--></mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+ <mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.5.2 diff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:diff] and mml:ci and count(*)=2]" priority="2">
+ <mml:msup>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mrow>
+ <mml:mo>&#8242;<!--prime--></mml:mo>
+ </mml:msup>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:diff]]" priority="1">
+ <mml:mfrac>
+ <xsl:choose>
+ <xsl:when test="mml:bvar/mml:degree">
+ <mml:mrow><mml:msup><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar/mml:degree/node()"/></mml:msup>
+     <xsl:apply-templates mode="c2p"  select="*[last()]"/></mml:mrow>
+ <mml:mrow><mml:mo>d</mml:mo><mml:msup><xsl:apply-templates mode="c2p"
+ select="mml:bvar/node()"/><xsl:apply-templates mode="c2p"
+ select="mml:bvar/mml:degree/node()"/></mml:msup>
+</mml:mrow>
+</xsl:when>
+<xsl:otherwise>
+ <mml:mrow><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="*[last()]"/></mml:mrow>
+ <mml:mrow><mml:mo>d</mml:mo><xsl:apply-templates mode="c2p" select="mml:bvar"/></mml:mrow>
+</xsl:otherwise>
+ </xsl:choose>
+ </mml:mfrac>
+</xsl:template>
+
+
+<!-- 4.4.5.3 partialdiff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:partialdiff] and mml:list and mml:ci and count(*)=3]" priority="2">
+<mml:mrow>
+ <mml:msub><mml:mo>D</mml:mo><mml:mrow>
+<xsl:for-each select="mml:list[1]/*">
+<xsl:apply-templates mode="c2p" select="."/>
+<xsl:if test="position()&lt;last()"><mml:mo>,</mml:mo></xsl:if>
+</xsl:for-each>
+</mml:mrow></mml:msub>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="*[3]"/></mml:mrow>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:partialdiff]]" priority="1">
+ <mml:mfrac>
+ <mml:mrow><mml:msup><mml:mo>&#8706;<!-- partial --></mml:mo>
+<mml:mrow>
+ <xsl:choose>
+ <xsl:when test="mml:degree">
+<xsl:apply-templates mode="c2p" select="mml:degree/node()"/>
+</xsl:when>
+<xsl:when test="mml:bvar/mml:degree[string(number(.))='NaN']">
+<xsl:for-each select="mml:bvar/mml:degree">
+<xsl:apply-templates mode="c2p" select="node()"/>
+<xsl:if test="position()&lt;last()"><mml:mo>+</mml:mo></xsl:if>
+</xsl:for-each>
+<xsl:if test="count(mml:bvar[not(mml:degree)])&gt;0">
+<mml:mo>+</mml:mo><mml:mn><xsl:value-of select="count(mml:bvar[not(mml:degree)])"/></mml:mn>
+</xsl:if>
+</xsl:when>
+<xsl:otherwise>
+<mml:mn><xsl:value-of select="sum(mml:bvar/mml:degree)+count(mml:bvar[not(mml:degree)])"/></mml:mn>
+</xsl:otherwise>
+ </xsl:choose>
+</mml:mrow>
+</mml:msup>
+     <xsl:apply-templates mode="c2p"  select="*[last()]"/></mml:mrow>
+<mml:mrow>
+<xsl:for-each select="mml:bvar">
+<mml:mrow>
+<mml:mo>&#8706;<!-- partial --></mml:mo><mml:msup><xsl:apply-templates mode="c2p" select="node()"/>
+                     <mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/node()"/></mml:mrow>
+</mml:msup>
+</mml:mrow>
+</xsl:for-each>
+</mml:mrow>
+ </mml:mfrac>
+</xsl:template>
+
+<!-- 4.4.5.4  lowlimit-->
+<xsl:template mode="c2p" match="mml:lowlimit"/>
+
+<!-- 4.4.5.5 uplimit-->
+<xsl:template mode="c2p" match="mml:uplimit"/>
+
+<!-- 4.4.5.6  bvar-->
+<xsl:template mode="c2p" match="mml:bvar">
+ <mml:mi><xsl:apply-templates mode="c2p"/></mml:mi>
+ <xsl:if test="following-sibling::mml:bvar"><mml:mo>,</mml:mo></xsl:if>
+</xsl:template>
+
+<!-- 4.4.5.7 degree-->
+<xsl:template mode="c2p" match="mml:degree"/>
+
+<!-- 4.4.5.8 divergence-->
+<xsl:template mode="c2p" match="mml:divergence">
+<mml:mo>div</mml:mo>
+</xsl:template>
+
+<!-- 4.4.5.9 grad-->
+<xsl:template mode="c2p" match="mml:grad">
+<mml:mo>grad</mml:mo>
+</xsl:template>
+
+<!-- 4.4.5.10 curl -->
+<xsl:template mode="c2p" match="mml:curl">
+<mml:mo>curl</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.5.11 laplacian-->
+<xsl:template mode="c2p" match="mml:laplacian">
+<mml:msup><mml:mo>&#8711;<!-- nabla --></mml:mo><mml:mn>2</mml:mn></mml:msup>
+</xsl:template>
+
+<!-- 4.4.6.1 set -->
+
+<xsl:template mode="c2p" match="mml:set">
+  <xsl:call-template name="set"/>
+</xsl:template>
+
+<!-- 4.4.6.2 list -->
+
+<xsl:template mode="c2p" match="mml:list">
+  <xsl:call-template name="set">
+   <xsl:with-param name="o" select="'('"/>
+   <xsl:with-param name="c" select="')'"/>
+  </xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.3 union -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:union]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8746;<!-- union --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.4 intersect -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:intersect]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="3"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8745;<!-- intersect --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.5 in -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:in]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8712;<!-- in --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.5 notin -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notin]]">
+  <xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+  <xsl:with-param name="mo"><mml:mo>&#8713;<!-- not in --></mml:mo></xsl:with-param>
+  <xsl:with-param name="p" select="$p"/>
+  <xsl:with-param name="this-p" select="3"/>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.7 subset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:subset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8838;<!-- subseteq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.8 prsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:prsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8834;<!-- prsubset --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.9 notsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8840;<!-- notsubseteq --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.10 notprsubset -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:notprsubset]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8836;<!-- prsubset --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.11 setdiff -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:setdiff]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#8726;<!-- setminus --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.6.12 card -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:card]]">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.6.13 cartesianproduct -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:cartesianproduct or self::mml:vectorproduct]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>&#215;<!-- times --></mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<xsl:template
+match="mml:apply[*[1][self::mml:cartesianproduct][count(following-sibling::mml:reals)=count(following-sibling::*)]]"
+priority="2">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="5"/>
+</xsl:apply-templates>
+<mml:mn><xsl:value-of select="count(*)-1"/></mml:mn>
+</mml:msup>
+</xsl:template>
+
+
+<!-- 4.4.7.1 sum -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:sum]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mo>&#8721;<!--sum--></mml:mo>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.7.2 product -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:product]]">
+ <mml:mrow>
+ <mml:msubsup>
+  <mml:mo>&#8719;<!--product--></mml:mo>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit/*|mml:interval/*[1]|mml:condition/*"/></mml:mrow>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:uplimit/*|mml:interval/*[2]"/></mml:mrow>
+ </mml:msubsup>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.7.3 limit -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:limit]]">
+ <mml:mrow>
+ <mml:munder>
+  <mml:mi>limit</mml:mi>
+ <mml:mrow><xsl:apply-templates mode="c2p" select="mml:lowlimit|mml:condition/*"/></mml:mrow>
+ </mml:munder>
+ <xsl:apply-templates mode="c2p" select="*[last()]"/>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template mode="c2p" match="mml:apply[mml:limit]/mml:lowlimit" priority="3">
+<mml:mrow>
+<xsl:apply-templates mode="c2p" select="../mml:bvar/node()"/>
+<mml:mo>&#8594;<!--rightarrow--></mml:mo>
+<xsl:apply-templates mode="c2p"/>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.7.4 tendsto -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:tendsto]]">
+ <xsl:param name="p"/>
+<xsl:call-template name="binary">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>
+  <xsl:choose>
+   <xsl:when test="@type='above'">&#8600;<!--searrow--></xsl:when>
+   <xsl:when test="@type='below'">&#8599;<!--nearrow--></xsl:when>
+   <xsl:when test="@type='two-sided'">&#8594;<!--rightarrow--></xsl:when>
+   <xsl:otherwise>&#8594;<!--rightarrow--></xsl:otherwise>
+  </xsl:choose>
+  </mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.8.1 trig -->
+<xsl:template mode="c2p" match="mml:apply[*[1][
+ self::mml:sin or self::mml:cos or self::mml:tan or self::mml:sec or
+ self::mml:csc or self::mml:cot or self::mml:sinh or self::mml:cosh or
+ self::mml:tanh or self::mml:sech or self::mml:csch or self::mml:coth or
+ self::mml:arcsin or self::mml:arccos or self::mml:arctan or self::mml:arccosh
+ or self::mml:arccot or self::mml:arccoth or self::mml:arccsc or
+ self::mml:arccsch or self::mml:arcsec or self::mml:arcsech or
+ self::mml:arcsinh or self::mml:arctanh or self::mml:ln]]">
+<mml:mrow>
+<mml:mi><xsl:value-of select="local-name(*[1])"/></mml:mi>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+
+
+<!-- 4.4.8.2 exp -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:exp]]">
+<mml:msup>
+<mml:mi>e<!-- exponential e--></mml:mi>
+<mml:mrow><xsl:apply-templates mode="c2p" select="*[2]"/></mml:mrow>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.8.3 ln -->
+<!-- with trig -->
+
+<!-- 4.4.8.4 log -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:log]]">
+<mml:mrow>
+<xsl:choose>
+<xsl:when test="not(mml:logbase) or mml:logbase=10">
+<mml:mi>log</mml:mi>
+</xsl:when>
+<xsl:otherwise>
+<mml:msub>
+<mml:mi>log</mml:mi>
+<mml:mrow><xsl:apply-templates mode="c2p" select="mml:logbase/node()"/></mml:mrow>
+</mml:msub>
+</xsl:otherwise>
+</xsl:choose>
+<xsl:apply-templates mode="c2p" select="*[last()]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.9.1 mean -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:mean]]">
+<mml:mrow>
+ <mml:mo>&#9001;<!--langle--></mml:mo>
+    <xsl:for-each select="*[position()&gt;1]">
+      <xsl:apply-templates mode="c2p" select="."/>
+      <xsl:if test="position() !=last()"><mml:mo>,</mml:mo></xsl:if>
+    </xsl:for-each>
+<mml:mo>&#9002;<!--rangle--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+
+<!-- 4.4.9.2 sdef -->
+<xsl:template mode="c2p" match="mml:sdev">
+<mml:mo>&#963;<!--sigma--></mml:mo>
+</xsl:template>
+
+<!-- 4.4.9.3 variance -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:variance]]">
+<mml:msup>
+<mml:mrow>
+<mml:mo>&#963;<!--sigma--></mml:mo>
+<mml:mo>(</mml:mo>
+<xsl:apply-templates mode="c2p" select="*[2]"/>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+<mml:mn>2</mml:mn>
+</mml:msup>
+</xsl:template>
+
+
+<!-- 4.4.9.4 median -->
+<xsl:template mode="c2p" match="mml:median">
+<mml:mo>median</mml:mo>
+</xsl:template>
+
+
+<!-- 4.4.9.5 mode -->
+<xsl:template mode="c2p" match="mml:mode">
+<mml:mo>mode</mml:mo>
+</xsl:template>
+
+<!-- 4.4.9.5 moment -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:moment]]">
+<mml:mrow>
+ <mml:mo>&#9001;<!--langle--></mml:mo>
+       <mml:msup>
+      <xsl:apply-templates mode="c2p" select="*[last()]"/>
+      <mml:mrow><xsl:apply-templates mode="c2p" select="mml:degree/node()"/></mml:mrow>
+       </mml:msup>
+<mml:mo>&#9002;<!--rangle--></mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.9.5 momentabout -->
+<xsl:template mode="c2p" match="mml:momentabout"/>
+
+<!-- 4.4.10.1 vector  -->
+<xsl:template mode="c2p" match="mml:vector">
+<mml:mrow>
+<mml:mo>(</mml:mo>
+<mml:mtable>
+<xsl:for-each select="*">
+<mml:mtr><mml:mtd><xsl:apply-templates mode="c2p" select="."/></mml:mtd></mml:mtr>
+</xsl:for-each>
+</mml:mtable>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.2 matrix  -->
+<xsl:template mode="c2p" match="mml:matrix">
+<mml:mrow>
+<mml:mo>(</mml:mo>
+<mml:mtable>
+<xsl:apply-templates mode="c2p"/>
+</mml:mtable>
+<mml:mo>)</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.3 matrixrow  -->
+<xsl:template mode="c2p" match="mml:matrixrow">
+<mml:mtr>
+<xsl:for-each select="*">
+<mml:mtd><xsl:apply-templates mode="c2p" select="."/></mml:mtd>
+</xsl:for-each>
+</mml:mtr>
+</xsl:template>
+
+<!-- 4.4.10.4 determinant  -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:determinant]]">
+<mml:mrow>
+<mml:mi>det</mml:mi>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+</mml:mrow>
+</xsl:template>
+
+<xsl:template
+match="mml:apply[*[1][self::mml:determinant]][*[2][self::mml:matrix]]" priority="2">
+<mml:mrow>
+<mml:mo>|</mml:mo>
+<mml:mtable>
+<xsl:apply-templates mode="c2p" select="mml:matrix/*"/>
+</mml:mtable>
+<mml:mo>|</mml:mo>
+</mml:mrow>
+</xsl:template>
+
+<!-- 4.4.10.5 transpose -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:transpose]]">
+<mml:msup>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mi>T</mml:mi>
+</mml:msup>
+</xsl:template>
+
+<!-- 4.4.10.5 selector -->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:selector]]">
+<mml:msub>
+<xsl:apply-templates mode="c2p" select="*[2]">
+  <xsl:with-param name="p" select="7"/>
+</xsl:apply-templates>
+<mml:mrow>
+    <xsl:for-each select="*[position()&gt;2]">
+      <xsl:apply-templates mode="c2p" select="."/>
+      <xsl:if test="position() !=last()"><mml:mo>,</mml:mo></xsl:if>
+    </xsl:for-each>
+</mml:mrow>
+</mml:msub>
+</xsl:template>
+
+<!-- *** -->
+<!-- 4.4.10.6 vectorproduct see cartesianproduct -->
+
+
+<!-- 4.4.10.7 scalarproduct-->
+<xsl:template mode="c2p" match="mml:apply[*[1][self::mml:scalarproduct or self::mml:outerproduct]]">
+<xsl:param name="p" select="0"/>
+<xsl:call-template name="infix">
+ <xsl:with-param name="this-p" select="2"/>
+ <xsl:with-param name="p" select="$p"/>
+ <xsl:with-param name="mo"><mml:mo>.</mml:mo></xsl:with-param>
+</xsl:call-template>
+</xsl:template>
+
+<!-- 4.4.10.8 outerproduct-->
+
+<!-- 4.4.11.2 semantics -->
+<xsl:template mode="c2p" match="mml:semantics">
+ <xsl:apply-templates mode="c2p" select="*[1]"/>
+</xsl:template>
+<xsl:template mode="c2p" match="mml:semantics[mml:annotation-xml/@encoding='MathML-Presentation']">
+ <xsl:apply-templates mode="c2p" select="mml:annotation-xml[@encoding='MathML-Presentation']/node()"/>
+</xsl:template>
+
+<!-- 4.4.12.1 integers -->
+<xsl:template mode="c2p" match="mml:integers">
+<mml:mi mathvariant="double-struck">Z</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.2 reals -->
+<xsl:template mode="c2p" match="mml:reals">
+<mml:mi mathvariant="double-struck">R</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.3 rationals -->
+<xsl:template mode="c2p" match="mml:rationals">
+<mml:mi mathvariant="double-struck">Q</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.4 naturalnumbers -->
+<xsl:template mode="c2p" match="mml:naturalnumbers">
+<mml:mi mathvariant="double-struck">N</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.5 complexes -->
+<xsl:template mode="c2p" match="mml:complexes">
+<mml:mi mathvariant="double-struck">C</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.6 primes -->
+<xsl:template mode="c2p" match="mml:primes">
+<mml:mi mathvariant="double-struck">P</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.7 exponentiale -->
+<xsl:template mode="c2p" match="mml:exponentiale">
+  <mml:mi>e<!-- exponential e--></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.8 imaginaryi -->
+<xsl:template mode="c2p" match="mml:imaginaryi">
+  <mml:mi>i<!-- imaginary i--></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.9 notanumber -->
+<xsl:template mode="c2p" match="mml:notanumber">
+  <mml:mi>NaN</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.10 true -->
+<xsl:template mode="c2p" match="mml:true">
+  <mml:mi>true</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.11 false -->
+<xsl:template mode="c2p" match="mml:false">
+  <mml:mi>false</mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.12 emptyset -->
+<xsl:template mode="c2p" match="mml:emptyset">
+  <mml:mi>&#8709;<!-- emptyset --></mml:mi>
+</xsl:template>
+
+
+<!-- 4.4.12.13 pi -->
+<xsl:template mode="c2p" match="mml:pi">
+  <mml:mi>&#960;<!-- pi --></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.14 eulergamma -->
+<xsl:template mode="c2p" match="mml:eulergamma">
+  <mml:mi>&#947;<!-- gamma --></mml:mi>
+</xsl:template>
+
+<!-- 4.4.12.15 infinity -->
+<xsl:template mode="c2p" match="mml:infin