![]() |
PhoenixLecture
2.0.0
Set of tools to make lectures
|
#include <sys/stat.h>
#include <sys/types.h>
#include <fstream>
#include "data_all.h"
#include "convertToString.h"
#include "platexobj_menu.h"
#include "platexobj_formulae.h"
Go to the source code of this file.
Functions | |
bool | lauchLatexToPng (const PString &fileNamePng) |
Lauch latex to create png file. More... | |
PString | platexObj_createFormulaTex (POutoutMode &outputMode, size_t objId, const PString &latexEnv, const PString &texContent) |
Create an image with a latex formula. More... | |
PString | platexObj_createImageWithMathTex (size_t objId, const PString &latexEnv, const PString &texContent, const PString &fontColor) |
Create an image with a latex formula. More... | |
PString | platexobj_htmlStrInlineMath (POutoutMode &outputMode, const PLatexObj &obj) |
Convert a PLatexObj into a string. More... | |
PString | platexobj_htmlStrLatex (POutoutMode &outputMode, const PLatexObj &obj, const PString &latexEnv) |
Convert a PLatexObj into a string. More... | |
bool | platexobj_htmlStrLatexFile (const PString &fileName, const PString &latexEnv, const PString &mathContent, const PString &fontColor) |
Save the latex file to be used to create a picture of the given formula. More... | |
void | platexobj_loadFormulaeMap (PMapFormula &mapFormula) |
Load the map file of all the formulae if it exists. More... | |
void | platexobj_saveFormulaeMap (const PMapFormula &mapFormula) |
Save the map file of the formulae to avoid extra latex call. More... | |
PString | platexobj_theme_createPage (POutoutMode &outputMode) |
Create the page from variables in POutoutMode. More... | |
void | platexobj_theme_init_var (POutoutMode &outputMode) |
Initialise basic variables of POutoutMode. More... | |
void | platexobj_theme_set_var (POutoutMode &outputMode, const PString &varName, const PString &value) |
Set a variable in the map of variable for theme (will take account the IS_XXX_BEGIN accordingly if the value is empty or not) More... | |
void | platexobj_theme_update_var (POutoutMode &outputMode, const PString &pageLink, const PString &pageTitle, const PString &prevSecLink, const PString &prevSecTitle, const PString &nextSecLink, const PString &nextSecTitle, const PString &parentSecLink, const PString &parentSecTitle, const PPath ¤tSourceFile, size_t currentSourceLine) |
Update var of POutoutMode for current section. More... | |
void | platexobj_update_theme (POutoutMode &outputMode, const PPath &themeBaseFile) |
Update the theme of the generated website. More... | |
bool lauchLatexToPng | ( | const PString & | fileNamePng | ) |
Lauch latex to create png file.
fileNamePng | : name of the png file to be created |
Definition at line 72 of file platexobj_formulae.cpp.
Referenced by platexObj_createImageWithMathTex().
PString platexObj_createFormulaTex | ( | POutoutMode & | outputMode, |
size_t | objId, | ||
const PString & | latexEnv, | ||
const PString & | texContent | ||
) |
Create an image with a latex formula.
[out] | outputMode | : output mode of the html backend |
objId | : id of the object to be used | |
latexEnv | : latex environement to be used | |
texContent | : text to put in the environement |
Definition at line 117 of file platexobj_formulae.cpp.
References POutoutMode::currentStyle, PPath::isFileExist(), POutoutMode::mapFormula, and platexObj_createImageWithMathTex().
Referenced by platexobj_htmlStrInlineMath(), and platexobj_htmlStrLatex().
PString platexObj_createImageWithMathTex | ( | size_t | objId, |
const PString & | latexEnv, | ||
const PString & | texContent, | ||
const PString & | fontColor | ||
) |
Create an image with a latex formula.
objId | : id of the object to be used |
latexEnv | : latex environement to be used |
texContent | : text to put in the environement |
fontColor | : color of the font to be used |
Definition at line 89 of file platexobj_formulae.cpp.
References PPath::createDirectory(), LATEX_IMAGE_OUTPUT_DIR, lauchLatexToPng(), platexobj_htmlStrLatexFile(), and valueToString().
Referenced by platexObj_createFormulaTex().
PString platexobj_htmlStrInlineMath | ( | POutoutMode & | outputMode, |
const PLatexObj & | obj | ||
) |
Convert a PLatexObj into a string.
[out] | outputMode | : output mode of the html backend |
obj | : PLatexObj to be converted into a string |
Definition at line 160 of file platexobj_formulae.cpp.
References PLatexObj::getId(), PLatexObj::getText(), POutoutMode::isMathJaxMode, and platexObj_createFormulaTex().
PString platexobj_htmlStrLatex | ( | POutoutMode & | outputMode, |
const PLatexObj & | obj, | ||
const PString & | latexEnv | ||
) |
Convert a PLatexObj into a string.
[out] | outputMode | : output mode of the html backend |
obj | : PLatexObj to be converted into a string | |
latexEnv | : name of the latex environement to be used |
Definition at line 144 of file platexobj_formulae.cpp.
References PLatexObj::getId(), PLatexObj::getText(), POutoutMode::isMathJaxMode, and platexObj_createFormulaTex().
bool platexobj_htmlStrLatexFile | ( | const PString & | fileName, |
const PString & | latexEnv, | ||
const PString & | mathContent, | ||
const PString & | fontColor | ||
) |
Save the latex file to be used to create a picture of the given formula.
fileName | : name of hte file to be generated |
latexEnv | : name of the latex environement to be used |
mathContent | : content of the latex environement |
fontColor | : color of the font to be used |
Definition at line 41 of file platexobj_formulae.cpp.
Referenced by platexObj_createImageWithMathTex().
void platexobj_loadFormulaeMap | ( | PMapFormula & | mapFormula | ) |
Load the map file of all the formulae if it exists.
[out] | mapFormula | : map of formulae to be loaded to avoid calling latex too much |
Definition at line 20 of file platexobj_formulae.cpp.
References data_load(), and FORMULAE_RECOVER_FILE.
Referenced by processAllFile().
void platexobj_saveFormulaeMap | ( | const PMapFormula & | mapFormula | ) |
Save the map file of the formulae to avoid extra latex call.
[out] | mapFormula | : map of formulae to be saved |
Definition at line 28 of file platexobj_formulae.cpp.
References data_save(), and FORMULAE_RECOVER_FILE.
Referenced by processAllFile().
PString platexobj_theme_createPage | ( | POutoutMode & | outputMode | ) |
Create the page from variables in POutoutMode.
[out] | outputMode | : POutoutMode to be used |
Definition at line 266 of file platexobj_formulae.cpp.
References dico_replace_nested_call(), POutoutMode::mapVar, and POutoutMode::themeCall.
Referenced by platexobj_book_createPage(), and platexobj_bookIndexHtml().
void platexobj_theme_init_var | ( | POutoutMode & | outputMode | ) |
Initialise basic variables of POutoutMode.
[out] | outputMode | : POutoutMode to init variables |
Definition at line 198 of file platexobj_formulae.cpp.
References POutoutMode::bookGitlabUrl, POutoutMode::bookMail, POutoutMode::bookMasterProjectUrl, POutoutMode::currentStyle, POutoutMode::isBibliography, POutoutMode::isBookTheme, POutoutMode::isMathJaxMode, POutoutMode::isRemoteMathjax, POutoutMode::mapVar, and platexobj_theme_set_var().
Referenced by processAllFile().
void platexobj_theme_set_var | ( | POutoutMode & | outputMode, |
const PString & | varName, | ||
const PString & | value | ||
) |
Set a variable in the map of variable for theme (will take account the IS_XXX_BEGIN accordingly if the value is empty or not)
[out] | outputMode | : POutoutMode to be updated |
varName | : name of the variable to be set | |
value | : value of the variable to be set |
Definition at line 184 of file platexobj_formulae.cpp.
References POutoutMode::mapVar.
Referenced by platexobj_theme_init_var(), and platexobj_theme_update_var().
void platexobj_theme_update_var | ( | POutoutMode & | outputMode, |
const PString & | pageLink, | ||
const PString & | pageTitle, | ||
const PString & | prevSecLink, | ||
const PString & | prevSecTitle, | ||
const PString & | nextSecLink, | ||
const PString & | nextSecTitle, | ||
const PString & | parentSecLink, | ||
const PString & | parentSecTitle, | ||
const PPath & | currentSourceFile, | ||
size_t | currentSourceLine | ||
) |
Update var of POutoutMode for current section.
[out] | outputMode | : POutoutMode to be modified |
pageLink | : link of the current page | |
pageTitle | : title of the current page | |
prevSecLink | : link of the previous section | |
prevSecTitle | : title of the previous section | |
nextSecLink | : link of the next section | |
nextSecTitle | : title of the next section | |
parentSecLink | : link of the parent section | |
parentSecTitle | : title of the parent section | |
currentSourceFile | : current source file of the section | |
currentSourceLine | : current source line of the section |
Definition at line 236 of file platexobj_formulae.cpp.
References POutoutMode::bookGitlabUrl, POutoutMode::fullMenu, PPath::getFileName(), PPath::getUnderPath(), POutoutMode::isBibliography, POutoutMode::isBookTheme, PPath::makeAbsolute(), POutoutMode::mapVar, platexobj_menuToHtml(), platexobj_theme_set_var(), PPath::simplify(), and valueToString().
Referenced by platexobj_book_createPage(), and platexobj_bookIndexHtml().
void platexobj_update_theme | ( | POutoutMode & | outputMode, |
const PPath & | themeBaseFile | ||
) |
Update the theme of the generated website.
[out] | outputMode | : POutoutMode to be updated |
themeBaseFile | : file which contains the theme we want to use |
Definition at line 175 of file platexobj_formulae.cpp.
References dico_create_nested_call(), PPath::loadFileContent(), and POutoutMode::themeCall.
Referenced by processAllFile().