[Rivet-svn] r4191 - trunk/doc

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Mar 5 17:45:02 GMT 2013


Author: buckley
Date: Tue Mar  5 17:45:02 2013
New Revision: 4191

Log:
Disabling the histo list generation in the manual until we can do it *properly* via YODA.

Modified:
   trunk/doc/mk-analysis-latex

Modified: trunk/doc/mk-analysis-latex
==============================================================================
--- trunk/doc/mk-analysis-latex	Tue Mar  5 17:44:57 2013	(r4190)
+++ trunk/doc/mk-analysis-latex	Tue Mar  5 17:45:02 2013	(r4191)
@@ -44,17 +44,24 @@
 
 
 def texify(s):
+    "Insert required TeX escapes"
     t = s \
         .replace(r"&", r"\&") \
         .replace(r"\\&", r"\&") \
         .replace(r"#", r"\#") \
+        # .replace(r"_", r"\_") \
+        # .replace(r"^", r"") \
+    return t
+
+def niceify(s):
+    "Replace informal symbols in titles and descriptions with nice LaTeX forms"
+    t = s \
         .replace(r"->", r"\ensuremath{\to}") \
         .replace(r"pT", r"\pT") \
         .replace(r"sqrt(s)", r"\ensuremath{\sqrt{s}}")
-        # .replace(r"_", r"\_") \
-        # .replace(r"^", r"") \
     return t
 
+
 ## Build analysis pages
 all_analyses = rivet.AnalysisLoader.analysisNames()
 pages = { "LEP and SLC":[], "Tevatron":[], "LHC":[], "SPS":[], "HERA":[], "RHIC":[], "Monte Carlo":[], "Example":[], "Misc.":[] }
@@ -72,7 +79,7 @@
         citetex = r"\cite{%s}" % ana.bibKey()
         subtitle = "\\subsection[%s]{%s}\n" % (safe_aname, safe_aname + "\," + citetex)
     page += subtitle
-    page += "\\textbf{%s}\\newline\n" %  ana.summary()
+    page += "\\textbf{%s}\\newline\n" % niceify(ana.summary())
     if ana.requiredBeams():
         def pid_to_str(pid):
             if pid == 11:
@@ -152,36 +159,37 @@
         page += "\\begin{itemize}\n"
         for i in infos:
             if i:
-                page += "\\item %s\n" % i
+                page += "\\item %s\n" % niceify(i)
         page += "\\end{itemize}\n"
     else:
         page += "\\textbf{No run details listed}\\\\ \n"
 
 
     for para in ana.description().split("\n\n"):
-        page += "\n\\noindent " + para + "\n"
+        page += "\n\\noindent " + niceify(para) + "\n"
 
 
-    try:
-        import readplot
-        info = readplot.plotinfo(ana.name())
-        histpage = ""
-        histcount = 0
-        if info and info.keys():
-            histpage += "\n\\vspace{1em}\n\\noindent\n"
-            histpage += "\\textbf{Histograms:}\n \\penalty 100\n"
-            try:
-                histpage += "\\begin{itemize}\n"
-                for hpath in sorted(info.keys()):
-                    htitle = info[hpath]["TITLE"]
-                    histpage += "  \\item %s (\kbd{%s})\n" % (htitle, hpath.replace(r"_", r"\_"))
-                    histcount += 1
-            finally:
-                histpage += "\\end{itemize}\n"
-        if histcount > 0:
-            page += histpage
-    except:
-        pass
+    # TODO: The plot file contains patterns, not all histo names: we need to work a bit harder than this!
+    # try:
+    #     import readplot
+    #     info = readplot.plotinfo(ana.name())
+    #     histpage = ""
+    #     histcount = 0
+    #     if info and info.keys():
+    #         histpage += "\n\\vspace{1em}\n\\noindent\n"
+    #         histpage += "\\textbf{Histograms:}\n \\penalty 100\n"
+    #         try:
+    #             histpage += "\\begin{itemize}\n"
+    #             for hpath in sorted(info.keys()):
+    #                 htitle = info[hpath]["TITLE"]
+    #                 histpage += "  \\item %s (\kbd{%s})\n" % (htitle, hpath.replace(r"_", r"\_"))
+    #                 histcount += 1
+    #         finally:
+    #             histpage += "\\end{itemize}\n"
+    #     if histcount > 0:
+    #         page += histpage
+    # except:
+    #     pass
 
     page += "\n\\clearpage\n"
 
@@ -218,6 +226,7 @@
 \\renewcommand{\\phi}{\\ensuremath{\\old at phi}\\xspace}
 \\providecommand{\\pT}{\\ensuremath{p_\\perp}\\xspace}
 \\providecommand{\\pTmin}{\\ensuremath{p_\\perp^\\text{min}}\\xspace}
+\\renewcommand{\\d}{\\ensuremath{\\mathrm{d}}\\xspace}
 \\makeatother
 
 """


More information about the Rivet-svn mailing list