Text Formatting ⇒ Automatic Insertion of unbreakable Space after Guillemets
Re: Automatic Insertion of unbreakable Space after Guillemet
Pardon my ignorance, but which is the "Unicode character for guillemets"?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
Automatic Insertion of unbreakable Space after Guillemets
Here are the codes: Guillemet Unicode. You could also copy & paste such characters into your code.
With pdfLaTeX:
With XeLaTeX:
Stefan
With pdfLaTeX:
Code: Select all
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
«~Text~»
\end{document}
With XeLaTeX:
Code: Select all
\documentclass{article}
\usepackage{fontspec}
\begin{document}
«~Text~»
\end{document}
LaTeX.org admin
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Automatic Insertion of unbreakable Space after Guillemets
To elaborate Stefan's answer regarding XeLaTeX a bit, here's an example for a French document.
All used fonts are available for free in the net.
Code: Select all
% !TeX program = xelatex
\documentclass[11pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\setmainfont[Ligatures=TeX]{XITS}
\setsansfont[Ligatures=TeX,Scale=MatchLowercase]{Cantarell}
\setmonofont[Ligatures=TeX]{Inconsolata}
\setmathfont[Ligatures=TeX]{XITS Math}
\begin{document}
«Text»: «Text»;
\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Automatic Insertion of unbreakable Space after Guillemets
Ahem... I don't understand your point. Of course my font, Tinos supports Unicode-compliant guillemets. I mean, I'm not enjoining XeLaTeX to fake them through bitmaps. But the main issue here is: how do I type them time-effectively into my text, provided that, as you probably know, the French layout does not contain a key for them? Copy-paste is annoying, especially when you (like me) deal with a book, a very long text. I was wondering whether LaTeX allows for some quick-and-dirty shortcuts, something like \S for the section sign (§).
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Automatic Insertion of unbreakable Space after Guillemets
Hm, from a French keyboard I would think that it has keys to produce these characters directly. On my Linux system I just need to hold "Alt Gr" and hit "x" to produce "«". For "»" it's "Alt Gr" together with "y". Doesn't your editor allow a setup to insert these French quote characters directly by replacement?AleCes wrote:[…] But the main issue here is: how do I type them time-effectively into my text, provided that, as you probably know, the French layout does not contain a key for them? […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Automatic Insertion of unbreakable Space after Guillemets
Oops, I forgot about that, here's the workaround I devised:
Hope it might help other people.
Code: Select all
\newcommand{\og}{«}
\newcommand{\fg}{»}
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Automatic Insertion of unbreakable Space after Guillemets
Please note something: I had french in school, but this is a long long time ago. I don't know about Stefan or Thorsten. And tough I actually learnt the language. i can't remember for the life of me about the Punctuation rules of the french language. I guess it's the same about the others.
If this really is common orthography, then there will already be a solution.
And now please consider the following MWE:
EDIT: I just read the thread from the beginning, and altough you mentioned french typography your problem description was completely wrong.
If this really is common orthography, then there will already be a solution.
And now please consider the following MWE:
Code: Select all
\documentclass{book}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{french}
\usepackage{csquotes}
\begin{document}
This is a \enquote{Test sentence}: My french is a bit rusty.
\end{document}
Code: Select all
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{csquotes}
\begin{document}
This is a \enquote{Test sentence}: My french is a bit rusty.
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Automatic Insertion of unbreakable Space after Guillemets
OK, I'm sorry, you know I'm a rookie, my understanding of Latex is very limited.Johannes_B wrote:Please note something: I had french in school, but this is a long long time ago. I don't know about Stefan or Thorsten. And tough I actually learnt the language. i can't remember for the life of me about the Punctuation rules of the french language. I guess it's the same about the others.
If this really is common orthography, then there will already be a solution.
And now please consider the following MWE:Code: Select all
\documentclass{book} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage{french} \usepackage{csquotes} \begin{document} This is a \enquote{Test sentence}: My french is a bit rusty. \end{document}
EDIT: I just read the thread from the beginning, and altough you mentioned french typography your problem description was completely wrong.Code: Select all
\documentclass{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{csquotes} \begin{document} This is a \enquote{Test sentence}: My french is a bit rusty. \end{document}
Now,
\enquote
is could be useful because polyglossya
doesn't make any allowance for French-style quotes but if you use babel
, you won't need it as it enables the commands \og
and \fg
, which respectively open and close the angle quotes and places an unbreakable space respectively after and before the said quotes. The unbreakable space is mandatory in French, does \enquote
do so? Otherwise it won't be any good.- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: Automatic Insertion of unbreakable Space after Guillemet
enquote changes the quotes acccording the language.
If enquote adds he mandatory space? Try clicking on my given example.
If enquote adds he mandatory space? Try clicking on my given example.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Automatic Insertion of unbreakable Space after Guillemets
I've already done so, of course, before answering you. The problem is, is the space a normal one or an unbreakable one? How can I tell it?Johannes_B wrote:enquote changes the quotes acccording the language.
If enquote adds he mandatory space? Try clicking on my given example.