From: bangerth Date: Sat, 31 Mar 2012 10:41:51 +0000 (+0000) Subject: Implement writing an index into the latex representation of parameter trees. For... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6242cf9887c45d3408ac2cc5966a21359678cdb0;p=dealii-svn.git Implement writing an index into the latex representation of parameter trees. For large parameter files this gives a way to search for individual parameters when printing all of their information into a manual. For reference, the ASPECT manual currently lists 14 pages of run-time parameters. git-svn-id: https://svn.dealii.org/trunk@25347 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/parameter_handler.h b/deal.II/include/deal.II/base/parameter_handler.h index 8cbbeb49df..a218768708 100644 --- a/deal.II/include/deal.II/base/parameter_handler.h +++ b/deal.II/include/deal.II/base/parameter_handler.h @@ -2018,6 +2018,44 @@ class ParameterHandler : public Subscriptor * given to the * declare_entry() function * if available. + * + * In Text 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 @\index + * statements in two indices called + * prmindex (where the + * name of each parameter is listed + * in the index) and prmindexfull + * where parameter names are listed + * sorted by the section in which + * they exist. By default, the LaTeX + * program ignores these @\index + * 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); diff --git a/deal.II/source/base/parameter_handler.cc b/deal.II/source/base/parameter_handler.cc index 0aa2e390d5..07b152ac53 100644 --- a/deal.II/source/base/parameter_handler.cc +++ b/deal.II/source/base/parameter_handler.cc @@ -1748,10 +1748,21 @@ ParameterHandler::print_parameters_section (std::ostream &out, { const std::string value = p->second.get("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; ifirst) + << "}\n"; + + // finally print value and default + out << "{\\it Value:} " << value << "\n\n" << std::endl << "{\\it Default:} " << p->second.get("default_value") << "\n\n"