diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m index b696a305e2af5f3e8830740fec081623403bb6a9..4e46ea97f88fe45c069e6fa4b3a045aeb279c0f2 100644 --- a/matlab/reporting/@graph/createGraph.m +++ b/matlab/reporting/@graph/createGraph.m @@ -3,10 +3,10 @@ function o = createGraph(o) % Create the graph % % INPUTS -% none +% o - Graph Object % % OUTPUTS -% none +% o - Graph Object % % SPECIAL REQUIREMENTS % none @@ -37,9 +37,14 @@ end %o = readConfig(o); +disp('creating plot..........'); h = figure('visible','off'); hold on; box on; +if o.grid + grid on; + set(gca, 'GridLineStyle', '--'); +end %set(0, 'CurrentFigure',h); %set(h, 'PaperPositionMode', 'auto'); %set(h, 'units', 'normalized', 'outerposition', [0 0 1 1]); @@ -90,16 +95,18 @@ if ~isempty(o.ylabel) end if ~isempty(o.title) - title(['$\textbf{\large ' o.title '}$'],'Interpreter','LaTex'); + title( o.title , 'interpreter', 'none', 'FontSize', 20); end drawnow; o.figname = ['figure-' num2str(cputime) '.tex']; +disp(' converting to tex....'); matlab2tikz('filename', o.figname, ... 'showInfo', false, ... 'showWarnings', false, ... 'checkForUpdates', false); +grid off; box off; hold off; close(h); diff --git a/matlab/reporting/@graph/graph.m b/matlab/reporting/@graph/graph.m index 2d7d87c2cebc404009ff83bbdfcde4e7b887dcdf..ae98ab810f0ce7b58844acc09514fe3b23de9ede 100644 --- a/matlab/reporting/@graph/graph.m +++ b/matlab/reporting/@graph/graph.m @@ -44,6 +44,8 @@ o.data = ''; o.seriestoplot = 'all'; o.shade = ''; %{1959q1:1964q4} +o.grid = true; + o.legend = false; o.legend_location = 'SouthEast'; o.legend_orientation = 'horizontal'; diff --git a/matlab/reporting/@page/page.m b/matlab/reporting/@page/page.m index f7f1c2c453f259abaefde196e63041ebee55f226..d0dd38caef665021aa63967ed2a03eb3b7cc3419 100644 --- a/matlab/reporting/@page/page.m +++ b/matlab/reporting/@page/page.m @@ -33,6 +33,7 @@ o = struct; o.paper = ''; o.title = ''; o.orientation = ''; +o.footnote = ''; o.sections = sections(); if nargin == 1 diff --git a/matlab/reporting/@page/write.m b/matlab/reporting/@page/write.m index 4944b3d5109ced773b44842d104ee52e5ac6e4f4..9afb4ad30b4c8504bf9bc0b175d6cf4d368004de 100644 --- a/matlab/reporting/@page/write.m +++ b/matlab/reporting/@page/write.m @@ -32,8 +32,15 @@ assert(fid ~= -1); fprintf(fid, '\n%% Page Object\n'); if ~isempty(o.title) - fprintf(fid, '\\centerline{{\\Large %s}}\n', o.title); + fprintf(fid, '\\centerline{\\large\\textbf{%s}}\n', o.title); end + +if ~isempty(o.footnote) + for i=1:length(o.footnote) + fprintf(fid, '\\blfootnote{\\tiny %d. %s}', i, o.footnote{i}); + end +end + if strcmpi(o.orientation, 'landscape') fprintf(fid, '\\begin{landscape}\n') end diff --git a/matlab/reporting/@report/report.m b/matlab/reporting/@report/report.m index a045c5c88003d29d59c7dc66b107382e094d023f..0fd4de327b8ba40d11357cf7e8179842dfd81d88 100644 --- a/matlab/reporting/@report/report.m +++ b/matlab/reporting/@report/report.m @@ -34,10 +34,11 @@ o = struct; o.title = ''; o.orientation = 'portrait'; o.paper = 'a4'; -o.margin = '2cm'; +o.margin = '2.5cm'; o.pages = pages(); o.filename = 'report.tex'; o.config = ''; +o.showdate = true; if nargin == 1 assert(isa(varargin{1}, 'report'),['With one arg to Report constructor, ' ... diff --git a/matlab/reporting/@report/write.m b/matlab/reporting/@report/write.m index 6b686c662e2b0ef1554bd2491d750622523fe637..0caab5df55a154b428e728bf90d8aae297f43bbb 100644 --- a/matlab/reporting/@report/write.m +++ b/matlab/reporting/@report/write.m @@ -41,10 +41,18 @@ if strcmpi(o.orientation, 'landscape') fprintf(fid, ',landscape'); end fprintf(fid, ']{geometry}\n'); -fprintf(fid, '\\usepackage{graphicx}\n'); -fprintf(fid, '\\usepackage{pdflscape}\n'); -fprintf(fid, '\\usepackage{pgf}\n'); -fprintf(fid, '\\usepackage{pgfplots}\n'); +fprintf(fid, '\\usepackage{graphicx, pdflscape, pgf, pgfplots}\n'); +fprintf(fid, ['\\makeatletter\n' ... + '\\def\\blfootnote{\\gdef\\@thefnmark{}\\@footnotetext}\n' ... + '\\makeatother\n']); +if o.showdate + fprintf(fid, '\\usepackage{fancyhdr, datetime}\n'); + fprintf(fid, '\\newdateformat{reportdate}{\\THEDAY\\ \\shortmonthname\\ \\THEYEAR}\n'); + fprintf(fid, '\\pagestyle{fancy}\n'); + fprintf(fid, '\\renewcommand{\\headrulewidth}{0pt}\n'); + fprintf(fid, '\\renewcommand{\\footrulewidth}{0.5pt}\n'); + fprintf(fid, '\\rfoot{\\scriptsize\\reportdate\\today\\ -- \\currenttime}\n'); +end fprintf(fid, '\\begin{document}\n'); o.pages.write(fid);