/* Output from p2c 1.21alpha2-dt-Jul.95, the Pascal-to-C translator */ /* From input file "rtflatex.pas" */ #include "p2crtf.h" #include "p2c_mods.h" #include "p2clib_m.c" /* version 2.15 */ #define lmx 511 #define olmx 1023 #define maxlevel 72 #define maxkeyln 64 #define bfslen 24 #define numsizes 16 #define maxfonts 128 #define maxstyles 12 #define max_skip_strings 8 #define maxRTFstyles 64 #define RTFstyle_length 128 typedef Char string24[bfslen + 1]; typedef Char string2[3]; typedef Char string5[6]; typedef Char string128[129]; typedef Char string255[256]; typedef Char exline_type[olmx]; typedef Char string_RTFstyle[RTFstyle_length + 1]; Static FILE *inputfile, *outputfile, *figurefile, *logfile, *skipfile; Static short catcode[256], digit[256], majusc[256], letter[256]; Static string24 acc_transl[256], ftech_transl[256]; Static Char prev_line[lmx], inpline[lmx]; Static exline_type exline; Static short tex_verbose, verbose, icharz, numl, kout, kinp, prev_kinp, bracelvl; Static short lvlcode[maxlevel + 1], tab_nb_cellx[maxlevel + 1], tab_nb_ands[maxlevel + 1], tab_cellx[maxlevel + 1]; Static Char kar, hexaone, hexatwo; Static string255 next_rtf; Static boolean removed_ok, write_log, do_it_again, no_space_conv, use_sl, latex209, latex_header, base_flag, envir_closed_ok, last_percent, simplify_ok, no_RTFrtf, par_to_begin; Static short num_styles, input_line_number, numfonts, num_word_fonts, stdsize, stdkz; Static string24 close_kar[maxlevel + 1], form_code[maxlevel + 1], bfslcode[maxlevel + 1], sizecode[maxlevel + 1], currsize[maxlevel + 1], currbfsl[maxlevel + 1], spacingcode[maxlevel + 1], active_RTFf[maxlevel + 1]; Static short center_flag[maxlevel + 1], flushright_flag[maxlevel + 1], math_mode[maxlevel + 1]; Static boolean underl_flag[maxlevel + 1], auto_close[maxlevel + 1]; Static string24 sizekey[numsizes]; Static short sizeval[3][numsizes]; Static short sizemags[3][numsizes]; Static string24 newfonts[maxfonts], word_fonts[maxfonts], equiv_fonts[maxfonts], font_names[maxfonts]; Static short word_font_num[maxfonts]; Static string255 inkeyw; Static short num_diff_sizes, keyw, cat, ikar, numval, numsign, num_hexa, num_skip_strings, decl_font_num, num_latex_options, num_indent, i, j, k, l, m, n; Static string24 works, worksa, worksb, latex_style, end_math_code; Static string24 latex_options[maxstyles + 1]; Static string24 environ_type[11]; Static string255 skip_strings[max_skip_strings]; Static short leftskip, rightskip, leftcurskip, rightcurskip, save_skip, space_after, displ_skip; Static string_RTFstyle RTFstyles[maxRTFstyles]; Static short ref_styles[256]; Static boolean clbrdrr, clbrdrl, clbrdrt, clbrdrb; /* indications to build file names of figure bitmaps */ Static string128 figure_name, figure_path, figure_type; Static string24 pict_name; Static long rtfpicw, rtfpich, pict_char_number, pict_byte_number; Static short pict_last_hexa, pict_number; Static boolean pict_left_hexa; Static Char last_kar; Static Char inputfile_NAME[_FNSIZE]; Static Char outputfile_NAME[_FNSIZE]; Static Char figurefile_NAME[_FNSIZE]; Static Char logfile_NAME[_FNSIZE]; Static Char skipfile_NAME[_FNSIZE]; /*---------------------------------------------------------------------------*/ /* resets all integers to 0, all strings to '', for safety */ Static Void clean_all() { short z; for (z = 1; z <= lmx; z++) prev_line[k-1] = ' '; for (z = 1; z <= lmx; z++) inpline[k-1] = ' '; for (z = 1; z <= olmx; z++) exline[k-1] = ' '; tex_verbose = 0; verbose = 0; icharz = 0; numl = 0; kout = 0; kinp = 0; prev_kinp = 0; bracelvl = 0; for (z = 0; z <= maxlevel; z++) { lvlcode[z] = 0; tab_nb_cellx[z] = 0; tab_nb_ands[z] = 0; tab_cellx[z] = 0; } kar = ' '; hexaone = ' '; hexatwo = ' '; *next_rtf = '\0'; removed_ok = false; write_log = false; do_it_again = false; no_space_conv = false; use_sl = false; latex209 = false; latex_header = false; base_flag = false; envir_closed_ok = false; last_percent = false; simplify_ok = false; no_RTFrtf = false; par_to_begin = false; num_styles = 0; input_line_number = 0; numfonts = 0; num_word_fonts = 0; stdsize = 0; stdkz = 0; for (z = 0; z <= maxlevel; z++) { *close_kar[z] = '\0'; *form_code[z] = '\0'; *bfslcode[z] = '\0'; *sizecode[z] = '\0'; *currsize[z] = '\0'; *currbfsl[z] = '\0'; *spacingcode[z] = '\0'; *active_RTFf[z] = '\0'; center_flag[z] = 0; flushright_flag[z] = 0; math_mode[z] = 0; underl_flag[z] = false; auto_close[z] = false; } /* sizekey : array[1..numsizes] of string24; */ /* sizeval : array[1..3,1..numsizes] of integer; */ /* sizemags : array[1..3,1..numsizes] of integer; */ for (z = 0; z <= maxfonts - 1; z++) { *newfonts[z] = '\0'; *word_fonts[z] = '\0'; *equiv_fonts[z] = '\0'; *font_names[z] = '\0'; word_font_num[z] = 0; } *inkeyw = '\0'; num_diff_sizes = 0; keyw = 0; cat = 0; ikar = 0; numval = 0; numsign = 0; num_hexa = 0; num_skip_strings = 0; decl_font_num = 0; num_latex_options = 0; num_indent = 0; i = 0; j = 0; k = 0; l = 0; m = 0; n = 0; *works = '\0'; *worksa = '\0'; *worksb = '\0'; *latex_style = '\0'; *end_math_code = '\0'; for (z = 0; z <= maxstyles; z++) *latex_options[z] = '\0'; for (z = 0; z <= 10; z++) *environ_type[z] = '\0'; for (z = 0; z <= max_skip_strings - 1; z++) *skip_strings[z] = '\0'; leftskip = 0; rightskip = 0; leftcurskip = 0; rightcurskip = 0; save_skip = 0; space_after = 0; displ_skip = 0; for (z = 0; z <= maxRTFstyles - 1; z++) *RTFstyles[z] = '\0'; for (z = 0; z <= 255; z++) ref_styles[z] = 0; clbrdrr = false; clbrdrl = false; clbrdrt = false; clbrdrb = false; /* indications to build file names of figure bitmaps */ *figure_name = '\0'; *figure_path = '\0'; *figure_type = '\0'; *pict_name = '\0'; rtfpicw = 0; rtfpich = 0; pict_char_number = 0; pict_byte_number = 0; pict_last_hexa = 0; pict_number = 0; pict_left_hexa = false; last_kar = ' '; } /*---------------------------------------------------------------------------*/ Static Void title() { printf(" MICROSOFT RTF(Word[Perfect]) to LaTeX conversion\n"); printf(" Daniel Taupin, CNRS, 20th September 1996\n"); printf(" Universite de Paris-Sud, Orsay, France\n"); printf(" Version 2.15\n"); printf(" E-mail: taupin@lps.u-psud.fr\n"); } /*---------------------------------------------------------------------------*/ /* converts a hexa character into a number from 0 to 15 */ Static short hx_to_i(kar) Char kar; { short ikar = kar; short okar; if (ikar < '0') { okar = 0; return okar; } if (ikar <= '9') { okar = ikar - '0'; return okar; } if (ikar <= 'Z') { okar = ikar + 10 - 'A'; return okar; } if (ikar <= 'z') okar = ikar + 10 - 'a'; else okar = 0; /*END IF ikar */ return okar; } /*---------------------------------------------------------------------------*/ /* converts a string of two hexa character into a number from 0 to 255 */ Static short hs_to_i(input_stg) Char *input_stg; { return (hx_to_i(input_stg[0]) * 16 + hx_to_i(input_stg[1])); } /*---------------------------------------------------------------------------*/ /* truncate at bfslen a string */ Static Char *truncate24(Result, a) Char *Result; Char *a; { sprintf(Result, "%.*s", bfslen, a); return Result; /* p2c: rtflatex.h, line 173: * Note: Possible faulty string assignment [145] */ /* p2c: rtflatex.h, line 173: * Note: string[24] := string[255] => unpredictable crashes */ } /* version 2.15 */ /*---------------------------------------------------------------------------*/ /* finds the '.' initiating the postfix of the given file name */ Static short pos_postfix(xx) Char *xx; { short Result = 0; short i, FORLIM; FORLIM = strlen(xx); for (i = 1; i <= FORLIM; i++) { /*END DO*/ if (xx[i-1] == '.') Result = i; else if (xx[i-1] == ']') Result = 0; else if (xx[i-1] == '/') Result = 0; else if (xx[i-1] == '\\') Result = 0; else if (xx[i-1] == ':') Result = 0; } /*END IF*/ return Result; } /*---------------------------------------------------------------------------*/ /* the signed variant of str(n,stg) */ Static Void sign_str(num, out_sign_str) short num; Char *out_sign_str; { string255 sign_work; Char STR2[256]; sprintf(sign_work, "%d", num); /* if (num<0) then out_sign_str:='-'+sign_work */ if (num < 0) { sprintf(STR2, "-%s", sign_work); truncate24(out_sign_str, STR2); } else { truncate24(out_sign_str, sign_work); /*END IF*/ } } /*---------------------------------------------------------------------------*/ /* prints/displays a message */ Static Void print_msg(verbose_level, msg) short verbose_level; Char *msg; { if (verbose >= verbose_level) fputs(msg, stdout); if (write_log) fputs(msg, logfile); } /*---------------------------------------------------------------------------*/ /* prints/displays a message with RETURN */ Static Void println_msg(verbose_level, msg) short verbose_level; Char *msg; { if (verbose >= verbose_level) puts(msg); if (write_log) fprintf(logfile, "%s\n", msg); } /* ======================================================================= */ /* used at initialization to store one size name (Latex) and its magnitudes */ Static Void sizeone(i, s, j, k, l, mag10, mag11, mag12) short i; Char *s; short j, k, l, mag10, mag11, mag12; { truncate24(sizekey[i-1], s); sizeval[0][i-1] = j; sizemags[0][i-1] = mag10; sizeval[1][i-1] = k; sizemags[1][i-1] = mag11; sizeval[2][i-1] = l; sizemags[2][i-1] = mag12; } /* ======================================================================= */ /* initialization of LaTeX font heights <==> size keywords */ Static Void sizeinit() { short k; sizeone(1, "HUGE", 720, 720, 840, 2986, 2986, 3583); sizeone(2, "Huge", 600, 600, 720, 2488, 2488, 2986); sizeone(3, "huge", 500, 500, 600, 2074, 2074, 2488); sizeone(4, "LARGE", 440, 440, 500, 1728, 1728, 2074); sizeone(5, "Large", 360, 360, 440, 1440, 1440, 1728); sizeone(6, "large", 280, 280, 360, 1200, 1200, 1440); sizeone(7, "normalsize", 240, 272, 290, 1000, 1095, 1200); sizeone(8, "small", 220, 240, 272, 900, 1000, 1095); sizeone(9, "footnotesize", 190, 220, 240, 800, 900, 1000); sizeone(10, "scriptsize", 160, 190, 190, 700, 800, 800); sizeone(11, "tiny", 120, 140, 140, 500, 600, 600); for (k = 12; k <= 16; k++) sizeone(k, "tiny", 0, 0, 0, 500, 600, 600); num_diff_sizes = 11; for (k = 0; k <= 10; k++) strcpy(environ_type[k], "\\RTFerror"); strcpy(environ_type[0], "document"); strcpy(environ_type[1], "center"); strcpy(environ_type[2], "flushright"); } /* ======================================================================= */ Static Void mac_init() { short k; /* install the conversions of RTF accents (coded \'xx in hexa) */ /* build a list of conversion of accented letters */ for (k = 0; k <= 255; k++) *acc_transl[k] = '\0'; strcpy(acc_transl[hs_to_i("80")], "\"A"); strcpy(acc_transl[hs_to_i("81")], "\\AA{}"); strcpy(acc_transl[hs_to_i("82")], "\\c{C}"); strcpy(acc_transl[hs_to_i("83")], "\\'E"); strcpy(acc_transl[hs_to_i("84")], "\\~N"); strcpy(acc_transl[hs_to_i("85")], "\\\"O"); strcpy(acc_transl[hs_to_i("86")], "\\\"U"); strcpy(acc_transl[hs_to_i("87")], "\\'a"); strcpy(acc_transl[hs_to_i("88")], "\\`a"); strcpy(acc_transl[hs_to_i("89")], "\\^a"); strcpy(acc_transl[hs_to_i("8a")], "\\\"a"); strcpy(acc_transl[hs_to_i("8b")], "\\~a"); strcpy(acc_transl[hs_to_i("8c")], "\\aa{}"); strcpy(acc_transl[hs_to_i("8d")], "\\c{c}"); strcpy(acc_transl[hs_to_i("8e")], "\\'e"); strcpy(acc_transl[hs_to_i("8f")], "\\`e"); strcpy(acc_transl[hs_to_i("90")], "\\^e"); strcpy(acc_transl[hs_to_i("91")], "\\\"e"); strcpy(acc_transl[hs_to_i("93")], "\\'{\\i}"); strcpy(acc_transl[hs_to_i("93")], "\\`{\\i}"); strcpy(acc_transl[hs_to_i("94")], "\\^{\\i}"); strcpy(acc_transl[hs_to_i("95")], "\\\"{\\i}"); strcpy(acc_transl[hs_to_i("96")], "\\~n"); strcpy(acc_transl[hs_to_i("97")], "\\'o"); strcpy(acc_transl[hs_to_i("98")], "\\`o"); strcpy(acc_transl[hs_to_i("99")], "\\^o"); strcpy(acc_transl[hs_to_i("9a")], "\\\"o"); strcpy(acc_transl[hs_to_i("9b")], "\\~o"); strcpy(acc_transl[hs_to_i("9c")], "\\'u"); strcpy(acc_transl[hs_to_i("9d")], "\\`u"); strcpy(acc_transl[hs_to_i("9e")], "\\^u"); strcpy(acc_transl[hs_to_i("9f")], "\\\"u"); strcpy(acc_transl[hs_to_i("a0")], "\\dag{}"); strcpy(acc_transl[hs_to_i("a1")], "\\degree{}"); strcpy(acc_transl[hs_to_i("a3")], "\\pound{}"); strcpy(acc_transl[hs_to_i("a4")], "\\S{}"); strcpy(acc_transl[hs_to_i("a7")], "\\ss{}"); strcpy(acc_transl[hs_to_i("ae")], "\\AE{}"); strcpy(acc_transl[hs_to_i("af")], "\\O{}"); strcpy(acc_transl[hs_to_i("b0")], "$\\infty "); strcpy(acc_transl[hs_to_i("b1")], "$\\pm "); strcpy(acc_transl[hs_to_i("b2")], "$\\leq "); strcpy(acc_transl[hs_to_i("b3")], "$\\geq "); strcpy(acc_transl[hs_to_i("b5")], "$\\mu "); strcpy(acc_transl[hs_to_i("b6")], "$\\partial "); strcpy(acc_transl[hs_to_i("b7")], "$\\Sigma "); strcpy(acc_transl[hs_to_i("b8")], "$\\Pi "); strcpy(acc_transl[hs_to_i("b9")], "$\\pi "); strcpy(acc_transl[hs_to_i("bd")], "${1\\over2}"); strcpy(acc_transl[hs_to_i("bf")], "\\o{}"); strcpy(acc_transl[hs_to_i("c6")], "$\\Delta "); strcpy(acc_transl[hs_to_i("c9")], "..."); strcpy(acc_transl[hs_to_i("cb")], "\\`A"); strcpy(acc_transl[hs_to_i("cc")], "\\~A"); strcpy(acc_transl[hs_to_i("cd")], "\\~O"); strcpy(acc_transl[hs_to_i("ce")], "\\OE{}"); strcpy(acc_transl[hs_to_i("cf")], "\\oe{}"); strcpy(acc_transl[hs_to_i("d0")], "--{}"); strcpy(acc_transl[hs_to_i("d1")], "---{}"); strcpy(acc_transl[hs_to_i("d2")], "``"); strcpy(acc_transl[hs_to_i("d3")], "''"); strcpy(acc_transl[hs_to_i("d4")], "`{}"); strcpy(acc_transl[hs_to_i("d5")], "'{}"); strcpy(acc_transl[hs_to_i("d6")], "$\\div "); strcpy(acc_transl[hs_to_i("d8")], "\\\"y"); strcpy(acc_transl[hs_to_i("e1")], "$\\cdot "); strcpy(acc_transl[hs_to_i("e4")], "\\\"a"); strcpy(acc_transl[hs_to_i("e5")], "\\^A"); strcpy(acc_transl[hs_to_i("e6")], "\\^E"); strcpy(acc_transl[hs_to_i("e7")], "\\'A"); strcpy(acc_transl[hs_to_i("e8")], "\\\"E"); strcpy(acc_transl[hs_to_i("e9")], "\\`E"); strcpy(acc_transl[hs_to_i("ea")], "\\'I"); strcpy(acc_transl[hs_to_i("eb")], "\\^I"); strcpy(acc_transl[hs_to_i("ec")], "\\\"I"); strcpy(acc_transl[hs_to_i("ed")], "\\`I"); strcpy(acc_transl[hs_to_i("ee")], "\\'O"); strcpy(acc_transl[hs_to_i("ef")], "\\^O"); strcpy(acc_transl[hs_to_i("f1")], "\\`O"); strcpy(acc_transl[hs_to_i("f2")], "\\'U"); strcpy(acc_transl[hs_to_i("f3")], "\\^U"); strcpy(acc_transl[hs_to_i("f4")], "\\`U"); strcpy(acc_transl[hs_to_i("f6")], "\\\"o"); strcpy(acc_transl[hs_to_i("fb")], "\\degree{}"); strcpy(acc_transl[hs_to_i("fc")], "\\\"u"); } /* ======================================================================= */ Static Void ansi_init() { short k; /* install the conversions of RTF accents (coded \'xx in hexa) */ /* build a list of conversion of accented letters */ for (k = 0; k <= 255; k++) *acc_transl[k] = '\0'; strcpy(acc_transl[hs_to_i("a1")], "!`"); strcpy(acc_transl[hs_to_i("a3")], "\\pound{}"); strcpy(acc_transl[hs_to_i("a7")], "\\S{}"); strcpy(acc_transl[hs_to_i("a8")], "\\\"{ }"); strcpy(acc_transl[hs_to_i("a9")], "\\copyright{}"); strcpy(acc_transl[hs_to_i("ab")], "<<"); strcpy(acc_transl[hs_to_i("b0")], "\\degree{}"); strcpy(acc_transl[hs_to_i("b1")], "$\\pm "); strcpy(acc_transl[hs_to_i("b4")], "\\'{ }"); strcpy(acc_transl[hs_to_i("b5")], "$\\mu "); strcpy(acc_transl[hs_to_i("b7")], "$\\cdot "); strcpy(acc_transl[hs_to_i("b8")], "\\c{ }"); strcpy(acc_transl[hs_to_i("bb")], ">>"); strcpy(acc_transl[hs_to_i("bc")], "${1\\over4}"); strcpy(acc_transl[hs_to_i("bd")], "${1\\over2}"); strcpy(acc_transl[hs_to_i("be")], "${3\\over4}"); strcpy(acc_transl[hs_to_i("bf")], "?`"); strcpy(acc_transl[hs_to_i("c0")], "\\`A"); strcpy(acc_transl[hs_to_i("c1")], "\\'A"); strcpy(acc_transl[hs_to_i("c2")], "\\^A"); strcpy(acc_transl[hs_to_i("c3")], "\\~A"); strcpy(acc_transl[hs_to_i("c4")], "\\\"A"); strcpy(acc_transl[hs_to_i("c5")], "\\AA{}"); strcpy(acc_transl[hs_to_i("c6")], "\\AE{}"); strcpy(acc_transl[hs_to_i("c7")], "\\c{C}"); strcpy(acc_transl[hs_to_i("c8")], "\\`E"); strcpy(acc_transl[hs_to_i("c9")], "\\'E"); strcpy(acc_transl[hs_to_i("ca")], "\\^E"); strcpy(acc_transl[hs_to_i("cb")], "\\\"E"); strcpy(acc_transl[hs_to_i("cc")], "\\`I"); strcpy(acc_transl[hs_to_i("cd")], "\\'I"); strcpy(acc_transl[hs_to_i("ce")], "\\^I"); strcpy(acc_transl[hs_to_i("cf")], "\\\"I"); strcpy(acc_transl[hs_to_i("d1")], "\\~N"); strcpy(acc_transl[hs_to_i("d2")], "\\`O"); strcpy(acc_transl[hs_to_i("d3")], "\\'O"); strcpy(acc_transl[hs_to_i("d4")], "\\^O"); strcpy(acc_transl[hs_to_i("d5")], "\\~O"); strcpy(acc_transl[hs_to_i("d6")], "\\\"O"); strcpy(acc_transl[hs_to_i("d8")], "\\O"); strcpy(acc_transl[hs_to_i("d9")], "\\`U"); strcpy(acc_transl[hs_to_i("da")], "\\'U"); strcpy(acc_transl[hs_to_i("db")], "\\^U"); strcpy(acc_transl[hs_to_i("dc")], "\\\"U"); strcpy(acc_transl[hs_to_i("dd")], "\\'Y"); strcpy(acc_transl[hs_to_i("df")], "\\ss{}"); strcpy(acc_transl[hs_to_i("e0")], "\\`a"); strcpy(acc_transl[hs_to_i("e1")], "\\'a"); strcpy(acc_transl[hs_to_i("e2")], "\\^a"); strcpy(acc_transl[hs_to_i("e3")], "\\~a"); strcpy(acc_transl[hs_to_i("e4")], "\\\"a"); strcpy(acc_transl[hs_to_i("e5")], "\\aa{}"); strcpy(acc_transl[hs_to_i("e6")], "\\ae{}"); strcpy(acc_transl[hs_to_i("e7")], "\\c{c}"); strcpy(acc_transl[hs_to_i("e8")], "\\`e"); strcpy(acc_transl[hs_to_i("e9")], "\\'e"); strcpy(acc_transl[hs_to_i("ea")], "\\^e"); strcpy(acc_transl[hs_to_i("eb")], "\\\"e"); strcpy(acc_transl[hs_to_i("ec")], "\\`i"); strcpy(acc_transl[hs_to_i("ed")], "\\'i"); strcpy(acc_transl[hs_to_i("ee")], "\\^i"); strcpy(acc_transl[hs_to_i("ef")], "\\\"i"); strcpy(acc_transl[hs_to_i("f1")], "\\~n"); strcpy(acc_transl[hs_to_i("f2")], "\\`o"); strcpy(acc_transl[hs_to_i("f3")], "\\'o"); strcpy(acc_transl[hs_to_i("f4")], "\\^o"); strcpy(acc_transl[hs_to_i("f5")], "\\~o"); strcpy(acc_transl[hs_to_i("f6")], "\\\"o"); strcpy(acc_transl[hs_to_i("f8")], "\\o"); strcpy(acc_transl[hs_to_i("f9")], "\\`u"); strcpy(acc_transl[hs_to_i("fa")], "\\'u"); strcpy(acc_transl[hs_to_i("fb")], "\\^u"); strcpy(acc_transl[hs_to_i("fc")], "\\\"u"); strcpy(acc_transl[hs_to_i("fd")], "\\'y"); strcpy(acc_transl[hs_to_i("ff")], "\\\"y"); } /* ======================================================================= */ Static Void charinit() { short K; for (K = 0; K <= 255; K++) catcode[K] = 12; for (K = 'A'; K <= 'Z'; K++) catcode[K] = 11; for (K = 'a'; K <= 'z'; K++) catcode[K] = 11; for (K = '0'; K <= '9'; K++) catcode[K] = 16; K = ' '; catcode[K] = 10; K = '{'; catcode[K] = 1; K = '}'; catcode[K] = 2; K = '('; catcode[K] = 3; K = ')'; catcode[K] = 4; K = '\\'; catcode[K] = 0; icharz = '0'; /* build an empty list of conversion of accented letters */ for (K = 0; K <= 255; K++) *acc_transl[K] = '\0'; /* Now install the conversions of "ftech" characters into math codes ... or letters*/ for (K = 0; K <= 255; K++) *ftech_transl[K] = '\0'; strcpy(ftech_transl['a'], "\\alpha "); strcpy(ftech_transl['A'], "\\Alpha "); strcpy(ftech_transl['b'], "\\beta "); strcpy(ftech_transl['B'], "\\Beta "); strcpy(ftech_transl['c'], "\\chi "); strcpy(ftech_transl['C'], "\\Chi "); strcpy(ftech_transl['d'], "\\delta "); strcpy(ftech_transl['D'], "\\Delta "); strcpy(ftech_transl['e'], "\\varepsilon "); strcpy(ftech_transl['E'], "\\Epsilon "); strcpy(ftech_transl['f'], "\\phi "); strcpy(ftech_transl['F'], "\\Phi "); strcpy(ftech_transl['g'], "\\gamma "); strcpy(ftech_transl['G'], "\\Gamma "); strcpy(ftech_transl['h'], "\\eta "); strcpy(ftech_transl['H'], "\\Eta "); strcpy(ftech_transl['i'], "\\iota "); strcpy(ftech_transl['I'], "\\Iota "); strcpy(ftech_transl['j'], "\\varphi "); strcpy(ftech_transl['J'], "\\vartheta "); strcpy(ftech_transl['k'], "\\kappa "); strcpy(ftech_transl['K'], "\\Kappa "); strcpy(ftech_transl['l'], "\\lambda "); strcpy(ftech_transl['L'], "\\Lambda "); strcpy(ftech_transl['m'], "\\mu "); strcpy(ftech_transl['M'], "\\Mu "); strcpy(ftech_transl['n'], "\\nu "); strcpy(ftech_transl['N'], "\\Nu"); strcpy(ftech_transl['o'], "o"); strcpy(ftech_transl['O'], "\\Omicron "); strcpy(ftech_transl['p'], "\\pi "); strcpy(ftech_transl['P'], "\\Pi "); strcpy(ftech_transl['q'], "\\theta "); strcpy(ftech_transl['Q'], "\\Theta "); strcpy(ftech_transl['r'], "\\rho "); strcpy(ftech_transl['R'], "\\Rho "); strcpy(ftech_transl['s'], "\\sigma "); strcpy(ftech_transl['S'], "\\Sigma "); strcpy(ftech_transl['t'], "\\tau "); strcpy(ftech_transl['T'], "\\Tau "); strcpy(ftech_transl['u'], "\\upsilon "); strcpy(ftech_transl['U'], "\\varUpsilon "); strcpy(ftech_transl['v'], "\\varpi "); strcpy(ftech_transl['V'], "\\varsigma "); strcpy(ftech_transl['w'], "\\omega "); strcpy(ftech_transl['W'], "\\Omega "); strcpy(ftech_transl['x'], "\\xi "); strcpy(ftech_transl['X'], "\\Xi "); strcpy(ftech_transl['y'], "\\psi "); strcpy(ftech_transl['Y'], "\\Psi "); strcpy(ftech_transl['z'], "\\zeta "); strcpy(ftech_transl['Z'], "\\Zeta "); strcpy(ftech_transl['@'], "\\cong "); strcpy(ftech_transl['~'], "\\sim "); strcpy(ftech_transl['"'], "\\forall "); strcpy(ftech_transl['$'], "\\exists "); strcpy(ftech_transl[hs_to_i("27")], "\\ni "); strcpy(ftech_transl[hs_to_i("5e")], "\\bot "); strcpy(ftech_transl[hs_to_i("a0")], "\\dag "); strcpy(ftech_transl[hs_to_i("a1")], "\\Upsilon "); strcpy(ftech_transl[hs_to_i("a2")], "'"); strcpy(ftech_transl[hs_to_i("a3")], "\\leq "); strcpy(ftech_transl[hs_to_i("a4")], "/"); strcpy(ftech_transl[hs_to_i("a5")], "\\infty "); strcpy(ftech_transl[hs_to_i("a6")], "\\cap "); strcpy(ftech_transl[hs_to_i("a7")], "\\clubsuit "); strcpy(ftech_transl[hs_to_i("a9")], "\\heartsuit "); strcpy(ftech_transl[hs_to_i("aa")], "\\spadesuit "); strcpy(ftech_transl[hs_to_i("ab")], "\\leftrightarrow "); strcpy(ftech_transl[hs_to_i("ac")], "\\leftarrow "); strcpy(ftech_transl[hs_to_i("ad")], "\\uparrow "); strcpy(ftech_transl[hs_to_i("ae")], "\\rightarrow "); strcpy(ftech_transl[hs_to_i("af")], "\\downarrow "); strcpy(ftech_transl[hs_to_i("b0")], "^{\\circ}"); strcpy(ftech_transl[hs_to_i("b1")], "\\pm "); strcpy(ftech_transl[hs_to_i("b2")], "''"); strcpy(ftech_transl[hs_to_i("b3")], "\\geq "); strcpy(ftech_transl[hs_to_i("b4")], "\\times "); strcpy(ftech_transl[hs_to_i("b5")], "\\propto "); strcpy(ftech_transl[hs_to_i("b6")], "\\partial "); strcpy(ftech_transl[hs_to_i("b7")], "\\bullet "); strcpy(ftech_transl[hs_to_i("b8")], "\\div "); strcpy(ftech_transl[hs_to_i("b9")], "\\neq "); strcpy(ftech_transl[hs_to_i("ba")], "\\equiv "); strcpy(ftech_transl[hs_to_i("bb")], "\\approx "); strcpy(ftech_transl[hs_to_i("bc")], "\\ldots "); strcpy(ftech_transl[hs_to_i("bd")], "\\mid "); strcpy(ftech_transl[hs_to_i("c0")], "\\aleph "); strcpy(ftech_transl[hs_to_i("c1")], "\\Im "); strcpy(ftech_transl[hs_to_i("c2")], "\\Re "); strcpy(ftech_transl[hs_to_i("c3")], "\\wp "); strcpy(ftech_transl[hs_to_i("c4")], "\\otimes "); strcpy(ftech_transl[hs_to_i("c5")], "\\oplus "); strcpy(ftech_transl[hs_to_i("c6")], "\\oslash "); strcpy(ftech_transl[hs_to_i("c7")], "\\cap "); strcpy(ftech_transl[hs_to_i("c8")], "\\cup "); strcpy(ftech_transl[hs_to_i("c9")], "\\supset "); strcpy(ftech_transl[hs_to_i("ca")], "\\supseteq "); strcpy(ftech_transl[hs_to_i("cb")], "\\not\\subset "); strcpy(ftech_transl[hs_to_i("cc")], "\\subset "); strcpy(ftech_transl[hs_to_i("cd")], "\\subseteq "); strcpy(ftech_transl[hs_to_i("ce")], "\\in "); strcpy(ftech_transl[hs_to_i("cf")], "\\not\\in "); strcpy(ftech_transl[hs_to_i("d0")], "\\angle "); strcpy(ftech_transl[hs_to_i("d1")], "\\nabla "); strcpy(ftech_transl[hs_to_i("d2")], "\\registered "); strcpy(ftech_transl[hs_to_i("d3")], "\\copyright "); strcpy(ftech_transl[hs_to_i("d4")], "\\trademark "); strcpy(ftech_transl[hs_to_i("d5")], "\\prod "); strcpy(ftech_transl[hs_to_i("d7")], "\\cdot "); strcpy(ftech_transl[hs_to_i("d8")], "\\neg "); strcpy(ftech_transl[hs_to_i("d9")], "\\wedge "); strcpy(ftech_transl[hs_to_i("da")], "\\vee "); strcpy(ftech_transl[hs_to_i("db")], "\\Leftrightarrow "); strcpy(ftech_transl[hs_to_i("dc")], "\\Leftarrow "); strcpy(ftech_transl[hs_to_i("dd")], "\\Uparrow "); strcpy(ftech_transl[hs_to_i("de")], "\\Rightarrow "); strcpy(ftech_transl[hs_to_i("df")], "\\Downarrow "); strcpy(ftech_transl[hs_to_i("e0")], "\\diamondsuit "); strcpy(ftech_transl[hs_to_i("e1")], "\\langle "); strcpy(ftech_transl[hs_to_i("e2")], "\\registered "); strcpy(ftech_transl[hs_to_i("e3")], "\\copyright "); strcpy(ftech_transl[hs_to_i("e4")], "\\trademark "); strcpy(ftech_transl[hs_to_i("e5")], "\\sum "); strcpy(ftech_transl[hs_to_i("e9")], "\\lceil "); strcpy(ftech_transl[hs_to_i("ea")], "\\mid "); strcpy(ftech_transl[hs_to_i("eb")], "\\lfloor "); strcpy(ftech_transl[hs_to_i("f1")], "\\rangle "); strcpy(ftech_transl[hs_to_i("f2")], "\\int "); strcpy(end_math_code, "$"); } /* ======================================================================= */ /* this procedure returns a set of 4 chars, the size preamble of a non std font */ Static Char *sizealpha(Result, i) Char *Result; short i; { short h; h = i / 2; if (h <= 5) return strcpy(Result, "\\fiv"); else if (h <= 6) return strcpy(Result, "\\six"); else if (h <= 7) return strcpy(Result, "\\sev"); else if (h <= 8) return strcpy(Result, "\\egt"); else if (h <= 9) return strcpy(Result, "\\nin"); else if (h <= 10) return strcpy(Result, "\\ten"); else if (h <= 11) return strcpy(Result, "\\elv"); else if (h <= 13) return strcpy(Result, "\\twl"); else if (h <= 15) return strcpy(Result, "\\frt"); else if (h <= 18) return strcpy(Result, "\\svtn"); else if (h <= 23) return strcpy(Result, "\\twty"); else if (h <= 28) return strcpy(Result, "\\twfv"); else { return strcpy(Result, "\\thtw"); /*END IF*/ } } /* ======================================================================= */ /* write "help" information */ Static Void write_help() { printf("Usage: RTFLATEX [options] [options] \n"); printf("Options:\n"); printf(" -b : set explicit \\baselineskip at par ends\n"); printf(" -d : debug level: 1=default, 0=quiet, >1=verbose\n"); printf(" -f : file template to put figures (need a * )\n"); printf(" -l