########################################################################## # SED script for converting SubML (Substitutionary Markup Language) # into plain ASCII text. # # Version 0.94 # # Copyright (C) 2001 Tony R. Kuphaldt # Last updated 01/01/2006 # # 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 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 ########################################################################## # ########################################################################## # Deletes all blank lines. This reduces the size of the translated # file and speeds up conversion, but also serves to eliminate the bad # effects of extra blank lines in the source file appearing in the plain # text output. # /^$/d ########################################################################## ########################################################################## # tags: for marking sections of text NOT to be processed. # s/.*<\/comment>//g ########################################################################## ########################################################################## # 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 /.*<\/htmlo>/d //,/<\/htmlo>/d ########################################################################## ########################################################################## # 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: mark the beginning and end of a standalone document. # //d /<\/book>/d ########################################################################## ########################################################################## # 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>//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>//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>//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>//g ########################################################################## ########################################################################## # tags: group a section of lines together to form a paragraph. # # A linefeed is inserted in place of either the or tag # so that they may be placed in the same line with the paragraph they # mark and still result in a blank line between paragraphs in the .txt # output file. # s// \ /g s/<\/para>/ \ /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//SEE IMAGE FILE /g s/<\/image>//g ########################################################################## ########################################################################## # 02/05/2006 Added reference tags for latex. s// /g s/<\/ref>/ /g ########################################################################## ########################################################################## # 02/04/2006 (DC) Added caption for figures in latex. For examples of #usage see Devel/tutorial. # s// \ Caption: /g s/<\/caption>/ /g ########################################################################## ########################################################################## # tags: mark a block of text to be indented as a quotation. # s//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/g s/<\/quotation>/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/g ########################################################################## ########################################################################## # tags: frame a character string marked for inclusion into a # concept index. # # *** PENDING *** # //d /<\/index>/d ########################################################################## ########################################################################## # tags: group a section of items to be included into a bulleted # list. # //d /<\/itemize>/d ########################################################################## ########################################################################## # tags: marks a line of text to become an item in an itemized list. # s// * /g s/<\/item>//g ########################################################################## ########################################################################## # These tags mark a character, word, or phrase to be emphasized in a # particular fashion. # s//*/g s/<\/italic>/*/g # # s//**/g s/<\/bold>/**/g # # s//_/g s/<\/underline>/_/g # # s//_(/g s/<\/subscript>/)/g # # s//^(/g s/<\/superscript>/)/g # # s//_(/g s/<\/subscript2>/)/g # # s//^(/g s/<\/superscript2>/)/g # # Only needed in Latex s///g s/<\/math>//g # #add single space s// /g # s///g s/<\/typewriter>//g ########################################################################## ########################################################################## # tags: mark a block of text to be presented verbatim, in # a fixed-width font. # //d /<\/literal>/d ########################################################################## ########################################################################## # tags: mark a phrase as an Internet URL (Uniform Resource Locator). # s//(/g s/<\/url>/)/g ########################################################################## ########################################################################## # tag: produces a rendition of the TeX logo. # tag: produces a rendition of the LaTeX logo. # s//TeX/g s//LaTeX/g ########################################################################## ########################################################################## # tag: places a large vertical space in the document. # s//\ /g ########################################################################## ########################################################################## # tag: Starts a new page. # # *** PENDING *** # s//¶ /g ########################################################################## ########################################################################## # tag: Creates the copyright symbol. # s//(C)/g ########################################################################## ########################################################################## # Mathematical tags # s//\/_/g # s//(integral)/g # s//(partial)/g # s//(infinity)/g # s//(del)/g # s//(exor)/g # s//(almost=)/g # s//(approx=)/g # s//(neq)/g # s//+-/g # s//x/g # s//<=/g # s//>=/g # s//x/g # s//(R)/g # ########################################################################## ########################################################################## # Special dashes # s//-/g # s//--/g ########################################################################## ########################################################################## # Greek letter tags # s//a/g # s//B/g # s//y/g s//(GAMMA)/g # s//(delta)/g s//(DELTA)/g # s//(epsilon)/g s//(varepsilon)/g # s//(zeta)/g # s//n/g # s//(theta)/g s//(THETA)/g s//(vartheta)/g # s//i/g # s//K/g # s//(lambda)/g s//(LAMBDA)/g # s//u/g # s//v/g # s//(xi)/g s//(XI)/g # s//(pi)/g s//(PI)/g # s//p/g s//(varrho)/g # s//(sigma)/g s//(SIGMA)/g s//s/g # s//t/g # s//(upsilon)/g s//(UPSILON)/g # s//(phi)/g s//(PHI)/g s//(varphi)/g # s//X/g # s//(psi)/g s//(PSI)/g # s//w/g s//(OMEGA)/g ########################################################################## ########################################################################## # and tags: creates < and > symbols, respectively. # # THIS SUBSTITUTION SHOULD FOLLOW ALL OTHER SUBSTITUTIONS, JUST TO BE # PERFECTLY SAFE. # s///>/g ##########################################################################