Provides a possibility to generate Latex files from GTS objects or graph sets.
More...
#include <LatexExporter.h>
|
enum | TargetType { PS,
PDF
} |
| This Enumeration Type specifies for which resulting file formats the Latex file will be generated and finally compiled. More...
|
|
|
| LatexExporter () |
| Generates a new LatexExporter with default values.
|
|
virtual | ~LatexExporter () |
| Destroys this instance of a LatexExporter.
|
|
void | writeToLatex (graphs::GTS const >s, string filename, LatexExporter::TargetType target=TargetType::PDF, unordered_map< IDType, IDType > const *ruleIDSubs=nullptr, unordered_map< IDType, IDType > const *graphIDSubs=nullptr) const |
| Creates (and compiles if not deactivated) a Latex file representing the given GTS. More...
|
|
void | writeToLatex (vector< graphs::Hypergraph_sp > const &graphs, string filename, LatexExporter::TargetType target=TargetType::PDF, unordered_map< IDType, IDType > const *nameSubs=nullptr) const |
| Creates (and compiles if not deactivated) a Latex file containing all given graphs. More...
|
|
void | setScale (double scale) |
| Sets a scaling factor for all images. More...
|
|
double | getScale () const |
| Returns the scaling factor currently used. More...
|
|
void | setCompilation (bool compile) |
| Sets whether the Latex file should be compiled after its generation or not. More...
|
|
bool | willCompile () const |
| Returns whether the Latex file will be compiled after its generation. More...
|
|
|
void | writeToLatex (graphs::GTS const *gts, vector< graphs::Hypergraph_sp > const *graphs, string filename, LatexExporter::TargetType target, unordered_map< IDType, IDType > const *ruleIDSubs, unordered_map< IDType, IDType > const *graphIDSubs) const |
| Implementation of both writeToLatex(...) functions. More...
|
|
void | writeLatexHeader (std::ofstream &of) const |
| Writes the header information of the Latex document (the preamble) to the given filestream. More...
|
|
void | writeLatexAndGraphs (vector< graphs::Hypergraph_sp > const &graphs, std::ofstream &of, string filename, GraphDrawer::PictureFormat format, unordered_map< IDType, IDType > const *nameSubs) const |
| Creates an image file for each graph in the collection and writes a Latex file including these graphs to the given stream. More...
|
|
void | writeLatexBody (graphs::GTS const >s, std::ofstream &of, string filename, string ext, unordered_map< IDType, IDType > const *ruleIDSubs, unordered_map< IDType, IDType > const *graphIDSubs) const |
| Writes the body (including {document} and {document} to the given filestream. More...
|
|
void | writeGraphs (graphs::GTS const >s, string filename, GraphDrawer::PictureFormat format) const |
| Creates an image file for each graph stored in the given gts object. More...
|
|
string | getNameOrNoName (string name) const |
| Returns either the string or <noname> if the string was empty. More...
|
|
|
double | scale |
| Stores a scaling factor used when including the image files.
|
|
bool | compile |
| Stores whether the generated Latex file will be compiled or not.
|
|
Provides a possibility to generate Latex files from GTS objects or graph sets.
The generated Latex file will be automatically be converted to a PDF or postscript file. This compilation can also be deactivated.
- Author
- Jan Stückrath
This Enumeration Type specifies for which resulting file formats the Latex file will be generated and finally compiled.
Enumerator |
---|
PS |
Postscript file format.
|
PDF |
pdf file format.
|
string getNameOrNoName |
( |
string |
name | ) |
const |
|
inlineprivate |
Returns either the string or <noname> if the string was empty.
- Parameters
-
- Returns
- the input string if non-empty, <noname> otherwise
double getScale |
( |
| ) |
const |
Returns the scaling factor currently used.
- Returns
- the scaling factor currently used
void setCompilation |
( |
bool |
compile | ) |
|
Sets whether the Latex file should be compiled after its generation or not.
- Parameters
-
compile | true activates compilation, false deactivates |
void setScale |
( |
double |
scale | ) |
|
Sets a scaling factor for all images.
Semantic of this factor can depend on chosen TargetType.
- Parameters
-
bool willCompile |
( |
| ) |
const |
Returns whether the Latex file will be compiled after its generation.
- Returns
- true iff the Latex file will be compiled after its generation
Creates an image file for each graph stored in the given gts object.
These graphs are stored in a folder named by the given filename appended with '_files' (which is created if non-existent).
- Parameters
-
gts | the GTS containing the graphs to be written |
filename | the name of the Latex file which is being generated (including extension) |
format | a PictureFormat value representing the generated image format |
Creates an image file for each graph in the collection and writes a Latex file including these graphs to the given stream.
These graphs are stored in a folder named by the given filename appended with '_files' (which is created if non-existent).
- Parameters
-
graphs | the collection of graphs to be layouted |
of | the file stream to which the Latex file will be written |
filename | the name of the resulting Latex file (including extension) |
format | the picture format used for generating the graph files |
nameSubs | the value of IDs of graphs mapped by this parameter is exported in addition to the name |
void writeLatexBody |
( |
graphs::GTS const & |
gts, |
|
|
std::ofstream & |
of, |
|
|
string |
filename, |
|
|
string |
ext, |
|
|
unordered_map< IDType, IDType > const * |
ruleIDSubs, |
|
|
unordered_map< IDType, IDType > const * |
graphIDSubs |
|
) |
| const |
|
private |
Writes the body (including {document} and {document} to the given filestream.
This body includes Latex code layouting the given GTS and referencing the files created by writeGraphs(...).
- See Also
- LatexExporter::writeGraphs(graphs::GTS&, string, GraphDrawer::PictureFormat)
- Parameters
-
gts | the GTS to be layouted |
of | the filestream to which the Latex body will be written |
filename | the filename used to open the given filestream |
ext | the extension of the used image format (not including the point) |
ruleIDSubs | if given, the mapping of IDs of rules is printed instead of the normal IDs |
graphIDSubs | if given, the mapping of IDs of graphs is printed instead of the normal IDs |
void writeLatexHeader |
( |
std::ofstream & |
of | ) |
const |
|
private |
Writes the header information of the Latex document (the preamble) to the given filestream.
This contains all necessary definitions except any includes for packages needed for the image format and the definition of the command.
- Parameters
-
of | the filestream to be used |
Creates (and compiles if not deactivated) a Latex file representing the given GTS.
Depending on the given TargetType, a subfolder is created to store all images of graphs and a file displaying all initial graphs and rules is generated.
- Parameters
-
gts | the GTS which should be layouted |
filename | the name of the file in which the latex code will be written (including extension) |
ruleIDSubs | if given, not the rule IDs are printed, but their mapping |
graphIDSubs | if given, not the graph IDs are printed, but their mapping |
target | the TargetType to be generated |
Creates (and compiles if not deactivated) a Latex file containing all given graphs.
Depending on the given TargetType, a subfolder is created to store all images of graphs which will subsequently be merged to a single file.
- Parameters
-
graphs | the graphs which should be layouted |
filename | the name of the file in which the latex code will be written (including extension) |
target | the TargetType to be generated |
nameSubs | every graph with a mapping in this map will have its value (in this map) be displayed in addition to its name |
Implementation of both writeToLatex(...) functions.
If the given GTS is not null (has priority), it will be layouted. If a graph collection is given, it will be layouted and the ruleIDSubs parameter will be ignored. Either 'gts' or 'graphs' has to be defined!
- See Also
- writeToLatex(graphs::GTS const&, string, LatexExporter::TargetType,unordered_map<IDType, IDType> const*,unordered_map<IDType, IDType> const*)
-
writeToLatex(vector<graphs::Hypergraph_sp> const&, string, LatexExporter::TargetType, unordered_map<IDType, IDType> const*)
- Parameters
-
gts | the gts to be layouted; may be null if graphs parameter is not |
graphs | the graph collection to be layouted; may be null if gts parameter is not |
filename | the Latex filename to be created (including extension) |
target | the target format |
ruleIDSubs | if layouting a gts, the mapping of IDs of rules is printed instead of the normal IDs |
graphIDSubs | if layouting a graph or gts, the mapping of IDs of graphs is printed instead of the normal IDs |
The documentation for this class was generated from the following files:
- /home/stueckrath/eclipse_ws/Uncover/src/io/LatexExporter.h
- /home/stueckrath/eclipse_ws/Uncover/src/io/LatexExporter.cpp