#include <latex.hpp>
Public Member Functions | |
Document (const std::string &title) | |
Document (const std::string &title, const std::string &subtitle) | |
Document & | use (const std::string &import) |
Document & | with_leading_content (const std::string &content) |
Document & | with_toc () |
void | write_leading (const std::string &content) |
void | insert (const Section §) |
Document & | operator<< (const char *val) |
Document & | operator<< (const std::string &val) |
Document & | operator<< (const Section &val) |
std::string | to_string () const |
void | build (std::ostream &ss) const |
Public Attributes | |
std::string | title |
std::string | subtitle |
bool | use_toc |
std::vector< std::string > | imports |
std::vector< std::string > | leading_contents |
std::vector< Section > | sections |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Document &doc) |
Defines a document which is the root for generating a valid LaTeX document.
Documents must be given a title, and optionally a subtitle.
If the document type supports a table of contents, one is generated after the title page. Table of contents can be toggled via the ::use_toc
variable or ::with_toc()
function.
The ::use()
function allows importing LaTeX packages.
Leading content is output first, followed by all sections (and their subsections).
|
inline |
Helper for outputting the document to a generic std::ostream
|
inline |
Get the entire, LaTeX-formatted, document in a std::string.
|
inline |
Import a package into the document
|
inline |
Builder pattern method for adding leading content
|
inline |
Enable the table of contents if allowed by the document type
|
inline |
Write leading text (what comes before the sections in the document) into the document.