########################################################################## # SED script for converting SubML (Substitutionary Markup Language) # into HTML # # Version 0.98 # # Copyright (C) 2001-2003 Tony R. Kuphaldt # Last updated 03/23/2003 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA # # Modified (DC) Jan 2006 - added minitoc - minitable of contents # after the chapter title. Adds tag to html output. # This is subsittuted on the end of sml. # The htmltoc2 perl script looks for in the html # and put a mini-table of contents there. # htmltoc2 perl script is a modification of htmltoc perlscript # ########################################################################## ########################################################################## # # Modified 10/27/2005 (DC) - Added # Modified 10/28/2005 (DC) - Added tag # See Devel/tutorial.sml for documentation of these # Modified 01/01/ 2006 (DC) - Added , tags. # See Devel/tutorial.sml for usage # Modified 02/06/2006 (DC) - Added more Mathmatical tags from angle on. # Added , tags. See Devel/tutorial.sml # Modified 02/24/2006 (DC) - Added boolean overbar # Modified 03/05/2006 (DC) - Expanded capability of tags # Modified 03/09/2006 (DC) - Added left and right double quotes # Modified 03/09/2006 (DC) - Added tags # ########################################################################## # Prevents ampersands (&) from being interpreted as HTML entity markers. # # IT IS SAFER TO PLACE THIS ESCAPE CHARACTER SUBSTITUTION LINE BEFORE # ANY SUBSTITUTIONS WHICH PLACE REAL ESCAPE CHARACTERS INTO THE OUTPUT # FILE. # s/&/\&/g ########################################################################## ########################################################################## #change `` and '' to html codes. These are left and right double quotes # s/``/\“/g s/''/\”/g ########################################################################## ########################################################################## # tags: for marking sections of text NOT to be processed # s///g ########################################################################## ########################################################################## # tags: maker for text to insert into .tex, .latex files # Both tags must have their own line, nothing else # deleted from .txt, .html, .groff /.*<\/tex>/d //,/<\/tex>/d ########################################################################## ########################################################################## # tags: maker for text to insert into .html file only # Both tags must have their own line, nothing else # deleted from .txt, .tex, .latex, .groff s/// s/<\/htmlo>// ########################################################################## ########################################################################## # tags: mark the beginning and end of a standalone document. # s// \ \ /g # s/<\/book>/<\/body> \ <\/html>/g ########################################################################## ########################################################################## # and tags: mark the beginning and end of a # chapter, and mark the title of a chapter, respectively. # s//
/g s/<\/chapter>//g s//

/g s/<\/chaptertitle>/<\/h1> \ /g ########################################################################## ########################################################################## #
and tags: mark the beginning and end of a # section, and mark the title of a section, respectively. # s/
/
/g s/<\/section>//g s//

/g s/<\/sectiontitle>/<\/u><\/h2>/g ########################################################################## ########################################################################## # and tags: mark the beginning and end of a # subsection, and mark the title of a subsection, respectively. # s///g s/<\/subsection>//g s//

/g s/<\/subsectiontitle>/<\/u><\/h3>/g ########################################################################## ########################################################################## # and tags: mark the beginning and # end of a subsubsection, and mark the title of a subsubsection, # respectively. # s///g s/<\/subsubsection>//g s//

/g s/<\/subsubsectiontitle>/<\/h4>/g ########################################################################## ########################################################################## # extended tags # specify "text" string to click on #http:www.whatever.com[text] #\href{http://www.whatever.com}{\tt{text}} s+\(\)\(.*\)\(\[\)\(.*\)\(\]\)\(\)+\4+g ########################################################################## ########################################################################## # tags: mark a phrase as an Internet URL (Uniform Resource Locator). # s//[*]<\/a>/g ########################################################################## # ########################################################################## # tags- jump to local link, to hypertarget #linkname[text] #text s+\(\)\(.*\)\(\[\)\(.*\)\(\]\)\(\)+\4+g ########################################################################## ########################################################################## # tags-- sets a target for #linkname[text] #text s+\(\)\(.*\)\(\[\)\(.*\)\(\]\)\(\)+ \ \4+g ########################################################################## ########################################################################## # tags: mark the beginning and end of the LaTex # bibliography section. tags mark the bibliography entries. # tags mark the citation link to the bibliography. # s++
\

Bibliography


