diff --git a/doc/dynare.texi b/doc/dynare.texi index 9a911c4ece9972edd75d81c9f78c204fd81eacac..d5af326c9b86a9b92eff21a56427392a89978c16 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -10687,9 +10687,10 @@ of the page. Default: @code{none} @anchor{titleFormat} @item titleFormat, @code{STRING} | @code{CELL_ARRAY_STRINGS} -A string representing the @LaTeX{} markup to use on -@ref{title}. The number of cell array entries must be equal to that of -the @ref{title} option. Default: @code{\large\bfseries} +A string representing the @LaTeX{} markup to use on @ref{title}. The +number of cell array entries must be equal to that of the @ref{title} +option, if you do not want to use the default value for the title and +subtitle(s). Default: @code{\large\bfseries} @end table @end defmethod diff --git a/matlab/reports/@page/page.m b/matlab/reports/@page/page.m index 28c1f8000919885140f5d5fec2b2987580e5273d..7bcc26c5d748f75c7c28ef732676394d97088d30 100644 --- a/matlab/reports/@page/page.m +++ b/matlab/reports/@page/page.m @@ -32,7 +32,8 @@ function o = page(varargin) o = struct; o.paper = ''; o.title = {''}; -o.titleFormat = {'\large\bfseries'}; +titleFormatDefalut = {'\large\bfseries'}; +o.titleFormat = titleFormatDefalut; o.orientation = ''; o.footnote = {}; o.sections = {}; @@ -69,12 +70,13 @@ end if ischar(o.titleFormat) o.titleFormat = {o.titleFormat}; end +if length(o.title) ~= length(o.titleFormat) + o.titleFormat = repmat(titleFormatDefalut, 1, length(o.title)); +end 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(length(o.title)==length(o.titleFormat), ... - '@page.page: title and titleFormat must be of the same length'); valid_paper = {'a4', 'letter'}; assert(any(strcmp(o.paper, valid_paper)), ... diff --git a/matlab/reports/@report_table/report_table.m b/matlab/reports/@report_table/report_table.m index 12df17010f2df1f83ecd2b104692dcb7e517e319..79e77cdc5336617f943bb026188bc914ea91b318 100644 --- a/matlab/reports/@report_table/report_table.m +++ b/matlab/reports/@report_table/report_table.m @@ -34,7 +34,8 @@ o = struct; o.series = {}; o.title = {''}; -o.titleFormat = {'\large'}; +titleFormatDefalut = {'\large'}; +o.titleFormat = titleFormatDefalut; o.showHlines = false; o.showVlines = false; @@ -85,6 +86,9 @@ end if ischar(o.titleFormat) o.titleFormat = {o.titleFormat}; end +if length(o.title) ~= length(o.titleFormat) + o.titleFormat = repmat(titleFormatDefalut, 1, length(o.title)); +end assert(islogical(o.showHlines), '@report_table.report_table: showHlines must be true or false'); assert(islogical(o.showVlines), '@report_table.report_table: showVlines must be true or false'); assert(isint(o.precision), '@report_table.report_table: precision must be an int'); @@ -106,8 +110,6 @@ assert(iscellstr(o.title), ... '@report_table.report_table: title must be a cell array of string(s)'); assert(iscellstr(o.titleFormat), ... '@report_table.report_table: titleFormat must be a cell array of string(s)'); -assert(length(o.title) == length(o.titleFormat), ... - '@report_table.report_table: title and titleFormat must have the same length'); % using o.seriesToUse, create series objects and put them in o.series if ~isempty(o.data) diff --git a/tests/reporting/runDynareReport.m b/tests/reporting/runDynareReport.m index d7b5e67bc50d8e2def6519e2486654736c295c76..7ae2f11246c0726df8d1e018968c1c57f7712387 100644 --- a/tests/reporting/runDynareReport.m +++ b/tests/reporting/runDynareReport.m @@ -43,7 +43,6 @@ rep = rep.addVspace(); % Table 1 rep = rep.addTable('title', {'Real GDP Growth','subtitle 1', 'subtitle 2'}, ... - 'titleFormat', {'\large\bfseries','\small\bfseries','\tiny'}, ... 'range', larange, ... 'vlineAfter', dates('2011y')); rep = AnnualTable(rep, db_a, dc_a, 'PCH_GROWTH4_', larange);