PhoenixLecture  2.0.0
Set of tools to make lectures
pspeaker_tex.cpp
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #include "platexobj_create.h"
8 #include "platexobj_parse.h"
9 #include "platexobj_utils.h"
10 #include "pspeaker_tex.h"
11 
12 
14 
17 void pspeaker_texSpeaker(std::vector<PLatexObj> & vecContent, const PLatexSpeaker & speaker){
18  vecContent.push_back(platexobj_createSection(PLatexType::SECTION, speaker.getName(), "speaker_"+speaker.getLabel()));
19  vecContent.push_back(platexobj_createTextBf("Speaker : ", ""));
20  if(speaker.getTitle().getVecContent().size() != 0lu){
21  appendVecContent(vecContent, speaker.getTitle().getVecContent());
22  vecContent.push_back(platexobj_createText(" ", ""));
23  }
24  appendVecContent(vecContent, speaker.getName().getVecContent());
25  if(speaker.getAffiliation().getVecContent().size() != 0lu){
26  vecContent.push_back(platexobj_createNewLine());
27  vecContent.push_back(platexobj_createTextBf("Affiliation : ", ""));
28  vecContent.push_back(platexobj_createText(" (", ""));
29  appendVecContent(vecContent, speaker.getAffiliation().getVecContent());
30  vecContent.push_back(platexobj_createText(") ", ""));
31  }
32  if(speaker.getJob().getVecContent().size() != 0lu){
33  vecContent.push_back(platexobj_createNewLine());
34  vecContent.push_back(platexobj_createTextBf("Function : ", ""));
35  appendVecContent(vecContent, speaker.getJob().getVecContent());
36  }
37  if(speaker.getDescription().getVecContent().size() != 0lu){
38  vecContent.push_back(platexobj_createNewLine());
40  bio.getVecContent().push_back(platexobj_createTextBf("Bio : ", ""));
41  bio.getVecContent().push_back(platexobj_createNewLine());
43  vecContent.push_back(bio);
44  }
45 }
46 
47 
49 
53 void pspeaker_tex(std::vector<PLatexObj> & vecContent, const std::vector<PLatexSpeaker> & vecSpeaker, const PString & sectionLabel){
54  if(vecSpeaker.size() == 0lu){return;} //If there is not speakers we do not create chapter for that
55  vecContent.push_back(platexobj_createSection(PLatexType::CHAPTER, platexobj_parseStr("Speakers"), sectionLabel));
56  vecContent.push_back(platexobj_createText("Here you can find all speakers of the timetable.", ""));
57  for(std::vector<PLatexSpeaker>::const_iterator it(vecSpeaker.begin()); it != vecSpeaker.end(); ++it){
58  pspeaker_texSpeaker(vecContent, *it);
59  }
60 }
61 
63 
66 void pspeaker_tex(std::vector<PLatexObj> & vecContent, const PTimeTable & timetable){
67  const std::vector<PLatexSpeaker> & vecSpeaker = timetable.getVecSpeaker();
68  pspeaker_tex(vecContent, vecSpeaker, "sec_speaker_"+timetable.getInvitation());
69 }
70 
Describe a latex object.
Definition: PLatexObj.h:40
const std::vector< PLatexObj > & getVecContent() const
Gets the vecContent of the PLatexObj.
Definition: PLatexObj.cpp:410
Describe a speaker in a timetable.
Definition: PTimeTable.h:15
const PLatexObj & getTitle() const
Gets the title of the PLatexSpeaker.
Definition: PTimeTable.cpp:97
const PLatexObj & getName() const
Gets the name of the PLatexSpeaker.
Definition: PTimeTable.cpp:83
const PString & getLabel() const
Gets the label of the PLatexSpeaker.
Definition: PTimeTable.cpp:111
const PLatexObj & getAffiliation() const
Gets the affiliation of the PLatexSpeaker.
Definition: PTimeTable.cpp:139
const PLatexObj & getDescription() const
Gets the description of the PLatexSpeaker.
Definition: PTimeTable.cpp:153
const PLatexObj & getJob() const
Gets the job of the PLatexSpeaker.
Definition: PTimeTable.cpp:125
Extends the std::string.
Definition: PString.h:16
Timetable.
Definition: PTimeTable.h:197
const PString & getInvitation() const
Gets the invitation of the PTimeTable.
Definition: PTimeTable.cpp:859
const std::vector< PLatexSpeaker > & getVecSpeaker() const
Gets the vecSpeaker of the PTimeTable.
Definition: PTimeTable.cpp:943
PLatexObj platexobj_createNewLine()
Create a new line.
PLatexObj platexobj_createText(const PString &text, const PString &label)
Create a TEXT.
PLatexObj platexobj_createSection(PLatexType::PLatexType sectionType, const PLatexObj &complexTitle, const PString &label)
Create a part, chapter, section, subsection, subsubsection.
PLatexObj platexobj_createParagraph(const PString &text, const PString &label)
Create a PARAGRAPH.
PLatexObj platexobj_createTextBf(const PString &text, const PString &label)
Create a TEXT.
bool platexobj_parseStr(PLatexObj &obj, const PString &latexStr)
Parse a str and convert it into a PLatexObj.
void appendVecContent(std::vector< PLatexObj > &vecContent, const std::vector< PLatexObj > &vecObj)
Append a vector of PLatexObj in the given vector of content.
void pspeaker_tex(std::vector< PLatexObj > &vecContent, const std::vector< PLatexSpeaker > &vecSpeaker, const PString &sectionLabel)
Save all speakers of the given PTimeTable into a vector of PLatexObj.
void pspeaker_texSpeaker(std::vector< PLatexObj > &vecContent, const PLatexSpeaker &speaker)
Save all speakers of the given PLatexSpeaker into a vector of PLatexObj.