7 std::vector< std::string >
header;
8 std::vector< std::vector< std::string > >
rows;
32 void AddFigureRow( std::vector<std::string> figure,
33 std::vector<std::string>
caption,
34 std::vector<std::string>
label);
39 void AddTable(
Table table,
bool drawnow=
false,
bool makecsv=
true );
74 fTex <<
"\n\\newpage\n";
87 fTex <<
"\\end{document}\n";
99 std::vector<std::string>
caption,
100 std::vector<std::string>
label)
102 unsigned short nfig = figure.size();
103 if( nfig!= caption.size() ){
105 if( nfig!= label.size() ){
109 if (nfig==1) size = 0.2;
110 else if(nfig==2) size = 0.49;
111 else if(nfig==3) size = 0.32;
112 else if(nfig==4) size = 0.24;
115 fTex <<
"\\begin{figure}[h!]\n";
119 fTex <<
"\\centering\n";
120 fTex <<
" \\includegraphics[height="<<size<<
"\\linewidth]{" << figure[0] <<
".pdf}\n";
122 fTex <<
" \\caption{" << caption[0] <<
"}\n";
124 fTex <<
" \\label{fig:"<< label[0] <<
"}\n";
128 for(
unsigned short f=0;
f<nfig;
f++){
129 fTex <<
" \\begin{subfigure}{"<<size<<
"\\textwidth}\n";
130 fTex <<
" \\includegraphics[width=\\linewidth]{" << figure[
f] <<
".pdf}\n";
132 fTex <<
" \\caption{" << caption[
f] <<
"}\n";
134 fTex <<
" \\label{fig:"<< label[
f] <<
"}\n";
135 fTex <<
" \\end{subfigure}\n";
142 fTex <<
"\\end{figure}\n";
151 fTex <<
"\\section{"+name+
"}\n\n";
155 fTex <<
"\\section*{"+name+
"}\n\n";
159 fTex <<
"\\subsection{"+name+
"}\n\n";
163 fTex <<
"\\subsection*{"+name+
"}\n\n";
167 fTex <<
"\n\\newpage\n";
176 fTex <<
"\\documentclass[12pt]{article}\n";
178 fTex <<
"\\usepackage[utf8]{inputenc}\n";
179 fTex <<
"\\usepackage{graphicx}\n";
180 fTex <<
"\\usepackage{caption}\n";
181 fTex <<
"\\usepackage{subcaption}\n";
182 fTex <<
"\\usepackage[dvipsnames,table]{xcolor}\n";
183 fTex <<
"\\usepackage[a4paper, margin=1.5cm]{geometry}\n";
184 fTex <<
"\\usepackage{fancyhdr}\n";
185 fTex <<
"\\usepackage[colorlinks=true]{hyperref}\n";
187 fTex <<
"\\newcommand{\\mycolor}{WildStrawberry}\n";
188 fTex <<
"\\newcommand{\\myhighlightA}{Goldenrod!30!white}\n";
189 fTex <<
"\\newcommand{\\myhighlightB}{Apricot!50!white}\n";
190 fTex <<
"\\newcommand{\\myhighlightC}{Rhodamine!30!white}\n";
192 fTex <<
"\\pagestyle{fancy}\n";
193 fTex <<
"\\rhead{\\nouppercase{\\leftmark}}\n";
195 fTex <<
"\\usepackage{etoolbox}\n";
196 fTex <<
"\\renewcommand{\\headrulewidth}{1pt}\n";
197 fTex <<
"\\fancyhead[CO,CE]{\\hyperlink{toc}{Back To Top}}\n";
198 fTex <<
"%\\fancyhead[LO,LE]{\\hyperlink{sec}{Section Top}}\n";
200 fTex <<
"\\makeatletter";
201 fTex <<
"\\patchcmd{\\@fancyhead}{\\rlap}{\\color{\\mycolor!60!white}\\rlap}{}{}\n";
202 fTex <<
"\\patchcmd{\\headrule}{\\hrule}{\\color{\\mycolor!60!white}\\hrule}{}{}\n";
203 fTex <<
"\\patchcmd{\\@fancyfoot}{\\rlap}{\\color{\\mycolor!60!white}\\rlap}{}{}\n";
204 fTex <<
"\\patchcmd{\\footrule}{\\hrule}{\\color{\\mycolor!60!white}\\hrule}{}{}\n";
205 fTex <<
"\\makeatother";
206 fTex <<
"\\usepackage{sectsty}\n";
207 fTex <<
"\\allsectionsfont{\\color{\\mycolor}\\bfseries}\n";
208 fTex <<
"\\usepackage{longtable}\n";
210 fTex <<
"\\hypersetup{linkcolor=black}\n";
212 fTex <<
"\\usepackage{geometry}\n";
213 fTex <<
"\\geometry{headheight=15pt}\n";
215 fTex <<
"\\setlength{\\intextsep}{0.005\\textheight}\n";
218 fTex <<
"\\begin{document}\n\n";
221 fTex <<
"\\title{\\textcolor{\\mycolor}{\\bf " <<
fTitle <<
"}}\n";
223 fTex <<
"\\date{\\today}\n\n";
225 fTex <<
"\\maketitle\n\n";
227 fTex <<
"\\begin{abstract}\n";
229 fTex <<
"\\end{abstract}\n\n";
231 fTex <<
"\\tableofcontents\n\n";
248 ofstream csv (Form(
"%s/%s",
254 for(
size_t i=0;
i<table.
header.size();
i++){
256 if(
i!=table.
header.size()-1) csv <<
",";
261 for(
size_t c=0;
c<
row.size();
c++ ){
263 if(
c!=row.size()-1) csv <<
",";
287 for(
auto&
cell : tab.
header) tabulararg +=
"c|";
289 fTex <<
"\\begin{center}\n";
290 fTex <<
"\\begin{table}[h!]\n";
291 fTex <<
"\\begin{tabular}{ " << tabulararg <<
"}\n\n";
294 for(
size_t c=0;
c<tab.
header.size();
c++ ){
296 std::replace( head.begin(), head.end(),
'_',
' ');
298 fTex << head <<
" & ";
304 for(
size_t c=0;
c<
row.size();
c++ ){
306 std::replace( cell.begin(), cell.end(),
'_',
' ');
308 fTex << cell <<
" & ";
315 fTex <<
"\\end{tabular}\n";
318 fTex <<
"\\label{tab:" << tab.
name <<
"}\n";
319 fTex <<
"\\end{table}\n";
320 fTex <<
"\\end{center}\n\n";
std::vector< std::string > header
void AddTable(Table table, bool drawnow=false, bool makecsv=true)
void DrawTable(std::string tabname)
TexBuilder(std::string filename, std::string title, std::string authors, std::string abstract)
void AddText(std::string text)
Eigen::Matrix< T, Eigen::Dynamic, 1 > head(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t n)
std::vector< std::vector< std::string > > rows
std::map< std::string, Table > fTables
void SubSectionNoNum(std::string subsecname)
void SectionNoNum(std::string secname)
void Section(std::string secname)
void SubSection(std::string subsecname)
void AddFigureRow(std::vector< std::string > figure, std::vector< std::string > caption, std::vector< std::string > label)