Author: bugman Date: Mon Aug 27 19:10:54 2012 New Revision: 17347 URL: http://svn.gna.org/viewcvs/relax?rev=17347&view=rev Log: Redesigned the formatting of the user function chapter of the relax manual. The fetch_docstrings.py now forces each user function to start in a new column. This increases the size of the manual, but makes the reading of the user function documentation much easier. The user function class and function icons (128x128 format) are now placed between the top bar and the subsection title and are left and right justified. This prettification simply allows the user functions to be more quickly identified. Modified: trunk/docs/latex/fetch_docstrings.py Modified: trunk/docs/latex/fetch_docstrings.py URL: http://svn.gna.org/viewcvs/relax/trunk/docs/latex/fetch_docstrings.py?rev=17347&r1=17346&r2=17347&view=diff ============================================================================== --- trunk/docs/latex/fetch_docstrings.py (original) +++ trunk/docs/latex/fetch_docstrings.py Mon Aug 27 19:10:54 2012 @@ -28,7 +28,8 @@ sys.path.append(sys.path[0]) sys.path[0] = '../..' -# Import the program relax. +# relax module imports. +from graphics import fetch_icon from user_functions.data import Uf_info; uf_info = Uf_info() from user_functions.data import Uf_tables; uf_tables = Uf_tables() @@ -50,6 +51,15 @@ # Loop over the user functions. for self.uf_name, self.uf in uf_info.uf_loop(): + # The user function class. + self.uf_class = None + if search('\.', self.uf_name): + # Split up the name. + class_name, uf_name = split(self.uf_name, '.') + + # Get the user function class data object. + self.uf_class = uf_info.get_class(class_name) + # Reset the table count for each user function. self.uf_table_count = 1 @@ -212,10 +222,23 @@ # Add a spaced out rule. self.file.write("\\vspace{20pt}\n") + self.file.write("\\pagebreak[4]\n") self.file.write("\\rule{\columnwidth}{2pt}\n") - self.file.write("\\vspace{-30pt}\n") + self.file.write("\\vspace{10pt}\n") + + # Add the user function class icon. + if self.uf_class: + icon = fetch_icon(self.uf_class.gui_icon, size='128x128', format='eps.gz') + if icon: + self.file.write("\includegraphics[bb=0 0 18 18]{%s} \hfill " % icon) + + # Add the user function icon. + icon = fetch_icon(self.uf.gui_icon, size='128x128', format='eps.gz') + if icon: + self.file.write("\includegraphics[bb=0 0 18 18]{%s}\n\n" % icon) # The title. + self.file.write("\\vspace{-20pt}\n") self.uf_name_latex = self.uf_name # LaTeX formatting. @@ -227,7 +250,7 @@ self.uf_name_latex = replace(self.uf_name_latex, '\_', '\-\_') # Write out the title (with label). - self.file.write("\subsection{%s} \label{uf: %s}\n\n" % (self.uf_name_latex, self.uf_name)) + self.file.write("\subsection{%s} \label{uf: %s}\n" % (self.uf_name_latex, self.uf_name)) def indexing(self, index, bold=False):