Skip to content

The distinction between single and double smart quotes makes no sense #1194

Closed

Description

@MDLC01

Description

I don't really know if this is a suggestion or a bug, but the current way Typst treats quotes is weird.

In text mode, there are two ways to quote something: using single quotes ('single quotes'), or using double quotes ("double quotes"). In English, the former gets rendered as
‘single quotes’
while the latter is rendered as
“double quotes”

This makes sense because both single and double quotes are used in English. Typically, double quotes are used first, and single quotes are used as “second level” quotes.

But this is arbitrary, and it does not make sense for some languages.

For example, in French, the usage is to use guillemets (« guillemets ») as top-level quotes and double quotes (“double quotes”) when nested. Single guillemets (‹ single guillemets ›) are never used in french.

So I guess my suggestion is to get rid of the single/double quotes distinction and instead have a list of quote kind per level for every language—which should also be customizable using the text function—and let the compiler infer the quote level (which I think it already somewhat does) to use the right kind of quotes.

Use Case

As explained above, the main use case is being able to properly quote stuff in languages other than English. The distinction between single and double quotes is used to differentiate between different levels, so let's make it work that way.

With this proposal, languages that have quotes for more than two levels can be supported.

Activity

  1. added
    feature request
    on May 13, 2023
  2. added
    text
    on May 20, 2023
  3. Omikhleia commented on May 24, 2023

    @Omikhleia

    Greetings,

    Unless mistaken, I think this issue refers to the handling of "smart" quotes, right? That is, as currently done here:

    impl<'s> Quotes<'s> {

    This makes sense because both single and double quotes are used in English. Typically, double quotes are used first, and single quotes are used as “second level” quotes.

    There's a perhaps bit more than meets the eye... British English (or Welsh, and a few other language) use single quotes as primary quotation marks and double quotes as secondary marks, but US English normally uses double quotes as primary marks and single quotes as secondary marks.

    The main issue, I believe, is therefore to propose a "decent" interpretation of non-typographical "straight" quotes to be replaced by appropriate typographic primary and secondary quotation marks in a given language, depending both on the expectation of the user and the typographic rules applying to that language.

    For reference, you might possibly be interested to look at how I addressed it in smartquotes.sile - It's a package for the SILE typesetter (more precisely, a low-level package notably used for interpreting straight quotes in Markdown/Djot with "smart typography"), but the Lua code should be understandable and it mainly boils down to a big table of (primary, secondary) marks for a bunch of languages, derived from several sources.

    With this proposal, languages that have quotes for more than two levels can be supported.

    Note however that there are not many languages that have tertiary quotation marks or really use them nowadays; and the rules for using them are not always straightforward (I renounced addressing it in my SILE package -- It doesn't mean is not doable, but it might get trickier if one really wants them, unless it can be checked with native users knowledgeable about the topic).

    (As a side note, regarding the above-mentioned current logic in quotes.rs, the use of a \u{00A0} space in French quotes is not really respecting the true typography, but that's a different topic.)

  4. changed the title [-]The distinction between single and double quotes makes no sense[/-] [+]The distinction between single and double smart quotes makes no sense[/+] on May 24, 2023
  5. Andrew15-5 commented on Jun 16, 2023

    @Andrew15-5
    Contributor

    I wanted to add that because there are differences in American and British English, the csquotes (and babel) package in LaTeX does separate languages as american and british (see page 3).

    This is why I was "shocked" by the double parameter in the smartquote function. It should go so, there is only one parameter left — enabled.

    If it is not something desirable (one parameter function), then things like which quote at which level must be applied, but this implies that enabled must be equal to false (maybe set it to auto | boolean = auto).

  6. added
    change request
    and removed
    feature request
    on Nov 14, 2023
  7. laurmaedje commented on Apr 13, 2024

    @laurmaedje
    Member

    With consideration of @Omikhleia's comment and the smartquote.quotes property available, is there still something left to change here?

  8. MDLC01 commented on Apr 14, 2024

    @MDLC01
    CollaboratorAuthor

    I think this is an unsolvable issue in the sense that QWERTY keyboards have two kinds of quotes, and there is no perfect way to map them to quotes used in different languages.
    I would say that smartquote.quotes is the only way to solve this problem (by giving the control to the user).

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

    change requesttext

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions