20 parser.
setExampleShortOption(
"phoenix_beamercreator -i fileInput1.png fileInput2.png fileInput3.png fileInput4.png -o output.tex");
24 PString defaultOutput(
"output.tex");
25 parser.
addOption(
"output",
"o", defaultOutput,
"name of the output tex file");
30 parser.
addOption(
"numbercolor",
"n", defaultColor,
"color of the slides' number (black, white, blue, green, red, yellow, gray(by default))");
32 PString defaultTextFootpage(
"black");
33 parser.
addOption(
"footpage",
"f", defaultTextFootpage,
"text to be written on the foot page");
35 PString defaultFootpageColor(
"white");
36 parser.
addOption(
"footpagecolor",
"g", defaultFootpageColor,
"color of the foot page (black, white, blue, green, red, yellow, white(by default))");
47 fs <<
"\\documentclass[hyperref={ bookmarks=false, pdftoolbar=false, pdfmenubar=false, pdftitle={Titre}, pdfauthor={Pierre Aubert}}, french, 9pt, aspectratio=169]{beamer}" << std::endl;
49 fs <<
"\\documentclass[hyperref={ bookmarks=false, pdftoolbar=false, pdfmenubar=false, pdftitle={Titre}, pdfauthor={Pierre Aubert}}, french, 9pt]{beamer}" << std::endl;
51 fs <<
"\\setbeamertemplate{footline}{}" << std::endl;
52 fs <<
"\\setbeamertemplate{headline}{}" << std::endl;
53 fs <<
"%To have textblock" << std::endl;
54 fs <<
"\\usepackage[absolute,overlay]{textpos}" << std::endl;
56 fs <<
"\\usepackage{calc}\n\n\n\\usepackage{amssymb}\n\\usepackage{color}\n\\usepackage{amsfonts}\n\\usepackage{bbm}\n\\pagestyle{empty}\n\n\n";
57 fs <<
"\\usepackage{amsmath}\n\\usepackage{esint}\n\n";
58 fs <<
"\\usepackage{multirow}" << std::endl;
59 fs <<
"\\beamertemplatenavigationsymbolsempty" << std::endl;
60 fs <<
"\\beamertemplatetransparentcovered" << std::endl;
62 fs <<
"% marges qui pourissent l'existence pour les alignements" << std::endl;
63 fs <<
"\\setbeamersize{text margin left=0.0cm}" << std::endl;
64 fs <<
"\\setbeamersize{text margin right=0.0cm}" << std::endl;
66 fs <<
"\\newcommand{\\R}{\\mathbb{R}}" << std::endl;
67 fs <<
"\\newcommand{\\N}{\\mathbb{N}}" << std::endl;
68 fs <<
"\\newcommand{\\Z}{\\mathbb{Z}}" << std::endl;
69 fs <<
"\\newcommand{\\C}{\\mathbb{C}}" << std::endl;
70 fs <<
"\\newcommand{\\Q}{\\mathbb{Q}}" << std::endl;
71 fs <<
"\\newcommand{\\M}{\\mathbb{M}}" << std::endl;
72 fs <<
"\\newcommand{\\normal}{\\mathcal{N}}" << std::endl;
73 fs <<
"\\newcommand{\\uniform}{\\mathcal{U}}" << std::endl;
74 fs <<
"\\newcommand{\\A}{\\mathcal{A}}" << std::endl;
75 fs <<
"\\renewcommand{\\b}[1]{\\textbf{#1}}" << std::endl;
86 fs <<
"\\pgfdeclareimage[height=90mm, interpolate=true]{slide"<<slideNumber<<
"}{"<<filePng<<
"}" << std::endl;
88 fs <<
"\\pgfdeclareimage[height=96mm,width=128mm]{slide"<<slideNumber<<
"}{"<<filePng<<
"}" << std::endl;
90 fs <<
"\\setbeamertemplate{background}{\\pgfuseimage{slide"<<slideNumber<<
"}}" << std::endl;
103 if(slideNumber != 0lu){
105 fs <<
"\t\\begin{textblock*}{0.9\\textwidth}(0.01\\textwidth,0.97\\textheight)" << std::endl;
106 fs <<
"\t\t\\large{\\color{"<<footPageColor<<
"} " << footPage <<
"}" << std::endl;
107 fs <<
"\t\\end{textblock*}" << std::endl;
109 fs <<
"\t\\begin{textblock*}{0.1\\textwidth}(0.960\\textwidth,0.98\\textheight)" << std::endl;
110 fs <<
"\t\t\\textbf{\\Large{\\color{"<<numberColor<<
"} " << (slideNumber + 1lu) <<
"}}" << std::endl;
111 fs <<
"\t\\end{textblock*}" << std::endl;
127 PPath backGroundFile(CMAKE_INSTALL_PREFIX
"/share/BeamerCreator/theme2.png");
128 if(slideNumber == 0){
129 backGroundFile =
PPath(CMAKE_INSTALL_PREFIX
"/share/BeamerCreator/firstTheme.png");
133 fs <<
"\\frame{"<<std::endl;
136 fs <<
"}" << std::endl << std::endl;
154 fs <<
"\\frame{"<<std::endl;
156 fs <<
"}" << std::endl << std::endl;
176 if(fileExtention ==
"png"){
177 saveBeamerSlidePng(fs, filePng, slideNumber, want169, numberColor, footPage, footPageColor);
178 }
else if(fileExtention ==
"tex"){
179 saveBeamerSlideTex(fs, filePng, slideNumber, want169, numberColor, footPage, footPageColor);
181 std::cerr <<
"saveBeamerSlide : unknown extention '"<<fileExtention<<
"' of file '"<<filePng<<
"'" << std::endl;
196 if(outputFileName ==
"" || listInputFile.size() == 0lu){
return;}
199 fs.open(outputFileName.c_str());
201 std::cerr <<
"makeTexSlides : can't open file '" << outputFileName <<
"'" << std::endl;
206 fs <<
"\\begin{document}" << std::endl;
208 long unsigned int i(-1lu);
209 for(std::vector<PPath>::const_iterator it(listInputFile.begin()); it != listInputFile.end(); ++it){
210 PPath currentFileName(it->getFileName());
212 if(previousFile.size() < 6lu || currentFileName.size() < 6lu){
215 if(previousFile.substr(0, previousFile.size() - 6lu) != currentFileName.substr(0, currentFileName.size() - 6lu)){
219 previousFile = currentFileName;
220 saveBeamerSlide(fs, *it, i, want169, numberColor, footPage, footPageColor);
223 fs <<
"\\end{document}" << std::endl;
228 int main(
int argc,
char** argv){
233 std::vector<PPath> listInputFile;
234 defaultMode.
getValue(listInputFile,
"input");
236 PString outputFile(
"output.tex");
237 defaultMode.
getValue(outputFile,
"output");
240 defaultMode.
getValue(numberColor,
"numbercolor");
243 defaultMode.
getValue(footPage,
"footpage");
245 PString footPageColor(
"white");
246 defaultMode.
getValue(footPageColor,
"footpagecolor");
249 makeTexSlides(outputFile, listInputFile, is169, numberColor, footPage, footPageColor);
void saveBeamerSlideNumber(std::ofstream &fs, long unsigned int slideNumber, const PString &numberColor, const PString &footPage, const PString &footPageColor)
Save the beamer slide number.
void saveBeamerSlidePng(std::ofstream &fs, const PPath &filePng, long unsigned int slideNumber, bool want169, const PString &numberColor, const PString &footPage, const PString &footPageColor)
Make the beamer tex slide.
int main(int argc, char **argv)
void saveBeamerSlide(std::ofstream &fs, const PPath &filePng, long unsigned int slideNumber, bool want169, const PString &numberColor, const PString &footPage, const PString &footPageColor)
Make the beamer tex slide.
void saveBeamerBackground(std::ofstream &fs, const PPath &filePng, long unsigned int slideNumber, bool want169)
Save the beamer background.
void saveBeamerSlideTex(std::ofstream &fs, const PPath &fileTex, long unsigned int slideNumber, bool want169, const PString &numberColor, const PString &footPage, const PString &footPageColor)
Save the beamer slide with a tex file.
void saveBeamerHeaderTex(std::ofstream &fs, bool want169)
Make the beamer tex header.
void makeTexSlides(const PPath &outputFileName, const std::vector< PPath > &listInputFile, bool want169, const PString &numberColor, const PString &footPage, const PString &footPageColor)
Make the tex slides.
OptionParser createOptionParser()
Create the OptionParser of this program.
Describe a mode in the program arguments.
bool isOptionExist(const PString &optionName) const
Say if the given option has been passed to the program.
bool getValue(T &value, const PString &optionName) const
Get the value of the option.
Parse the options passed to a program.
void parseArgument(int argc, char **argv)
Parse the arguments passed to the program.
void addOption(const PString &longOption, const PString &shortOption, OptionType::OptionType optionType, bool isRequired, const PString &docString)
Add an option in the OptionParser.
void setExampleShortOption(const PString &example)
Set the example usage of the program.
void setExampleLongOption(const PString &example)
Set the example usage of the program.
const OptionMode & getDefaultMode() const
Get default mode.
Path of a directory or a file.
PString getExtension() const
Get file extension.
PString loadFileContent() const
Get the file content in a PString.