Skip to content

Proper i18n for figure captions #2485

Open

Description

@gnojus

Description

Hi,

in Lithuanian language tables and pictures are numbered as 1 Lentelė/1 Pav., that is digit goes before the supplement.
It would be nice if this would be available, either hardcoded for appropriate languages, or by expanding the way captions are specified.

I could contribute the Lithuanian text language, but this is blocking proper translation.

Use Case

To create grammatically correct documents in Lithuanian language.

Activity

  1. added
    feature request
    on Oct 25, 2023
  2. ichxorya commented on Nov 1, 2023

    @ichxorya
    Contributor

    I looked at the code to try but cannot get what caused the text order to happen. This is a good idea, we should have some generalized rules and certain localized rules.

  3. gnojus commented on Nov 1, 2023

    @gnojus
    Author

    Could be some of the places it's hardcoded in (for Figure)?:

    realized = supplement + numbers + separator + caption.body();
    and
    realized = supplement + numbers + self.get_separator(styles) + realized;

  4. added
    styling
    on Nov 2, 2023
  5. changed the title [-]More flexible Figure, Table captions[/-] [+]Proper i18n for figure captions[/+] on Nov 14, 2023
  6. Jisu-Woniu commented on May 7, 2024

    @Jisu-Woniu

    In Chinese, when we mention a section, we say “第 1 节” (meaning "No. 1 Section" approximately).

    It would be good if we can use a supplement taking number as a parameter.

  7. YDX-2147483647 commented on Jul 17, 2025

    @YDX-2147483647
    Contributor

    A workaround for figures

    Set supplement to it => none, and put the real supplement in numbering.

    #import "@preview/numbly:0.1.0": numbly
    #show figure.where(kind: table): set figure(
      numbering: numbly("👉 before {1} after 👈"),
      supplement: it => none,
    )

    The numbly package is necessary here, or a in after will be interpreted as a pattern (abcd…).

    That is @tab.
    
    #figure(
      table(columns: 3, ..($...$,) * 9),
      caption: [Caption],
    ) <tab>
    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requeststyling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions