creativity
v1.3.0
Agent-based model of creativity and piracy
|
Struct holding various options controlling tabulation output. More...
#include <creativity/data/tabulate.hpp>
Public Member Functions | |
tabulation_options (const std::string &title="", TableFormat format=TableFormat::Text, unsigned precision=6, bool showpoint=false) | |
Constructs a tabulation_options struct. More... | |
tabulation_options (TableFormat format, unsigned precision=6, bool showpoint=false) | |
Constructs a tabulation_options struct without a title but with a specified format. More... | |
Public Attributes | |
TableFormat | format = TableFormat::Text |
The format (Text, HTML, or LaTeX) | |
unsigned | precision = 6 |
The precision for numerical values. | |
bool | showpoint = false |
Whether the decimal point and significant 0's are shown (see std::showpoint) | |
bool | dot_align = true |
Whether numeric columns are aligned on .'s (only works in TableFormat::LaTeX) | |
std::string | indent |
The indent (only applies when format is Text) | |
std::string | title |
The title of the table; if non-empty, this title will be displayed as a heading in some format-specific way. More... | |
bool | escape = true |
Whether to escape special characters (default) or leave them in formatted output. More... | |
bool | rows_align_left = false |
If true, give row values and header left-alignment; false (the default) gives them right alignment. | |
bool | extracol_align_left = true |
If true (the default), give extracol values (if any) left-alignment; if false, use right alignment. | |
bool | preamble = false |
For LaTeX and HTML, include a basic document preamble; if false (the default), output will be a document fragment instead of a full document. More... | |
bool | postamble = false |
For LaTeX and HTML, include a basic document postamble matching the preamble; if false (the default), output will be a document fragment instead of a full document. More... | |
struct { | |
bool diagonal = true | |
If true (the default), display the diagonal. | |
bool lower = true | |
If true (the default), display the part below the diagonal. | |
bool upper = true | |
If true (the default), display the part above the diagonal. | |
} | matrix |
The possible matrix sections to display. | |
Struct holding various options controlling tabulation output.
|
inlineexplicit |
Constructs a tabulation_options struct.
title | the title of the table; defaults to empty. Newline characters in the title will be converted (if necessary) into newlines in the output format (e.g. <br /> in HTML, \\ in LaTeX); other characters will not be escaped. |
format | the table format, one of the TableFormat enum values; defaults to Text |
precision | the precision of double values; defaults to 6 |
showpoint | whether trailing 0s (and possibly the decimal point) should be shown for displayed values; defaults to false (trailing 0s and/or decimal point are suppressed). |
|
inline |
Constructs a tabulation_options struct without a title but with a specified format.
This is exactly equivalent to calling the constructor with an empty string title plus the given arguments. Unlike the above, this constructor is not explicit, which allows implicit conversion from a TableFormat to a tabulation_options struct.
bool creativity::data::tabulation_options::escape = true |
Whether to escape special characters (default) or leave them in formatted output.
This has no effect for Text format, but matters for LaTeX (to escape things like %, _, etc.) and HTML (<, &, etc.).
bool creativity::data::tabulation_options::postamble = false |
For LaTeX and HTML, include a basic document postamble matching the preamble; if false (the default), output will be a document fragment instead of a full document.
For Text format, this has no effect.
This is intended to allow for multiple tables to be displayed in the same (shell) document by setting preamble = true
for the first table, and postamble = true
for the last.
bool creativity::data::tabulation_options::preamble = false |
For LaTeX and HTML, include a basic document preamble; if false (the default), output will be a document fragment instead of a full document.
For Text format, this has no effect.
This is intended to allow for multiple tables to be displayed in the same (shell) document by setting preamble = true
for the first table, and postamble = true
for the last.
std::string creativity::data::tabulation_options::title |
The title of the table; if non-empty, this title will be displayed as a heading in some format-specific way.
If empty (the default) no heading precedes the data.