-
Notifications
You must be signed in to change notification settings - Fork 32
tbl
Similar to the txt and img commands, the tbl command is also borrowed from the Weaver
package and was updated to support MarkDoc package. Therefore, you have to make sure the Weaver log is
closed. To do so, type weave query to check the status of the Weaver log. The tbl command works similar
to the
-
tblsimplifies writing and styling dynamic tables - It can also align the content of each column to the left, center, or right
- It creates a table somehow similar to the way a matrix is defined in Stata
The tbl command creates a dynamic table in the specified markup language. The default
markup language is Markdown. The syntax of the command is:
tbl (*[,*...] [\ *[,*...] [\ [...]]]) [, markup(str) title(str) width(int) height(int) center left ]
where the * represents a display directive which is:
"double-quoted string"
`"compound double-quoted string"'
[%fmt] [=]exp
,
{l}
{c}
{r}
| Display Directive | Discription |
|---|---|
| "double-quoted string" | displays the string without the quotes |
| `"compound double-quoted string"' | display the string without the outer quotes; allows embedded quotes |
| [%fmt] [=] exp | allows results to be formatted |
| , | separates the directives of each column of the table |
| {l} | creates a left-aligned column |
| {c} | creates a center-aligned column |
| {r} | creates a right-aligned column |
creating a simple 2x3 table with string and numbers . tbl ("Column 1", "Column 2", "Column 3" \ 10, 100, 1000 )
creating a table that includes scalars and aligns the columns to left, center, and right respectively . tbl ({l}"Left", {c}"Centered", {r}"Right" \ c(os), c(machine_type), c(username))
For using LaTeX symbols in the tbl command, place a # before \ sign
of LaTeX code to avoid confusion with backslash required for separating rows of the table.
For example, write #\beta instead of \beta to render the Beta in the
table. More over, for rendering LaTeX mathematical notations in the tbl
command, use double dollar sign $$.
