Skip to contents

CSS properties for one tag, for use in markdown_style(). Names are CSS property names with _ for -, so font_size sets font-size.

Usage

md_style(...)

Arguments

...

Properties, as named arguments.

Value

An object of class gridmicrotex_md_style.

Details

A length can be a number, meaning a multiple of the body font size (font_size = 2.5); a CSS string such as "2.5em" or "12pt"; or a grid::unit().

The supported properties are below. Inline ones also work on a <span> and in markdown_grob(); block ones need markdown_box_grob().

propertyscopenotes
colorinline + block
font_sizeinline + block
font_familyinline + block
font_weightinline + block
font_styleinline + block
text_decorationinline + blockunderline, overline, line-through
backgroundinline + blocka fill behind the text
borderinlinea frame; the inset is fixed
border_styleinlineonly double
border_radiusinlinerounds the frame
box_shadowinline
visibilityinlinehidden keeps the space
vertical_aligninlinesuper, sub, or a length
transforminlinerotate(), scale(), scaleX(-1)
line_heightblockunitless, as gpar() wants it
margin_top, margin_bottomblockmargins do not collapse
margin_left, margin_rightblock
padding_left, padding_rightblock
padding_top, padding_bottomblock
margin, paddingblockthe CSS shorthand: one to four lengths, in CSS's order
text_alignblockleft, center, right
border_leftblockthe blockquote bar
border_topblockthe hr rule
border_bottomtra rule under each table row
border_colortablecolour of the table's rules
table_layouttablefixed divides the width evenly between the columns
heightblockthe band an hr sits in
bulletulraw LaTeX for the marker glyph
marker_gapul, olmarker to text

font_size also takes the keywords xx-small to xx-large, smaller and larger.

On body, background, border, border_radius, padding and margin style the box of markdown_box_grob() or of an element_markdown() title:

body { background: grey95; padding: 8px;
        border: 1px solid grey60; border-radius: 4px }

The box_gp, padding, margin and r arguments of markdown_box_grob() override this rule.

An unknown property is an error here, but is ignored in CSS text. Small caps, font-variant-numeric and padding inside an inline border are not supported.

Examples

md_style(color = "steelblue", font_size = 2.5, margin_top = 1.2)
#> <md_style>
#>   color            steelblue
#>   font-size        2.5
#>   margin-top       1.2