allow user to set page number. closes #14

parent 74ae5c4a
......@@ -32,6 +32,7 @@ classdef page < handle
footnote = {} % A footnote to be included at the bottom of this page. Default: none.
pageDirName = 'tmpRepDir' % The name of the folder in which to store this page. Only used when the latex command is passed. Default: tmpRepDir.
latex = '' % The valid LATEX code to be used for this page. Alows the user to create a page to be included in the report by passing LATEX code directly. Default: empty.
setPageNumber = '' % If true, reset the page number counter. Default: false.
function o = page(varargin)
......@@ -111,6 +112,8 @@ classdef page < handle
' footnote must be a cell array of string(s)');
assert(isempty(o.sections), ...
' sections is not a valid option');
assert(isempty(o.setPageNumber) || isint(o.setPageNumber), ...
' setPageNumber must be an integer');
methods (Hidden = true)
......@@ -32,6 +32,9 @@ function write(o, fid, pg, rep_dir)
% along with Dynare. If not, see <>.
fprintf(fid, '\n%% Page Number %d written %s\n', pg, datestr(now));
if ~isempty(o.setPageNumber)
fprintf(fid, '\\setcounter{page}{%d}\n', o.setPageNumber);
if strcmpi(o.orientation, 'landscape')
fprintf(fid, '\\begin{landscape}\n');
......@@ -200,7 +200,8 @@ rep.addSeries('graphVline', dates('2009q2'), ...
% Page 25
rep.addPage('title', {'Jan1 vs Jan2', 'World Oil and Food Prices'}, ...
'titleFormat', {'\large\bfseries', '\large'});
'titleFormat', {'\large\bfseries', '\large'}, ...
'setPageNumber', 90);
rep.addSection('cols', 1);
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ...
'cols', 2, ...
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment