Commit 66915426 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: add titleTruncate option

parent 05d9d8be
......@@ -12,7 +12,7 @@ function o = page(varargin)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-2014 Dynare Team
% Copyright (C) 2013-2015 Dynare Team
%
% This file is part of Dynare.
%
......@@ -34,6 +34,7 @@ o.paper = '';
o.title = {''};
titleFormatDefalut = {'\large\bfseries'};
o.titleFormat = titleFormatDefalut;
o.titleTruncate = '';
o.orientation = '';
o.footnote = {};
o.sections = {};
......@@ -77,6 +78,9 @@ assert(iscellstr(o.title), ...
'@page.page: title must be a cell array of strings');
assert(iscellstr(o.titleFormat), ...
'@page.page: titleFormat must be a cell array of strings');
assert((ischar(o.titleTruncate) && isempty(o.titleTruncate)) || ...
isint(o.titleTruncate), ...
'@page.page: titleTruncate must be empty or an integer.');
valid_paper = {'a4', 'letter'};
assert(any(strcmp(o.paper, valid_paper)), ...
......
......@@ -13,7 +13,7 @@ function o = write(o, fid, pg)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2013-2014 Dynare Team
% Copyright (C) 2013-2015 Dynare Team
%
% This file is part of Dynare.
%
......@@ -44,6 +44,11 @@ fprintf(fid,'\n');
fprintf(fid, '\\begin{tabular}[t]{c}\n');
for i=1:length(o.title)
if isint(o.titleTruncate)
if length(o.title{i}) > o.titleTruncate
o.title{i} = o.title{i}(1:o.titleTruncate);
end
end
fprintf(fid,'\\multicolumn{1}{c}{%s %s}\\\\\n', o.titleFormat{i}, o.title{i});
end
......
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