From f537a06fc0dc22be61ceef6d237466d0bfe9eaa2 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Mon, 19 May 2014 17:22:29 +0200
Subject: [PATCH] reporting: allow vspaces when section is not complete
 (implies that section is over)

---
 @section/write.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/@section/write.m b/@section/write.m
index 7a9808e..f410735 100644
--- a/@section/write.m
+++ b/@section/write.m
@@ -54,11 +54,13 @@ row = 1;
 col = 1;
 for i=1:ne
     if isa(o.elements{i}, 'vspace')
-        assert(col == o.cols, ['@section.write: must place ' ...
-                            'vspace command after a linebreak in the table ' ...
-                            'or series of charts']);
         o.elements{i}.write(fid);
         fprintf(fid, '\\\\\n');
+        if col ~= o.cols
+            fprintf(fid, '\\end{tabular}}\\\\\n');
+            fprintf(fid, '%% End Section Object\n\n');
+            return;
+        end
     else
         o.elements{i}.write(fid, pg, sec, row, col);
         if col ~= o.cols
-- 
GitLab