跳到主要内容

config-article

Article-mode configuration.

Controls how slide content is rendered when using article mode via the dual theme. These settings are consumed by render-content-as-article and _wrap-section in core.typ.

When you pass auto to the title-block-fn it will show

(..args) => context{
let title = document.title
let authors = document.author
if type(authors) == array {
authors = authors.reduce((a, b) => a + " and " + b)
}
let date = if document.date == auto {datetime.today()} else {document.date}
let description = document.description
let keywords = document.keywords
if type(keywords) == array {
keywords = keywords.reduce((a, b) => a + ", " + b)
}
align(center, block[
#std.title(title)

*#authors*

#date.display()

#v(1em)

#block(width:page.width*0.6, text(style:"italic", description))

#text(weight:"semibold", style:"italic", tracking:0.5pt, keywords)
])
},
Parameters

available-fields : dict​

The fields from the config to pass to the article-theme. A dict mapping config to the theme fields. E.g. (the-title: "info.title", the-author: "info.author") will pass the config-info fields title and author in the config to the theme as the-title and the-author. Default is (:), which passes no fields.

title-block-fn : function​

A function returning the title block to show at the beginning of the rendered article. If your theme has an automatic function for this you don't need it. And you can always use #article-only before the first slide to show your custom title block. Default is none.

wrap : dictionary | bool​

Which elements float to the side of the text (done with meander), and how. At the top level, false disables wrapping and true floats every extractable candidate with the defaults. In a dictionary, every key other than width, align and overrides names an element function, so image: true (the default) floats raw images according to the specified width and alignment defaults, table: (align: left) floats tables to left instead. Each takes false to stay in the flow, true for the shared defaults, or a dictionary of overrides. Tables and figures that do not float are centered at the bottom of the section and all other elements are kept inline. overrides is an array of dictionaries with a target predicate, for cases a name cannot express. \ Example: \ config-article(wrap: ( width: 40%, image: true, table: (align: left, width: 30%), overrides: (( target: el => el.func() == figure and el.body.func() == image, align: left, width: 40% ),) )).\ Recalled or Rendered content is never wrapped. A graphic via touying-reduce/graphic is by default not wrapped, but touying marks its graphics in article mode with a graphics marker which you can select via: graphic-marker-of(cetz.canvas) for an animated cetz canvas. You can also mark your own graphics to allow the predicate to match: #graphic-marker(cetz.canvas)[#cetz.canvas(..)].

linearize : auto | bool | dict​

Whether a container that arranges content is flattened into the prose. auto (the default) linearizes #columns(..), and a table or grid that declares no header or footer: declaring one is what says its rows and columns carry meaning. components.cols and side-by-side internally build a grid without a header. true or false force it for all three. A dict allows you to specify for each, e.g. (table: false, grid: auto, columns: true). A figure's body is never flattened.

Returns: dictionary