From: bangerth Date: Tue, 29 Nov 2011 04:19:31 +0000 (+0000) Subject: Rewrite output by ParameterHandler::print_parameters with latex format. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e5ad740d2c8d37253778000348948f9a2013500;p=dealii-svn.git Rewrite output by ParameterHandler::print_parameters with latex format. git-svn-id: https://svn.dealii.org/trunk@24777 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 7cd09605fe..e92dc754ae 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -73,6 +73,12 @@ enabled due to a missing include file in file

Specific improvements

    +
  1. Changed: Output of ParameterHandler::print_parameters with argument +ParameterHandler::LaTeX was not particularly readable. The output has +therefore been rewritten to be more structured and readable. +
    +(Wolfgang Bangerth, 2011/11/28) +
  2. Fixed: The TimerOutput class set the alignment of output to right-aligned under some circumstances, but didn't reset this to the previous value at the end of output. This is now fixed. diff --git a/deal.II/source/base/parameter_handler.cc b/deal.II/source/base/parameter_handler.cc index 36fe33fbf1..cf0787923d 100644 --- a/deal.II/source/base/parameter_handler.cc +++ b/deal.II/source/base/parameter_handler.cc @@ -1193,7 +1193,7 @@ namespace // satisfies its constraints const std::string new_value = p->second.get("value"); - + const unsigned int pattern_index = destination.get (full_path + path_separator + @@ -1214,7 +1214,7 @@ namespace // the destination argument destination.put (full_path + path_separator + "value", new_value); - + // this node might have // sub-nodes in addition to // "value", such as @@ -1578,10 +1578,8 @@ ParameterHandler::print_parameters (std::ostream &out, << "# ---------------------" << std::endl; break; case LaTeX: - out << "\\subsubsection*{Listing of parameters}"; + out << "\\subsection{Global parameters}"; out << std::endl << std::endl; - out << "\\begin{itemize}" - << std::endl; break; case Description: out << "Listing of Parameters:" << std::endl << std::endl; @@ -1602,7 +1600,6 @@ ParameterHandler::print_parameters (std::ostream &out, case ShortText: break; case LaTeX: - out << "\\end{itemize}" << std::endl; break; default: Assert (false, ExcNotImplemented()); @@ -1736,6 +1733,9 @@ ParameterHandler::print_parameters_section (std::ostream &out, case LaTeX: { + out << "\\begin{itemize}" + << std::endl; + // print entries one by // one. make sure they are // sorted by using the @@ -1748,23 +1748,28 @@ ParameterHandler::print_parameters_section (std::ostream &out, const std::string value = p->second.get("value"); // print name and value - out << "\\item {\\bf " << demangle(p->first) << ":} " - << value - << " ("; + out << "\\item {\\it Parameter name:} {\\tt " << demangle(p->first) << "}\\\\" + << std::endl + << "{\\it Value:} " << value << "\\\\" + << std::endl + << "{\\it Default:} " + << p->second.get("default_value") << "\\\\" + << std::endl; // if there is a // documenting string, // print it as well if (!p->second.get("documentation").empty()) - out <second.get("documentation") << ", "; + out << "{\\it Description:} " + << p->second.get("documentation") << "\\\\" + << std::endl; - // finally print default - // value - out << "{\\it default:} " - << p->second.get("default_value") - << ")" + // also output possible values + out << "{\\it Possible values:} " + << p->second.get ("pattern_description") << std::endl; } + out << "\\end{itemize}" << std::endl; break; } @@ -1875,13 +1880,23 @@ ParameterHandler::print_parameters_section (std::ostream &out, << "subsection " << demangle(p->first) << std::endl; break; case LaTeX: - out << std::endl - << "\\item {\\bf " - << "Subsection " << demangle(p->first) - << "}" << std::endl - << "\\begin{itemize}" - << std::endl; - break; + { + out << std::endl + << "\\subsection{Parameters in section \\tt "; + + // find the path to the + // current section so that we + // can print it in the + // \subsection{...} heading + for (unsigned int i=0; ifirst); + + out << "}" << std::endl + << std::endl; + break; + } + default: Assert (false, ExcNotImplemented()); }; @@ -1918,8 +1933,6 @@ ParameterHandler::print_parameters_section (std::ostream &out, << "end" << std::endl; break; case LaTeX: - out << "\\end{itemize}" - << std::endl; break; default: Assert (false, ExcNotImplemented());