On this page:
para
nested
centered
margin_  note
margin_  note_  block
Margin  Side
Margin  Side.left
Margin  Side.right
itemlist
item
Item
verbatim
tabular
Cell
Cell.cont
9.0.0.6

3.2 Flow Blocks🔗ℹ

function

fun para(~style: paragraph_style :: maybe(StyleLike) = #false,

         pre_content :: PreContent) :: Paragraph

Creates a paragraph. Most paragraphs are created implicitly by decoding, but para is useful for constructing a flow block explicitly or giving a style to the paragraph.

See paragraph_style for information about styles for paragraphs.

function

fun nested(~style: nested_flow_style :: maybe(StyleLike) = #false,

           pre_flow :: PreFlow) :: NestedFlow

Creates a nested flow as a single flow block.

See nested_flow_style for information about styles for nested flows.

function

fun centered(pre_flow :: PreFlow) :: FlowBlock

Creates a nested flow whose contented is centered with respect to the enclosing flow, if centering is supported by the renderer that is used to render the document.

Calling centered is equivalent to calling nested with a centering style.

function

fun margin_note(~at: at :: MarginSide = #'right,

                pre_content :: PreContent)

  :: Element

 

function

fun margin_note_block(~at: at :: MarginSide = #'right,

                      pre_flow :: PreFlow)

  :: FlowBlock

 

enumeration

enum MarginSide:

  left

  right

Creates content or a flow block that is typeset in the left or right margin, if maring notes are supported by the renderer that is used to render the document.

function

fun itemlist(~style: itemization_style :: maybe(StyleLike) = #false,

             item :: Item,

             ...)

  :: Itemization

 

function

fun item(pre_flow :: PreFlow) :: Item

 

annotation

Item

The itemlist function creates an itemization.

The item function provides an Item that is ultimately only useful with itemlist. The Item annotation recognizes the same values as the Racket Scribble library’s item?.

See itemization_style for information about styles for itemizations.

function

fun verbatim(~indent: indent :: Nat = 0,

             [content :: Content, ...])

  :: FlowBlock

Renders the strings of content literally and in a fixed-width font. No decoding is used for strings among the content.

The given content can include non-string element, and those are rendered as they normally would be, which is not “verbatim.” Only string elements of content (possibly nested in lists) are rendered verbatim.

function

fun tabular(cells :: List.of(List.of(Cell)),

            ~style: table_style :: maybe(StyleLike) = #false,

            ~sep: sep :: maybe(FlowBlock || Content) = #false,

            ~column_properties: col_props :: List = [],

            ~row_properties: row_props :: List = [],

            ~cell_properties: cell_props :: List.of(List) = [],

            ~sep_properties: sep_props :: maybe(List) = #false)

  :: Table

 

enumeration

enum Cell:

  ~is_a FlowBlock

  ~is_a Content

  cont

Creates a table for a two-dimentional layout of flow blocks. Each list in cells is a row in the table.

An element in cells can be a flow block, content that is coerced to a flow block by wrapping it as a paragraph, or #'cont. A #'cont cell makes sense only after the first cell in a row, and it causes the content of the previous column in the row to continue into the cell’s row. Multiple adjacent #'cont values allow content to span more than two columns.

The col_props, row_props, and cell_props arguments all supply properties to be used for indvidual cells:

  • The elements of col_props are given to every column and every cell in the corresponding column, and if there are more columns than elements in col_props, the last element is repeated for all remaining columns. Each element is either a single style property value or a list of style property values to associate with a cell, where a single style property value is equivaent to a list containing that value.

  • The elements of row_props are similarly given to every cell in the corresponding row, repeating the last element as needed.

  • The lists and elements of cell_props are similarly repeated as needed to match the number of columns and rows in cells.

An empty list for any of col_props, row_props, and cell_props is the same as provding [[]]. When multiple property lists are provided for a cell by col_props, row_props, and cell_props, the lists are all appended for the cell. Note that col_props provides properties both for columns (for which certiain properties are recognized) and for individual cells (for which other properties are recognized), but row_props and cell_props provide only properties for indvidual cells.

See table_style for information about styles for tables. A table_style can have column and cell styles via Style.TableColumns and Style.TableCells properties. Any styles from col_props are merged with styles in a Style.TableColumns property, and any styles from row_props and cell_props are merged with a Style.TableCells property.

If sep is not #false, then it is used for a column added between every column in a row (except for columns that continue via #'cont. For example, sep could be hspace(1) to ensure space between columns. These extra columns do not count for distributing properties from col_props, row_props, and cell_props; instead, each inserted column gets the same properties as te preceding cell within the row, unless sep_props is a list to provide properties for the added columns.