\
    +g s/<\/thebibliography>/<\/ol>/g s+\(\)\(\[\)\(.*\)\(\]\)\(.*$\)+
  1. \[\3\]\5+g s+++g # tags- jump to local link, to hypertarget #linkname[text] #linkname #text s+\(\)\(.*\)\(\)+\[\2]+g ########################################################################## ########################################################################## # tags: group a section of lines together to form a paragraph. # s//

    /g s/<\/para>/<\/p>/g ########################################################################## ########################################################################## #03/04/2006 (DC) #Delete latex scale factor from html. s+\(\)\(\[scale.*\]\)\(.*\.[pj][np][g]\)\(.*\)\(\)\(.*$\)+ \ \1\3\4\5\6\7\8+g ########################################################################## ########################################################################## # 02/04/2006 Added Caption to sml2latx.sed, this is how we handle html. # Seperate the caption out from the image tag, put it on a line after # the image tag. Put html anchor before image tags. This must preceed the # next section. This- image substitutions special case of image with label tags s+\(\)\(.*\.[pj][np][g]\)\(\)\(.*\)\(\)\(\)\(.*$\)+ \ \ \1\2\9 \ \3\4\5 \ +g # normal case of captioned image, must preceed other image, caption subs s+\(\)\(.*\.[pj][np][g]\)\(.*\)\(.*\)+ \ \ \1\2\4 \ \3 \ +g s//

    <\/p>/g s//

    /g s/<\/caption>/<\/i><\/p>/g ########################################################################## ########################################################################## # tags: mark a filename to be included as a graphic image in # the final document. HTML-compatible filenames are not modified, but # if converting to TeX or LaTeX output, any three-character filename # extension is replaced with ".eps" # s//

    <\/p>/g ########################################################################## #figuretest.png above #jump
    s+\(\)\(.*\.[pj][np][g]\)\(.*\)\(\)+ \3+g ########################################################################## # tags: mark a block of text to be indented as a quotation. # s//

    /g s/<\/quotation>/<\/blockquote>/g ########################################################################## ########################################################################## # tags: frame a character string marked for inclusion into a # concept index. Any text surrounded by an tag set becomes a # "name" link in HTML. # # *** PENDING *** # s//<\/a>/g ########################################################################## ########################################################################## # tags: group a section of items to be included into a bulleted # list. # s//
      /g s/<\/itemize>/<\/ul>/g ########################################################################## ########################################################################## # tags: marks a line of text to become an item in an itemized list. # s//
    • /g s/<\/item>/<\/li>/g ########################################################################## ########################################################################## # These tags mark a character, word, or phrase to be emphasized in a # particular fashion. # s///g s/<\/italic>/<\/i>/g # # s///g s/<\/bold>/<\/b>/g # # s///g s/<\/underline>/<\/u>/g # # s///g s/<\/subscript>/<\/sub>/g # # s///g s/<\/superscript>/<\/sup>/g # # s///g s/<\/subscript2>/<\/sub>/g # # s///g s/<\/superscript2>/<\/sup>/g # # s///g s/<\/math>//g # # #added 02/24/2006 (DC) s///g s/<\/ob>/'\ /g # # # s//\ /g s///g s/<\/typewriter>/<\/tt>/g ########################################################################## ########################################################################## # tags: mark a block of text to be presented verbatim, in # a fixed-width font. # s//
      /g
      s/<\/literal>/<\/pre>/g
      ##########################################################################
      
      
      
      
      ##########################################################################
      #  tag: produces a rendition of the TeX logo.
      #  tag: produces a rendition of the LaTeX logo.
      #
      s//TE<\/sub>X/g
      s//LA<\/sup>TE<\/sub>X/g
      ##########################################################################
      
      
      ##########################################################################
      #  tag: places a large vertical space in the document.
      #
      s//
      <\/br>/g ########################################################################## ########################################################################## # tag: Starts a new page # s//
      <\/br>/g ########################################################################## ########################################################################## # tag: Creates the copyright symbol. # s//\©/g ########################################################################## ########################################################################## # Mathematical tags # s//\∠/g # s//\∫/g # s//\∂/g # s//\∞/g # s//\∇/g # s//\⊕/g # s//\≈/g # s//\≅/g # s//\≠/g # s//\±/g # s//\·/g # s//\≤/g # s//\≥/g # s//\×/g # s//\®/g # ########################################################################## ########################################################################## # Special dashes # s//-/g # s//--/g ########################################################################## ########################################################################## # Greek letter tags # s//\α/g # s//\β/g # s//\γ/g s//\Γ/g # s//\δ/g s//\Δ/g # s//\ε/g s//\ɛ/g # s//\ζ/g # s//\η/g # s//\θ/g s//\Θ/g s//\ϑ/g # s//\ι/g # s//\κ/g # s//\λ/g s//\Λ/g # s//\µ/g # s//\ν/g # s//\ξ/g s//\Ξ/g # s//\π/g s//\Π/g # s//\ρ/g s//\ϱ/g # s//\σ/g s//\Σ/g s//\ς/g # s//\τ/g # s//\υ/g s//\ϒ/g # s//\φ/g s//\Φ/g s//\ϕ/g # s//\χ/g # s//\ψ/g s//\Ψ/g # s//\ω/g s//\Ω/g ########################################################################## ########################################################################## # Other foreign character tags # s//\à/g s//\À/g # s//\á/g s//\Á/g # s//\â/g s//\Â/g # s//\ä/g s//\Ä/g # s//\ã/g s//\Ã/g # s//\å/g s//\Å/g # # s//\ç/g s//\Ç/g # # s//\è/g s//\È/g # s//\é/g s//\É/g # s//\ê/g s//\Ê/g # s//\ë/g s//\Ë/g # # s//\ì/g s//\Ì/g # s//\í/g s//\Í/g # s//\î/g s//\Î/g # s//\ï/g s//\Ï/g # # s//\ñ/g s//\Ñ/g # # s//\ò/g s//\Ò/g # s//\ó/g s//\Ó/g # s//\ô/g s//\Ô/g # s//\ö/g s//\Ö/g # s//\õ/g s//\Õ/g # # s//\ù/g s//\Ù/g # s//\ú/g s//\Ú/g # s//\û/g s//\Û/g # s//\ü/g s//\Ü/g # s//\¿/g # s//\¡/g # ########################################################################## ########################################################################## # and tags: creates < and > symbols, respectively. # # THIS SUBSTITUTION SHOULD FOLLOW ALL OTHER SUBSTITUTIONS, JUST TO BE # PERFECTLY SAFE. # s//\</g s//\>/g ##########################################################################