Index: src/config.l
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/config.l,v
retrieving revision 1.6.4.1
diff -u -r1.6.4.1 config.l
--- src/config.l	10 Feb 2013 17:58:09 -0000	1.6.4.1
+++ src/config.l	23 Feb 2013 19:30:41 -0000
@@ -1147,6 +1147,21 @@
       exit(1);
     }
   }
+  // Test to see if MathJax code file is valid
+  if (Config_getBool("USE_MATHJAX"))
+  {
+    QCString &MathJaxCodeile = Config_getString("MATHJAX_CODEFILE");
+    if (!MathJaxCodeile.isEmpty())
+    {
+      QFileInfo fi(MathJaxCodeile);
+      if (!fi.exists())
+      {
+        config_err("error: tag MATHJAX_CODEFILE file `%s' "
+	    "does not exist\n",MathJaxCodeile.data());
+        exit(1);
+      }
+    }
+  }
   // Test to see if LaTeX header is valid
   QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
   if (!latexHeaderFile.isEmpty())
Index: src/config.xml
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/config.xml,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 config.xml
--- src/config.xml	16 Feb 2013 14:40:51 -0000	1.9.2.1
+++ src/config.xml	23 Feb 2013 19:30:50 -0000
@@ -1145,6 +1145,11 @@
 names that should be enabled during MathJax rendering. 
 ' depends='USE_MATHJAX'>
     </option>
+    <option type='string' id='MATHJAX_CODEFILE' format='string' docs='
+The MATHJAX_CODEFILE tag can be used to specify a file with javascript 
+pieces of code that will be used on startup of the MathJax code. 
+' depends='USE_MATHJAX'>
+    </option>
     <option type='bool' id='SEARCHENGINE' docs='
 When the SEARCHENGINE tag is enabled doxygen will generate a search box 
 for the HTML output. The underlying search engine uses javascript 
Index: src/configoptions.cpp
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/configoptions.cpp,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 configoptions.cpp
--- src/configoptions.cpp	16 Feb 2013 14:40:51 -0000	1.9.2.1
+++ src/configoptions.cpp	23 Feb 2013 19:32:13 -0000
@@ -1673,6 +1673,13 @@
                 );
   cl->addDependency("USE_MATHJAX");
   //----
+  cs = cfg->addString(
+                 "MATHJAX_CODEFILE",
+                 "The MATHJAX_CODEFILE tag can be used to specify a file with javascript\n"
+                 "pieces of code that will be used on startup of the MathJax code."
+                );
+  cs->addDependency("USE_MATHJAX");
+  //----
   cb = cfg->addBool(
                  "SEARCHENGINE",
                  "When the SEARCHENGINE tag is enabled doxygen will generate a search box\n"
Index: src/htmlgen.cpp
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/src/htmlgen.cpp,v
retrieving revision 1.10.4.1
diff -u -r1.10.4.1 htmlgen.cpp
--- src/htmlgen.cpp	16 Feb 2013 14:40:51 -0000	1.10.4.1
+++ src/htmlgen.cpp	23 Feb 2013 19:31:04 -0000
@@ -104,6 +104,7 @@
 
 static QCString g_header;
 static QCString g_footer;
+static QCString g_mathjax_code;
 
 //------------------------- Pictures for the Tabs ------------------------
 
@@ -1176,9 +1177,16 @@
       mathJaxFormat = "HTML-CSS";
     }
     mathJaxJs += "],\n"
-                 "    jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"],\n"
-                 "});\n"
-                 "</script>";
+                 "    jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"]\n"
+                 "  });\n";
+
+    if (!g_mathjax_code.isEmpty())
+    {
+      mathJaxJs += g_mathjax_code;
+      mathJaxJs += "\n";
+    }
+    mathJaxJs += "</script>\n";
+
     if (mathJaxConfig.isEmpty())
     {
       mathJaxJs += "<script src=\"" + path + "MathJax.js\"></script>\n";
@@ -1458,6 +1466,15 @@
   {
     g_footer = defaultHtmlFooter;
   }
+
+  if (Config_getBool("USE_MATHJAX"))
+  {
+    if (!Config_getString("MATHJAX_CODEFILE").isEmpty()) 
+    {
+      g_mathjax_code=fileToString(Config_getString("MATHJAX_CODEFILE"));
+      //printf("g_mathjax_code='%s'\n",g_mathjax_code.data());
+    }
+  }
   createSubDirs(d);
 
   QCString fileName=dname+"/tabs.css";
Index: doc/config.doc
===================================================================
RCS file: /cygdrive/d/cvs_doxygen/doxygen/doxygen/doc/config.doc,v
retrieving revision 1.8.2.2
diff -u -r1.8.2.2 config.doc
--- doc/config.doc	16 Feb 2013 14:40:51 -0000	1.8.2.2
+++ doc/config.doc	23 Feb 2013 19:27:35 -0000
@@ -223,6 +223,7 @@
 \refitem cfg_mathjax_format MATHJAX_FORMAT
 \refitem cfg_mathjax_config MATHJAX_CONFIG
 \refitem cfg_mathjax_relpath MATHJAX_RELPATH
+\refitem cfg_mathjax_codefile MATHJAX_CODEFILE
 \refitem cfg_max_dot_graph_depth MAX_DOT_GRAPH_DEPTH
 \refitem cfg_max_initializer_lines MAX_INITIALIZER_LINES
 \refitem cfg_mscfile_dirs MSCFILE_DIRS
@@ -1892,6 +1893,25 @@
 MATHJAX_CONFIG = TeX-AMS-MML_SVG
 \endverbatim
 
+\anchor cfg_mathjax_codefile
+<dt>\c MATHJAX_CODEFILE <dd>
+ \addindex MATHJAX_CODEFILE
+ The MATHJAX_CODE_FILE tag can be used to specify a file with javascript 
+ pieces of code that will be used on startup of the MathJax code. 
+ See 
+<a href="http://docs.mathjax.org/en/latest/output.html">the MathJax site</a>
+ for more details.<br>
+ As an example to disable the "Math Renderer" menu item in the "Math
+ Settings" menu of MathJax:
+\verbatim
+MATHJAX_CODEFILE = disableRenderer
+  with in the file \c disableRenderer:
+  MathJax.Hub.Config({
+   menuSettings: {
+    showRenderer: false,
+   } 
+  });
+\endverbatim
 \anchor cfg_mathjax_relpath
 <dt>\c MATHJAX_RELPATH <dd>
  \addindex MATHJAX_RELPATH
