<p><b>dwj07@fsu.edu</b> 2013-03-21 11:30:31 -0600 (Thu, 21 Mar 2013)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Fixing subscripts in descriptions.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/tools/python_scripts/namelist_generation/parse_xml_registry.py
===================================================================
--- branches/tools/python_scripts/namelist_generation/parse_xml_registry.py        2013-03-21 17:14:36 UTC (rev 2647)
+++ branches/tools/python_scripts/namelist_generation/parse_xml_registry.py        2013-03-21 17:30:31 UTC (rev 2648)
@@ -95,6 +95,8 @@
                                         else:
                                                 dim_description = &quot;%s $%s$&quot;%(dim_description, part)
                                                 replace = True
+                        else:
+                                dim_description = &quot;%s&quot;%dim_description.replace('_','\_')
 
                 latex.write('        %s &amp; %s &amp; %s \\\\ </font>
<font color="black">'%(dim_name.replace('_','\_'), dim_units.replace('_','\_'), dim_description.replace('_','\_')))
                 latex.write('        \hline</font>
<font color="gray">')
@@ -146,7 +148,7 @@
                         if equations != -1:
                                 opt_desc_split = opt_description.split(&quot;$&quot;)
 
-                                if opt_description.replace('_','')[0] == &quot;$&quot;:
+                                if opt_description.replace(' ','')[0] == &quot;$&quot;:
                                         replace = False
                                         opt_description = &quot;$&quot;
                                 else:
@@ -160,8 +162,10 @@
                                         else:
                                                 opt_description = &quot;%s $%s$&quot;%(opt_description, part)
                                                 replace = True
+                        else:
+                                opt_description = &quot;%s&quot;%opt_description.replace('_','\_')
 
-                latex.write('        \hyperref[subsec:nm_sec_%s]{%s} &amp; %s \\\\</font>
<font color="blue">'%(opt_name, opt_name.replace('_','\_'), opt_description.replace('_', '\_')))
+                latex.write('        \hyperref[subsec:nm_sec_%s]{%s} &amp; %s \\\\</font>
<font color="black">'%(opt_name, opt_name.replace('_','\_'), opt_description))
                 latex.write('        \hline</font>
<font color="black">')
 
         latex.write('\end{longtable}</font>
<font color="gray">')
@@ -209,7 +213,7 @@
 
 
                 if opt_description == &quot;&quot;:
-                        opt_description = latex_missing_string
+                        opt_description = latex_missing_string.replace('_','\_')
                 else:
                         equations = opt_description.find('$')
                         if equations != -1:
@@ -229,6 +233,8 @@
                                         else:
                                                 opt_description = &quot;%s $%s$&quot;%(opt_description, part)
                                                 replace = True
+                        else:
+                                opt_description = &quot;%s&quot;%opt_description.replace('_','\_')
 
                 latex.write('\subsection[%s]{\hyperref[sec:nm_tab_%s]{%s}}</font>
<font color="black">'%(opt_name.replace('_','\_'),rec_name,opt_name.replace('_','\_')))
                 latex.write('\label{subsec:nm_sec_%s}</font>
<font color="gray">'%opt_name)
@@ -243,7 +249,7 @@
                 latex.write('    \hline</font>
<font color="black">')
                 latex.write('    Possible Values: &amp; %s \\\\</font>
<font color="black">'%opt_possible_values.replace('_','\_'))
                 latex.write('    \hline</font>
<font color="red">')
-                latex.write('    \caption{%s: %s}</font>
<font color="blue">'%(opt_name.replace('_','\_'), opt_description.replace('_','\_')))
+                latex.write('    \caption{%s: %s}</font>
<font color="black">'%(opt_name.replace('_','\_'), opt_description))
                 latex.write('\end{longtable}</font>
<font color="black">')
                 latex.write('\end{center}</font>
<font color="gray">')
 latex.close()
@@ -279,7 +285,7 @@
                         var_description = var.attrib['description']
 
                         if var_description == &quot;&quot;:
-                                var_description = latex_missing_string
+                                var_description = latex_missing_string.replace('_','\_')
                         else:
                                 equations = var_description.find('$')
                                 if equations != -1:
@@ -299,8 +305,10 @@
                                                 else:
                                                         var_description = &quot;%s $%s$&quot;%(var_description, part)
                                                         replace = True
+                                else:
+                                        var_description = &quot;%s&quot;%var_description.replace('_','\_')
 
-                        latex.write('        \hyperref[subsec:var_sec_%s_%s]{%s} &amp; %s \\\\</font>
<font color="blue">'%(struct_name, var_name, var_name.replace('_','\_'), var_description.replace('_','\_')))
+                        latex.write('        \hyperref[subsec:var_sec_%s_%s]{%s} &amp; %s \\\\</font>
<font color="black">'%(struct_name, var_name, var_name.replace('_','\_'), var_description))
                         latex.write('        \hline</font>
<font color="gray">')
 
 
@@ -310,7 +318,7 @@
                 var_description = var.attrib['description']
 
                 if var_description == &quot;&quot;:
-                        var_description = latex_missing_string
+                        var_description = latex_missing_string.replace('_','\_')
                 else:
                         equations = var_description.find('$')
                         if equations != -1:
@@ -330,8 +338,10 @@
                                         else:
                                                 var_description = &quot;%s $%s$&quot;%(var_description, part)
                                                 replace = True
+                        else:
+                                var_description = &quot;%s&quot;%var_description.replace('_','\_')
 
-                latex.write('        \hyperref[subsec:var_sec_%s_%s]{%s} &amp; %s \\\\</font>
<font color="blue">'%(struct_name, var_name, var_name.replace('_','\_'), var_description.replace('_','\_')))
+                latex.write('        \hyperref[subsec:var_sec_%s_%s]{%s} &amp; %s \\\\</font>
<font color="black">'%(struct_name, var_name, var_name.replace('_','\_'), var_description))
                 latex.write('        \hline</font>
<font color="black">')
 
         latex.write('\end{longtable}</font>
<font color="gray">')
@@ -382,7 +392,7 @@
                         try:
                                 var_description = var.attrib['description']
                         except:
-                                var_description = latex_missing_string
+                                var_description = latex_missing_string.replace('_','\_')
 
                         try:
                                 var_streams = var.attrib['streams'].replace('s','Sfc ').replace('i','Input ').replace('r', 'Restart ').replace('o','Output ')
@@ -397,7 +407,7 @@
                                 var_path = &quot;domain %% blocklist %% %s %% %s&quot;%(struct_name, var_arr_name)
 
                         if var_description == &quot;&quot;:
-                                var_description = latex_missing_string
+                                var_description = latex_missing_string.replace('_','\_')
                         else:
                                 equations = var_description.find('$')
                                 if equations != -1:
@@ -417,6 +427,8 @@
                                                 else:
                                                         var_description = &quot;%s $%s$&quot;%(var_description, part)
                                                         replace = True
+                                else:
+                                        var_description = &quot;%s&quot;%var_description.replace('_','\_')
 
                         
                         latex.write('\subsection[%s]{\hyperref[sec:var_tab_%s]{%s}}</font>
<font color="gray">'%(var_name.replace('_','\_'),struct_name, var_name.replace('_','\_')))
@@ -441,7 +453,7 @@
                         latex.write('                 \hline </font>
<font color="black">')
                         latex.write('                 Array Group: &amp; %s \\\\</font>
<font color="black">'%var_arr_group)
                         latex.write('                 \hline </font>
<font color="red">')
-                        latex.write('    \caption{%s: %s}</font>
<font color="blue">'%(var_name.replace('_','\_'),var_description.replace('_','\_')))
+                        latex.write('    \caption{%s: %s}</font>
<font color="black">'%(var_name.replace('_','\_'),var_description))
                         latex.write('\end{longtable}</font>
<font color="black">')
                         latex.write('\end{center}</font>
<font color="gray">')
 
@@ -477,7 +489,7 @@
                         try:
                                 var_description = var.attrib['description']
                         except:
-                                var_description = latex_missing_string
+                                var_description = latex_missing_string.replace('_','\_')
 
                         try:
                                 var_streams = var.attrib['streams'].replace('s','Sfc ').replace('i','Input ').replace('r', 'Restart ').replace('o','Output ')
@@ -490,7 +502,7 @@
                                 var_path = &quot;domain %% blocklist %% %s %% %s&quot;%(struct_name, var_name_in_code)
 
                         if var_description == &quot;&quot;:
-                                var_description = latex_missing_string
+                                var_description = latex_missing_string.replace('_','\_')
                         else:
                                 equations = var_description.find('$')
                                 if equations != -1:
@@ -510,6 +522,8 @@
                                                 else:
                                                         var_description = &quot;%s $%s$&quot;%(var_description, part)
                                                         replace = True
+                                else:
+                                        var_description = &quot;%s&quot;%var_description.replace('_','\_')
 
                         
                         latex.write('\subsection[%s]{\hyperref[sec:var_tab_%s]{%s}}</font>
<font color="gray">'%(var_name.replace('_','\_'),struct_name, var_name.replace('_','\_')))
@@ -530,7 +544,7 @@
                         latex.write('        \hline </font>
<font color="black">')
                         latex.write('                 Location in code: &amp; %s \\\\</font>
<font color="black">'%var_path.replace('_','\_').replace('%','\%'))
                         latex.write('                 \hline </font>
<font color="red">')
-                        latex.write('    \caption{%s: %s}</font>
<font color="blue">'%(var_name.replace('_','\_'),var_description.replace('_','\_')))
+                        latex.write('    \caption{%s: %s}</font>
<font color="black">'%(var_name.replace('_','\_'),var_description))
                         latex.write('\end{longtable}</font>
<font color="black">')
                         latex.write('\end{center}</font>
<font color="black">')
 latex.close()

</font>
</pre>