Merge release-4-5-patches into release-4-6
[alexxy/gromacs.git] / src / gmxlib / wman.c
index da4b42aa7bedaa9a69b7dee75f8791f360e53f98..5960617519c2ae0dcea9138c8ab80deb5ddb1f9f 100644 (file)
@@ -61,6 +61,11 @@ typedef struct {
   char *search,*replace;
 } t_sandr;
 
+/* The order of these arrays is significant. Text search and replace
+ * for each element occurs in order, so earlier changes can induce
+ * subsequent changes even though the original text might not appear
+ * to invoke the latter changes. */
+
 const t_sandr_const sandrTeX[] = {
   { "[TT]", "{\\tt " },
   { "[tt]", "}"      },
@@ -92,14 +97,44 @@ const t_sandr_const sandrTeX[] = {
   { "&",    "\\&"    },
   /* The next couple of lines allow true Greek symbols to be written to the 
      manual, which makes it look pretty */
-  { "[GRK]", "$\\"   },
-  { "[grk]", "$"     },
-  /* The next two lines used to substitute "|" and "||" to "or", but only
-   * g_angle used that functionality, so that was changed to a textual
-   * "or" there, so that other places could use those symbols to indicate
-   * magnitudes. */
-  { "||",    "\\textbar{}\\textbar"    },
-  { "|",     "\\textbar{}"    }
+  { "[GRK]", "\\ensuremath{\\" },
+  { "[grk]", "}" },
+  { "[MATH]","\\ensuremath{" },
+  { "[math]","}" },
+  { "[CHEVRON]", "\\ensuremath{<}" },
+  { "[chevron]", "\\ensuremath{>}" },
+  { "[MAG]", "\\ensuremath{|}" },
+  { "[mag]", "\\ensuremath{|}" },
+  { "[INT]","\\ensuremath{\\int" },
+  { "[FROM]","_" },
+  { "[from]","" },
+  { "[TO]", "^" },
+  { "[to]", "" },
+  { "[int]","}" },
+  { "[SUM]","\\ensuremath{\\sum" },
+  { "[sum]","}" },
+  { "[SUB]","\\ensuremath{_{" },
+  { "[sub]","}}" },
+  { "[SQRT]","\\ensuremath{\\sqrt{" },
+  { "[sqrt]","}}" },
+  { "[EXP]","\\ensuremath{\\exp{(" },
+  { "[exp]",")}}" },
+  { "[LN]","\\ensuremath{\\ln{(" },
+  { "[ln]",")}}" },
+  { "[LOG]","\\ensuremath{\\log{(" },
+  { "[log]",")}}" },
+  { "[COS]","\\ensuremath{\\cos{(" },
+  { "[cos]",")}}" },
+  { "[SIN]","\\ensuremath{\\sin{(" },
+  { "[sin]",")}}" },
+  { "[TAN]","\\ensuremath{\\tan{(" },
+  { "[tan]",")}}" },
+  { "[COSH]","\\ensuremath{\\cosh{(" },
+  { "[cosh]",")}}" },
+  { "[SINH]","\\ensuremath{\\sinh{(" },
+  { "[sinh]",")}}" },
+  { "[TANH]","\\ensuremath{\\tanh{(" },
+  { "[tanh]",")}}" }
 };
 #define NSRTEX asize(sandrTeX)
 
@@ -110,6 +145,42 @@ const t_sandr_const sandrTty[] = {
   { "[bb]", "" },
   { "[IT]", "" },
   { "[it]", "" },
+  { "[MATH]","" },
+  { "[math]","" },
+  { "[CHEVRON]","<" },
+  { "[chevron]",">" },
+  { "[MAG]", "|" },
+  { "[mag]", "|" },
+  { "[INT]","integral" },
+  { "[FROM]"," from " },
+  { "[from]","" },
+  { "[TO]", " to " },
+  { "[to]", " of" },
+  { "[int]","" },
+  { "[SUM]","sum" },
+  { "[sum]","" },
+  { "[SUB]","_" },
+  { "[sub]","" },
+  { "[SQRT]","sqrt(" },
+  { "[sqrt]",")" },
+  { "[EXP]","exp(" },
+  { "[exp]",")" },
+  { "[LN]","ln(" },
+  { "[ln]",")" },
+  { "[LOG]","log(" },
+  { "[log]",")" },
+  { "[COS]","cos(" },
+  { "[cos]",")" },
+  { "[SIN]","sin(" },
+  { "[sin]",")" },
+  { "[TAN]","tan(" },
+  { "[tan]",")" },
+  { "[COSH]","cosh(" },
+  { "[cosh]",")" },
+  { "[SINH]","sinh(" },
+  { "[sinh]",")" },
+  { "[TANH]","tanh(" },
+  { "[tanh]",")" },
   { "[PAR]","\n\n" },
   { "[BR]", "\n"},
   { "[GRK]", "" },
@@ -127,6 +198,42 @@ const t_sandr_const sandrWiki[] = {
   { "[bb]", "'''" },
   { "[IT]", "''" },
   { "[it]", "''" },
+  { "[MATH]","" },
+  { "[math]","" },
+  { "[CHEVRON]","<" },
+  { "[chevron]",">" },
+  { "[MAG]", "|" },
+  { "[mag]", "|" },
+  { "[INT]","integral" },
+  { "[FROM]"," from " },
+  { "[from]","" },
+  { "[TO]", " to " },
+  { "[to]", " of" },
+  { "[int]","" },
+  { "[SUM]","sum" },
+  { "[sum]","" },
+  { "[SUB]","_" },
+  { "[sub]","" },
+  { "[SQRT]","sqrt(" },
+  { "[sqrt]",")", },
+  { "[EXP]","exp(" },
+  { "[exp]",")" },
+  { "[LN]","ln(" },
+  { "[ln]",")" },
+  { "[LOG]","log(" },
+  { "[log]",")" },
+  { "[COS]","cos(" },
+  { "[cos]",")" },
+  { "[SIN]","sin(" },
+  { "[sin]",")" },
+  { "[TAN]","tan(" },
+  { "[tan]",")" },
+  { "[COSH]","cosh(" },
+  { "[cosh]",")" },
+  { "[SINH]","sinh(" },
+  { "[sinh]",")" },
+  { "[TANH]","tanh(" },
+  { "[tanh]",")" },
   { "[PAR]","\n\n" },
   { "[BR]", "\n" },
   { "[GRK]", "&" },
@@ -141,6 +248,42 @@ const t_sandr_const sandrNROFF[] = {
   { "[bb]", "\\fR" },
   { "[IT]", "\\fI " },
   { "[it]", "\\fR" },
+  { "[MATH]","" },
+  { "[math]","" },
+  { "[CHEVRON]","<" },
+  { "[chevron]",">" },
+  { "[MAG]", "|" },
+  { "[mag]", "|" },
+  { "[INT]","integral" },
+  { "[FROM]"," from " },
+  { "[from]","" },
+  { "[TO]", " to " },
+  { "[to]", " of" },
+  { "[int]","" },
+  { "[SUM]","sum" },
+  { "[sum]","" },
+  { "[SUB]","_" },
+  { "[sub]","" },
+  { "[SQRT]","sqrt(" },
+  { "[sqrt]",")", },
+  { "[EXP]","exp(" },
+  { "[exp]",")" },
+  { "[LN]","ln(" },
+  { "[ln]",")" },
+  { "[LOG]","log(" },
+  { "[log]",")" },
+  { "[COS]","cos(" },
+  { "[cos]",")" },
+  { "[SIN]","sin(" },
+  { "[sin]",")" },
+  { "[TAN]","tan(" },
+  { "[tan]",")" },
+  { "[COSH]","cosh(" },
+  { "[cosh]",")" },
+  { "[SINH]","sinh(" },
+  { "[sinh]",")" },
+  { "[TANH]","tanh(" },
+  { "[tanh]",")" },
   { "[PAR]","\n\n" },
   { "\n ",    "\n" },
   { "<",    "" },
@@ -163,6 +306,42 @@ const t_sandr_const sandrHTML[] = {
   { "[bb]", "</b>" },
   { "[IT]", "<it>" },
   { "[it]", "</it>" },
+  { "[MATH]","" },
+  { "[math]","" },
+  { "[CHEVRON]","<" },
+  { "[chevron]",">" },
+  { "[MAG]", "|" },
+  { "[mag]", "|" },
+  { "[INT]","integral" },
+  { "[FROM]"," from " },
+  { "[from]","" },
+  { "[TO]", " to " },
+  { "[to]", " of" },
+  { "[int]","" },
+  { "[SUM]","sum" },
+  { "[sum]","" },
+  { "[SUB]","_" },
+  { "[sub]","" },
+  { "[SQRT]","sqrt(" },
+  { "[sqrt]",")", },
+  { "[EXP]","exp(" },
+  { "[exp]",")" },
+  { "[LN]","ln(" },
+  { "[ln]",")" },
+  { "[LOG]","log(" },
+  { "[log]",")" },
+  { "[COS]","cos(" },
+  { "[cos]",")" },
+  { "[SIN]","sin(" },
+  { "[sin]",")" },
+  { "[TAN]","tan(" },
+  { "[tan]",")" },
+  { "[COSH]","cosh(" },
+  { "[cosh]",")" },
+  { "[SINH]","sinh(" },
+  { "[sinh]",")" },
+  { "[TANH]","tanh(" },
+  { "[tanh]",")" },
   { "[PAR]","<p>" },
   { "[BR]", "<br>" },
   { "[GRK]", "&"  },
@@ -179,6 +358,42 @@ const t_sandr_const sandrXML[] = {
   { "[bb]", "</emp>" },
   { "[IT]", "<it>" },
   { "[it]", "</it>" },
+  { "[MATH]","" },
+  { "[math]","" },
+  { "[CHEVRON]","<" },
+  { "[chevron]",">" },
+  { "[MAG]", "|" },
+  { "[mag]", "|" },
+  { "[INT]","integral" },
+  { "[FROM]"," from " },
+  { "[from]","" },
+  { "[TO]", " to " },
+  { "[to]", " of" },
+  { "[int]","" },
+  { "[SUM]","sum" },
+  { "[sum]","" },
+  { "[SUB]","_" },
+  { "[sub]","" },
+  { "[SQRT]","sqrt(" },
+  { "[sqrt]",")", },
+  { "[EXP]","exp(" },
+  { "[exp]",")" },
+  { "[LN]","ln(" },
+  { "[ln]",")" },
+  { "[LOG]","log(" },
+  { "[log]",")" },
+  { "[COS]","cos(" },
+  { "[cos]",")" },
+  { "[SIN]","sin(" },
+  { "[sin]",")" },
+  { "[TAN]","tan(" },
+  { "[tan]",")" },
+  { "[COSH]","cosh(" },
+  { "[cosh]",")" },
+  { "[SINH]","sinh(" },
+  { "[sinh]",")" },
+  { "[TANH]","tanh(" },
+  { "[tanh]",")" },
   { "[PAR]","</par>\n<par>" },
   { "[BR]", "<br />" },
   { "[GRK]", "" },