From 9a4f9203b64a320e145316742db4712c8af7c08c Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Sun, 9 Oct 2011 18:24:39 +0200 Subject: [PATCH] write Latex model: added automatic line breaks with breqn Latex package --- ModelTree.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ModelTree.cc b/ModelTree.cc index 0fcd062e..807d0623 100644 --- a/ModelTree.cc +++ b/ModelTree.cc @@ -1327,6 +1327,7 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output output << "\\documentclass[10pt,a4paper]{article}" << endl << "\\usepackage[landscape]{geometry}" << endl << "\\usepackage{fullpage}" << endl + << "\\usepackage{breqn}" << endl << "\\begin{document}" << endl << "\\footnotesize" << endl; @@ -1337,20 +1338,20 @@ ModelTree::writeLatexModelFile(const string &filename, ExprNodeOutputType output int id = it->first; expr_t value = it->second; - output << "\\begin{equation*}" << endl + output << "\\begin{dmath*}" << endl << symbol_table.getName(id) << " = "; // Use an empty set for the temporary terms value->writeOutput(output, output_type); - output << endl << "\\end{equation*}" << endl; + output << endl << "\\end{dmath*}" << endl; } for (int eq = 0; eq < (int) equations.size(); eq++) { - output << "\\begin{equation}" << endl + output << "\\begin{dmath}" << endl << "% Equation " << eq+1 << endl; // Here it is necessary to cast to superclass ExprNode, otherwise the overloaded writeOutput() method is not found dynamic_cast(equations[eq])->writeOutput(output, output_type); - output << endl << "\\end{equation}" << endl; + output << endl << "\\end{dmath}" << endl; } output << "\\end{document}" << endl;