<h3>Specific improvements</h3>
<ol>
+<li> Fixed: ParameterHandler::print_parameters, when using
+ParameterHandler::OutputStyle::LaTeX would always print a list
+of parameters in each section as a latex itemized environment.
+However, if there are none, we end up with an empty list which
+latex does not like. This is now fixed.
+<br>
+(Wolfgang Bangerth, 2012/09/27)
+
<li> New: Added BlockCompressedSimpleSparsityPattern::column_number().
<br>
(Timo Heister, 2012/09/25)
case LaTeX:
{
- out << "\\begin{itemize}"
- << std::endl;
-
- // print entries one by
- // one. make sure they are
- // sorted by using the
- // appropriate iterators
- for (boost::property_tree::ptree::const_assoc_iterator
- p = current_section.ordered_begin();
- p != current_section.not_found(); ++p)
- if (is_parameter_node (p->second) == true)
- {
- const std::string value = p->second.get<std::string>("value");
-
- // print name
- out << "\\item {\\it Parameter name:} {\\tt " << demangle(p->first) << "}\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"
- << std::endl;
-
- // if there is a
- // documenting string,
- // print it as well
- if (!p->second.get<std::string>("documentation").empty())
- out << "{\\it Description:} "
- << p->second.get<std::string>("documentation") << "\n\n"
- << std::endl;
-
- // also output possible values
- out << "{\\it Possible values:} "
- << p->second.get<std::string> ("pattern_description")
- << std::endl;
- }
- out << "\\end{itemize}" << std::endl;
+ // if there are any parameters in
+ // this section then print them as an
+ // itemized list
+ bool parameters_exist_here = false;
+ for (boost::property_tree::ptree::const_assoc_iterator
+ p = current_section.ordered_begin();
+ p != current_section.not_found(); ++p)
+ if (is_parameter_node (p->second) == true)
+ {
+ parameters_exist_here = true;
+ break;
+ }
+
+ if (parameters_exist_here)
+ {
+ out << "\\begin{itemize}"
+ << std::endl;
+
+ // print entries one by
+ // one. make sure they are
+ // sorted by using the
+ // appropriate iterators
+ for (boost::property_tree::ptree::const_assoc_iterator
+ p = current_section.ordered_begin();
+ p != current_section.not_found(); ++p)
+ if (is_parameter_node (p->second) == true)
+ {
+ const std::string value = p->second.get<std::string>("value");
+
+ // print name
+ out << "\\item {\\it Parameter name:} {\\tt " << demangle(p->first) << "}\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"
+ << std::endl;
+
+ // if there is a
+ // documenting string,
+ // print it as well
+ if (!p->second.get<std::string>("documentation").empty())
+ out << "{\\it Description:} "
+ << p->second.get<std::string>("documentation") << "\n\n"
+ << std::endl;
+
+ // also output possible values
+ out << "{\\it Possible values:} "
+ << p->second.get<std::string> ("pattern_description")
+ << std::endl;
+ }
+ out << "\\end{itemize}" << std::endl;
+ }
break;
}
--- /dev/null
+//---------------------------- parameter_handler_4b.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003, 2004, 2005, 2012 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- parameter_handler_4b.cc ---------------------------
+
+
+// test the output generated by
+// ParameterHandler::print_parameters(LaTeX). make sure that empty sections do
+// not lead to empty itemized environments in the latex output, which are not
+// valid
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/parameter_handler.h>
+#include <fstream>
+#include <iomanip>
+
+
+int main ()
+{
+ try
+ {
+ std::ofstream logfile("parameter_handler_4b/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ ParameterHandler prm;
+ prm.enter_subsection ("Testing");
+ prm.leave_subsection ();
+ prm.print_parameters (logfile, ParameterHandler::LaTeX);
+ }
+ catch (std::exception &exc)
+ {
+ deallog << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ deallog << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ deallog << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ deallog << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+
+ return 0;
+}