Skip to content
Snippets Groups Projects
Commit 18de5a2b authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: add latex option to page class

parent 12d9ea21
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ o.titleTruncate = ''; ...@@ -38,6 +38,7 @@ o.titleTruncate = '';
o.orientation = ''; o.orientation = '';
o.footnote = {}; o.footnote = {};
o.sections = {}; o.sections = {};
o.latex = '';
if nargin == 1 if nargin == 1
assert(isa(varargin{1}, 'page'), ['@page.page: with one arg to Page ' ... assert(isa(varargin{1}, 'page'), ['@page.page: with one arg to Page ' ...
...@@ -81,7 +82,8 @@ assert(iscellstr(o.titleFormat), ... ...@@ -81,7 +82,8 @@ assert(iscellstr(o.titleFormat), ...
assert((ischar(o.titleTruncate) && isempty(o.titleTruncate)) || ... assert((ischar(o.titleTruncate) && isempty(o.titleTruncate)) || ...
isint(o.titleTruncate), ... isint(o.titleTruncate), ...
'@page.page: titleTruncate must be empty or an integer.'); '@page.page: titleTruncate must be empty or an integer.');
assert(ischar(o.latex), ...
'@page.page: latex must be a string');
valid_paper = {'a4', 'letter'}; valid_paper = {'a4', 'letter'};
assert(any(strcmp(o.paper, valid_paper)), ... assert(any(strcmp(o.paper, valid_paper)), ...
['@page.page: paper must be one of ' strjoin(valid_paper, ' ')]); ['@page.page: paper must be one of ' strjoin(valid_paper, ' ')]);
......
...@@ -42,6 +42,9 @@ for i=1:length(o.footnote) ...@@ -42,6 +42,9 @@ for i=1:length(o.footnote)
end end
fprintf(fid,'\n'); fprintf(fid,'\n');
if ~isempty(o.latex)
fprintf(fid, '%s', o.latex);
else
fprintf(fid, '\\begin{tabular}[t]{c}\n'); fprintf(fid, '\\begin{tabular}[t]{c}\n');
for i=1:length(o.title) for i=1:length(o.title)
if isint(o.titleTruncate) if isint(o.titleTruncate)
...@@ -56,8 +59,9 @@ nps = length(o.sections); ...@@ -56,8 +59,9 @@ nps = length(o.sections);
for i=1:nps for i=1:nps
o.sections{i}.write(fid, pg, i); o.sections{i}.write(fid, pg, i);
end end
fprintf(fid, '\\end{tabular}\n'); fprintf(fid, '\\end{tabular}\n');
end
if strcmpi(o.orientation, 'landscape') if strcmpi(o.orientation, 'landscape')
fprintf(fid, '\\end{landscape}\n'); fprintf(fid, '\\end{landscape}\n');
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment