Commit 8c32ea69 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

when latex option is passed, write page to its own file and include it in the report

parent 3cc756ee
......@@ -38,6 +38,8 @@ o.titleTruncate = '';
o.orientation = '';
o.footnote = {};
o.sections = {};
o.pageDirName = 'tmpRepDir';
o.latex = '';
if nargin == 1
......@@ -82,6 +84,7 @@ assert(iscellstr(o.titleFormat), ...
assert((ischar(o.titleTruncate) && isempty(o.titleTruncate)) || ...
isint(o.titleTruncate), ...
'@page.page: titleTruncate must be empty or an integer.');
assert(ischar(o.pageDirName), '@page.page: pageDirName must be a string');
assert(ischar(o.latex), ...
'@page.page: latex must be a string');
valid_paper = {'a4', 'letter'};
......
......@@ -43,7 +43,19 @@ end
fprintf(fid,'\n');
if ~isempty(o.latex)
fprintf(fid, '%s', o.latex);
if ~exist(o.pageDirName, 'dir')
mkdir(o.pageDirName)
end
pagename = [o.pageDirName filesep 'page_' num2str(pg) '.tex'];
[fidp, msg] = fopen(pagename, 'w');
if fidp == -1
error(['@page.write: ' msg]);
end
fprintf(fidp, '%s', o.latex);
if fclose(fidp) == -1
error('@page.write: closing %s\n', pagename);
end
fprintf(fid, '\\input{%s}', pagename);
else
fprintf(fid, '\\begin{tabular}[t]{c}\n');
for i=1:length(o.title)
......
Markdown is supported
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