You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spaces after « and before » should be nobreak in french #1920
bugSomething isn't workinggood contributionSuitable for contribution, but unlike "good first issue", it may need prior experiencegood first issueGood for newcomerstextRelated to the text category, which is all about text handling, shaping, etc.
(Hi, first time submitting an issue for this project, hope I'm doing it things more or less right!)
When setting lang to french, spaces after and before the french « quotes » (or "guillemets") « and » should be unbreakable. Currently, this is not the case:
« Bonjour, ceci est un dialogue »
"Bonjour, ceci est un dialogue"
As the example above shows, using the smart quote feature it works correctly, but some french layouts (e.g. Bépo) allow to easily type « and » and if you are used to do it the results won't be great.
(If you agree this should be fixed and can point me in the right direction, I'd be happy to try and start working on a PR ^^)
Reproduction URL
No response
Operating system
Web app, Windows
Typst version
I am using the latest version of Typst
Reacted by yodatak, Aina Rasoldier, Bastien Voirin and Matteo Poggi
Slightly relates to #1194 (comment) (where I mentioned in passing that "the use of a \u{00A0} space in French quotes is not really respecting the true typography")
My 2 cents on the topic:
The "guillemet space" shall always be unbreakable indeed, and is "usually" smaller than the regular inter-word space, with also a bit less stretch/shrinkability. Babel (LaTeX) adopted a definition recommended by Thierry Bouche years ago (and SILE followed it too more recently), which as far as I understand is typographically sound for fr and fr-CA (but note that fr-CH may prefer a thin space there, or even no guillemet space at all).
Likewise, for the record, French requires a non-breakable space (but usually stretch/shrinkable as an inter-word space for justification purposes) before a colon -- and a thin space before certain "high" punctuation signs ;!? (with a number of exceptions...), unbreakable too and usually non-variable, ideally around half of the inter-word space, at least in fr; fr-CA usually does not add that space before the so-said high punctuations)
Obviously/unfortunately, few typesetting software follow these usual/old conventions -- as noted, LaTeX with Babel does, as well as SILE -- But many just use some unbreakable fixed spaces in these cases. FWIW, LibreOffice and MSWord do that (i.e. insert the same fixed nbsp everywhere), though they do implement some of the differences between French from France, Canada and Switzerland ;)
Reacted by Caleb Maclennan, Misha Krieger-Raynauld, Aina Rasoldier, Splines and Vincent Martel
I agree this is rather a feature request (the current behavior is fine but maybe typst could automatically fix the spacing when the use enters guillemets).
If this issue is closed though maybe #4674 should be reopened (it would be nice to extend the "automatic localization" done for quotes to other types of punctuation).
Reacted by Victor Sannier, Aina Rasoldier and Philipp Niedermayer
How about a simple show rule to ease your typing habit?
#setpage(width: 190pt, height: auto)
« Bonjour, ceci est un dialogue »
#showregex("(« |‹ | ›| »)"): it=> {
showsym.space: sym.space.nobreak// or sym.space.nobreak.narrowit
}
« Bonjour, ceci est un dialogue »
Caution
Note that the usage of Guillemets differs in different cultures, built-in automatic space substitution would have to take this into account:
Ein « Beispiel » in Frankreich und der Welschschweiz
Ein «Beispiel» in der Deutschschweiz
Ein »Beispiel« in Deutschland und Österreich // ⚠ Avoid nobreak space here
#5976 is about the smartquote elements. This issue is about manually inserted guillemets. The following still does not work as intended in the April 10 development version, which should include #5976.
#settext(lang: "fr")
#lorem(14) A test » \#lorem(14) A test ! \#lorem(14) A test ? \#lorem(14) A test : \#lorem(14) A test ; \#lorem(14) A test ,
#5976 is about the smartquote elements. This issue is about manually inserted guillemets. The following still does not work as intended in the April 10 development version, which should include #5976.
bugSomething isn't workinggood contributionSuitable for contribution, but unlike "good first issue", it may need prior experiencegood first issueGood for newcomerstextRelated to the text category, which is all about text handling, shaping, etc.
Activity
Omikhleia commentedon Aug 15, 2023
Slightly relates to #1194 (comment) (where I mentioned in passing that "the use of a
\u{00A0}space in French quotes is not really respecting the true typography")My 2 cents on the topic:
The "guillemet space" shall always be unbreakable indeed, and is "usually" smaller than the regular inter-word space, with also a bit less stretch/shrinkability. Babel (LaTeX) adopted a definition recommended by Thierry Bouche years ago (and SILE followed it too more recently), which as far as I understand is typographically sound for
frandfr-CA(but note thatfr-CHmay prefer a thin space there, or even no guillemet space at all).Likewise, for the record, French requires a non-breakable space (but usually stretch/shrinkable as an inter-word space for justification purposes) before a colon -- and a thin space before certain "high" punctuation signs
;!?(with a number of exceptions...), unbreakable too and usually non-variable, ideally around half of the inter-word space, at least infr;fr-CAusually does not add that space before the so-said high punctuations)Obviously/unfortunately, few typesetting software follow these usual/old conventions -- as noted, LaTeX with Babel does, as well as SILE -- But many just use some unbreakable fixed spaces in these cases. FWIW, LibreOffice and MSWord do that (i.e. insert the same fixed nbsp everywhere), though they do implement some of the differences between French from France, Canada and Switzerland ;)
yodatak commentedon Sep 4, 2024
Maybe in this part https://github.com/typst/typst/blob/main/crates/typst/src/text/smartquote.rs
any maybe with this we could now doi it with simple show instruction
#4876
#4672
laurmaedje commentedon Sep 4, 2024
Not sure whether this is even a bug. The smartquotes work as intended and the text above with manual quotes simply doesn't use non-breaking spaces.
sijow commentedon Sep 20, 2024
I agree this is rather a feature request (the current behavior is fine but maybe typst could automatically fix the spacing when the use enters guillemets).
If this issue is closed though maybe #4674 should be reopened (it would be nice to extend the "automatic localization" done for quotes to other types of punctuation).
ainar commentedon Nov 13, 2024
I'm facing this problem in the bibliography. I know no way to add a space before a colon in this case:

eltos commentedon Jan 28, 2025
How about a simple show rule to ease your typing habit?
Caution
Note that the usage of Guillemets differs in different cultures, built-in automatic space substitution would have to take this into account:
MDLC01 commentedon Feb 24, 2025
Note that regular spaces before some other marks are treated as non-breaking:
laurmaedje commentedon May 1, 2025
Fixed by #5976
MDLC01 commentedon May 1, 2025
#5976 is about the smartquote elements. This issue is about manually inserted guillemets. The following still does not work as intended in the April 10 development version, which should include #5976.
Enivex commentedon May 1, 2025
If you're manually inserting quotes, should you then not also manually insert no-break spaces?
MDLC01 commentedon May 1, 2025
As I explained in #1920 (comment), spaces before some punctuation marks already do behave as non-breaking spaces.
laurmaedje commentedon May 1, 2025
I was a bit too fast with this one ...
MrVyM commentedon Oct 28, 2025
I'm currently working on a document on typst with smartquotes. I just find this.

It's the correct place to talk about this ?
MDLC01 commentedon Oct 28, 2025
You may want to create a separate issue, but in this case I don't think this behavior is unintended.
Fix for French Quotation Marks and Non-Breaking Spaces typst#1920
laurmaedje commentedon Jun 4, 2026
Closed by #8406.