]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implement writing an index into the latex representation of parameter trees. For...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 31 Mar 2012 10:41:51 +0000 (10:41 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 31 Mar 2012 10:41:51 +0000 (10:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@25347 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/parameter_handler.h
deal.II/source/base/parameter_handler.cc

index 8cbbeb49df9de47a046c3f58b501f39c909e1f40..a218768708bef9b40b014e21ee4091bc3feba51b 100644 (file)
@@ -2018,6 +2018,44 @@ class ParameterHandler : public Subscriptor
                                       * given to the
                                       * declare_entry() function
                                       * if available.
+                                      *
+                                      * In <tt>Text</tt> format, the
+                                      * output contains the same information
+                                      * but in a format so that the
+                                      * resulting file can be input into
+                                      * a latex document such as a manual
+                                      * for the code for which this object
+                                      * handles run-time parameters.
+                                      * The various sections of parameters
+                                      * are then represented by latex
+                                      * section and subsection commands
+                                      * as well as by nested enumerations.
+                                      *
+                                      * In addition, all parameter names
+                                      * are listed with <code>@\index</code>
+                                      * statements in two indices called
+                                      * <code>prmindex</code> (where the
+                                      * name of each parameter is listed
+                                      * in the index) and <code>prmindexfull</code>
+                                      * where parameter names are listed
+                                      * sorted by the section in which
+                                      * they exist. By default, the LaTeX
+                                      * program ignores these <code>@\index</code>
+                                      * commands, but they can be used to
+                                      * generate an index by using the
+                                      * following commands in the preamble
+                                      * of the latex file:
+                                      * @code
+                                      * \usepackage{imakeidx}
+                                      * \makeindex[name=prmindex, title=Index of run-time parameter entries]
+                                      * \makeindex[name=prmindexfull, title=Index of run-time parameters with section names]
+                                      * @endcode
+                                      * and at the end of the file
+                                      * this:
+                                      * @code
+                                      * \printindex[prmindex]
+                                      * \printindex[prmindexfull]
+                                      * @endcode
                                       */
     std::ostream & print_parameters (std::ostream      &out,
                                      const OutputStyle  style);
index 0aa2e390d550b5538de06064167968776ef10d97..07b152ac53308a26fd64fa447dfef8c38ff11474 100644 (file)
@@ -1748,10 +1748,21 @@ ParameterHandler::print_parameters_section (std::ostream      &out,
             {
               const std::string value = p->second.get<std::string>("value");
 
-                                               // print name and value
+                                               // print name
               out << "\\item {\\it Parameter name:} {\\tt " << demangle(p->first) << "}\n\n"
-                  << std::endl
-                  << "{\\it Value:} " << value << "\n\n"
+                  << std::endl;
+
+              out << "\\index[prmindex]{"
+                  << demangle(p->first)
+                  << "}\n";
+              out << "\\index[prmindexfull]{";
+              for (unsigned int i=0; i<subsection_path.size(); ++i)
+                out << subsection_path[i] << "!";
+              out << demangle(p->first)
+                  << "}\n";
+
+                                               // finally print value and default
+              out << "{\\it Value:} " << value << "\n\n"
                   << std::endl
                   << "{\\it Default:} "
                   << p->second.get<std::string>("default_value") << "\n\n"

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.