From 49586d0b5473f7727958d4d2e4ca34f0f0cef064 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 19 Mar 2013 14:09:20 +0100 Subject: [PATCH] reporting: add centering --- matlab/reports/@report/write.m | 1 + matlab/reports/@section/write.m | 7 ++----- matlab/reports/@table/write.m | 5 +++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/matlab/reports/@report/write.m b/matlab/reports/@report/write.m index e247c2557..80cc20ab5 100644 --- a/matlab/reports/@report/write.m +++ b/matlab/reports/@report/write.m @@ -60,6 +60,7 @@ fprintf(fid, '\\renewcommand{\\topfraction}{0.8}\n'); fprintf(fid, '\\renewcommand{\\bottomfraction}{0.8}\n'); fprintf(fid, '\\usepackage[Export,PGF]{adjustbox}\n'); fprintf(fid, '\\begin{document}\n'); +fprintf(fid, '\\centering\n'); o.pages.write(fid); diff --git a/matlab/reports/@section/write.m b/matlab/reports/@section/write.m index be439c43e..4b79eaeac 100644 --- a/matlab/reports/@section/write.m +++ b/matlab/reports/@section/write.m @@ -32,11 +32,10 @@ assert(fid ~= -1); fprintf(fid, '%% Section Object\n'); fprintf(fid, ' \\vspace{15px}\n'); -fprintf(fid, '\\centering\n'); fprintf(fid, '\\noindent\\maxsizebox{\\textwidth}{!}{%%\n'); fprintf(fid, '\\begin{tabular}[t]{'); for i=1:o.cols - fprintf(fid, 'c'); + fprintf(fid, '@{\\hspace*{-3pt}}c@{}'); end fprintf(fid, '}\n'); ne = numElements(o); @@ -48,8 +47,6 @@ for i=1:ne fprintf(fid, ' \\\\\n'); end end - -fprintf(fid, '\\end{tabular}%%\n'); -fprintf(fid, '}%%\n'); +fprintf(fid, '\\end{tabular}}%%\n'); fprintf(fid, '%% End Section Object\n\n'); end \ No newline at end of file diff --git a/matlab/reports/@table/write.m b/matlab/reports/@table/write.m index dcaebc3bc..63d691c65 100644 --- a/matlab/reports/@table/write.m +++ b/matlab/reports/@table/write.m @@ -48,7 +48,7 @@ end nlhc = 1; disp('creating table.........'); -fprintf(fid, '{%% Table Object\n'); +fprintf(fid, '%% Table Object\n'); fprintf(fid, '\\begin{tabular}{l'); dates = ds.time; @@ -130,6 +130,7 @@ for i=1:nvars end fprintf(fid, '\\bottomrule%%\n'); -fprintf(fid, '\\end{tabular}}%%\n'); +fprintf(fid, '\\end{tabular}%%\n\n'); +fprintf(fid, '\\medskip\\par\n\n'); fprintf(fid, '%% End Table Object\n'); end