diff --git a/matlab/reports/@report/write.m b/matlab/reports/@report/write.m index 0c769c4a9c8b667dda763289f106173c4c16447a..d3b282ce6f7fbfe305f111e27d0d8ebf4c94efc8 100644 --- a/matlab/reports/@report/write.m +++ b/matlab/reports/@report/write.m @@ -60,6 +60,7 @@ fprintf(fid, '\\renewcommand{\\topfraction}{0.8}\n'); fprintf(fid, '\\renewcommand{\\bottomfraction}{0.8}\n'); fprintf(fid, '\\usepackage[Export,PGF]{adjustbox}\n'); fprintf(fid, '\\setlength{\\parindent}{0in}\n'); +fprintf(fid, '\\newlength\\sectionheight\n'); fprintf(fid, '\\begin{document}\n'); fprintf(fid, '\\centering\n'); diff --git a/matlab/reports/@section/section.m b/matlab/reports/@section/section.m index e7ed91db809c3b9c4131f2da3b44f4aaa0034a7c..ba2bc2662456ecb35a43f2460f378b8bd04e1f32 100644 --- a/matlab/reports/@section/section.m +++ b/matlab/reports/@section/section.m @@ -23,6 +23,7 @@ function o = section(varargin) o = struct; o.elements = elements(); o.cols = 1; +o.height = ''; if nargin == 1 assert(isa(varargin{1}, 'section'),['With one arg to Section constructor, ' ... @@ -51,6 +52,8 @@ end % Check options provided by user assert(isint(o.cols), '@section.section: cols must be an integer'); +assert(isempty(o.height) || ischar(o.height), ... + '@section.section: cols must be a string'); % Create section object o = class(o, 'section'); diff --git a/matlab/reports/@section/write.m b/matlab/reports/@section/write.m index c592b93cee56e9f4e4118771e765715e645672d6..da8c93744362cd97cc48c045af430c7786fa476d 100644 --- a/matlab/reports/@section/write.m +++ b/matlab/reports/@section/write.m @@ -31,7 +31,16 @@ function o = write(o, fid) assert(fid ~= -1); fprintf(fid, '%% Section Object\n'); -fprintf(fid, '\\maxsizebox{\\textwidth}{!}{%%\n'); +if ~isempty(o.height) + fprintf(fid, '\\setlength\\sectionheight{%s}\n', o.height); +end +fprintf(fid, '\\maxsizebox{\\textwidth}{'); +if isempty(o.height) + fprintf(fid, '!'); +else + fprintf(fid, '\\sectionheight'); +end +fprintf(fid, '}{%%\n'); fprintf(fid, '\\begin{tabular}[t]{'); for i=1:o.cols fprintf(fid, 'c');