Command/definefirstline

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-04

Syntax (autogenerated)

\definefirstline[...][...][...=...,...]
[...] name
[...] name
...=...,... inherits from \setupfirstline

Syntax

\definefirstline[..][]
\definefirstline[...][...][...=...]
[...] name of firstline style
[...] name of firstline style to inherit from
alternative line word
n integer: number of words to affect
style Style Alternative
color IDENTIFIER: color name

Description

Define a style to apply only to the first line of a paragraph. Once defined, the style can be applied by invoking \setfirstline on a paragraph. One of two methods can be requested by setting the keyword alternative:

NB: The style substitution takes place on node level, hence small capitals require a font which implements them as a feature, not as a separate file (e. g. as of 2013 Latin Modern won’t do).

Examples

Bold and Small Caps

Typeset the first line once in bold, and then in small caps:

To affect only the first three or six words change to the alternative word and set the parameter n to the desired value:

Changing Case

Technically, \WORD is not a style, so to configure words in uppercase a different approach is necessary. The style can be defined in terms of a Lua handler, such as:

Where the handler code resembles:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: