typst / typst/typst

Short figure caption for outline

Open
#1,295 17 comments 43 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request model
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

Allow adding an optional short caption to be displayed in the outline

Use Case

When adding a caption to a figure, the text might be quite long, in particular, when the figure contains a table or (multiple) images that require explanation. The entire caption text is automatically added to the outline, which may look really messy, depending on the text length.
In the caption package of LaTeX, one can add an argument <list entry> (kind of a short caption), that shows up in the outline instead of the <heading> (i.e. the actual caption), if given: \caption[⟨list entry⟩]{⟨heading⟩}. If no <list entry> is given, the <heading> is shown in the outline (as is happening now in typst) and if it is given, but left empty ( \caption[]{⟨heading⟩}) , no entry will be made in the outline.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation of figure captions and the outline entry generation in the Typst compiler. Check how the existing caption text is passed into the outline, then verify that an optional list entry replaces it, an omitted entry preserves the full caption, and an explicitly empty entry suppresses the outline entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.