typst / typst/typst

Way to manually render language-aware opening/closing quote

Open
#7,906 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Add a parameter to smartquote() that explicitly renders an opening or closing quote.

#set text(lang: "en")
#smartquote(kind: "start") // [“]
#smartquote(kind: "end")   // [”]

#set text(lang: "fr")
#smartquote(kind: "start") // [«\u{202F}]
#smartquote(kind: "end")   // [\u{202F}»]

Potential syntax: kind: "start" | "end" | auto or "open" | "close" | auto, with auto (the existing behaviour) as the default.

Use Case

This would allow for language-agnostic rendering of styled pullquotes, like the mockup below. Right now, wrapping a single smartquote in a box or block always renders an opening quote, so there's no way to achieve the effect in the mockup without hard-coding a specific glyph.

Image

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 smartquote() implementation and the existing language-aware quote behavior. Read how the current automatic opening and closing quotes are selected, then add coverage for explicit start and end rendering across the shown English and French cases; done means the default behavior remains unchanged and both requested forms produce the documented output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
internationalization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.