Skip to content

Conversation

@gustavohtc23-sudo
Copy link
Contributor

@gustavohtc23-sudo gustavohtc23-sudo commented Jan 21, 2026

Description

This PR introduces a set of improvements to the Typst backend aimed at clarity, expressiveness, and better alignment with Typst’s table API.

Main changes

Add TypstCaption type to enable more explicit and semantically meaningful legends, improving readability and extensibility.

Disambiguate text-related attributes by prefixing all attributes that apply exclusively to text with text-, eliminating ambiguity with table- or cell-level attributes.

Add support for table-level parameters accepted by Typst table, allowing structured configuration at the table level instead of relying on implicit or cell-scoped settings.

Motivation

Explicit legend kinds make the output easier to integrate with another sources of tables and images.

The text-* prefix clarifies intent and reduces naming conflicts in styling options.

Exposing Typst table parameters at the table level improves ergonomics and feature parity with Typst.

Compatibility notes

Attribute renaming to text-* may affect existing code; this PR updates internal usage accordingly.

If desired, deprecations or aliases for previous attribute names can be added in a follow-up.

Tests and documentation

Tests were updated/added to cover the new Kind field, text-* attributes, and table-level parameters.

Examples were adjusted to reflect the new API where applicable.

Feedback on naming, scope, or compatibility strategy is very welcome.

Closes #293
Closes #294

Gustavo Henrique Tavares Cardoso and others added 30 commits December 16, 2025 15:49
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
@gustavohtc23-sudo gustavohtc23-sudo marked this pull request as draft January 21, 2026 19:52
@gustavohtc23-sudo gustavohtc23-sudo marked this pull request as ready for review January 22, 2026 15:21
end

"""
"""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add documentation for the function or remove this docstring.

struct Percent <: TypstRelativeLengthKind end
struct Auto end

Base.show(io::IO,::Auto) = print(io,"auto")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always add space after comma in function declaration and function calling.

position:: Union{Nothing,String}
end

function TypstCaption(caption; kind=Auto(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not following the Blue Style convention.

il -= 1

if !isnothing(caption)
if !isnothing(caption)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the trailing space.

# ----------------------------------------------------------------------------
# 1) Text attribute filter: only keeps `text-*` keys that map to _TYPST__TEXT_ATTRIBUTES
# ----------------------------------------------------------------------------
@testset "_typst__filter_text_atributes" verbose=true begin
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation must always use 4 spaces in Julia code.

@ronisbr
Copy link
Owner

ronisbr commented Jan 24, 2026

Thanks @gustavohtc23-sudo ! I completed the review with just a few formatting issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Typst] Enhance typst Style definition [Typst] Add figure kind to table

2 participants