Commit 3e9e35af authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: allow for manual height adjustment of sections

parent 321eecad
......@@ -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');
......
......@@ -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');
......
......@@ -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');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment