creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Public Attributes | List of all members
creativity::data::tabulation_options Struct Reference

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.
 

Detailed Description

Struct holding various options controlling tabulation output.

Constructor & Destructor Documentation

§ tabulation_options() [1/2]

creativity::data::tabulation_options::tabulation_options ( const std::string &  title = "",
TableFormat  format = TableFormat::Text,
unsigned  precision = 6,
bool  showpoint = false 
)
inlineexplicit

Constructs a tabulation_options struct.

Parameters
titlethe 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.
formatthe table format, one of the TableFormat enum values; defaults to Text
precisionthe precision of double values; defaults to 6
showpointwhether trailing 0s (and possibly the decimal point) should be shown for displayed values; defaults to false (trailing 0s and/or decimal point are suppressed).

§ tabulation_options() [2/2]

creativity::data::tabulation_options::tabulation_options ( TableFormat  format,
unsigned  precision = 6,
bool  showpoint = false 
)
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.

Member Data Documentation

§ escape

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.).

§ postamble

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.

§ preamble

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.

§ title

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.


The documentation for this struct was generated from the following file: