Skip to content

Non-idiomatic advanced heading styling in documentation #6273

@Andrew15-5

Description

@Andrew15-5

Description

Under https://typst.app/docs/tutorial/advanced-styling/#columns-and-headings, there is

#show heading.where(
  level: 1
): it => block(width: 100%)[
  #set align(center)
  #set text(13pt, weight: "regular")
  #smallcaps(it.body)
]

#show heading.where(
  level: 2
): it => text(
  size: 11pt,
  weight: "regular",
  style: "italic",
  it.body + [.],
)

Which might be good enough in isolation, but it gives a bad example for new users, as you always should prefer show-set rules over show rules. It's not idiomatic, nor the formatting is good.

This example can lead to inability to further style, or sometimes not being able to style in the first place. See this and this.

Is this example so old, or was this not considered? It is so old.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions