33
votes
Accepted
Decide between Polyglossia and Babel for LuaLaTeX in 2019
Here's some reasons why I prefer babel over polyglossia for LuaLaTeX.
babel's base is part of the LaTeX core packages actively developed, but polyglossia is only getting a few minor updates.
babel's ...
23
votes
Decide between Polyglossia and Babel for LuaLaTeX in 2019
There are 79 language definition files (gloss-XX) in the polyglossia folder. For a thorough comparison you would have to compare for every language how good the gloss-file is, if it works with ...
22
votes
Accepted
Write a package that is aware of the mainlanguage selected in babel or polyglossia
There are several possibilities. I'll present four different ways. The first two use directly or indirectly the macros \captions<lang> or \extras<lang> which are provided both by babel and ...
16
votes
Accepted
I get tofu instead of Lepcha (tibeto-burmese script)
There are multiple issues here (and the error message isn't for the reason you guessed):
fontspec does not know about Lepcha,
polyglossia does not know about Lepcha either, but that is ok,
your expex ...
13
votes
Accepted
Set hyphenation with polyglossia
As usual, in the example the lines are overfull on purpose, so as to force hyphenation.
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{nynorsk}
\begin{hyphenrules}{nynorsk}
\...
13
votes
Accepted
Polyglossia and hookrightarrow
The callback used by LuaTeX for inserting the penalties and spaces after punctuation should be disabled in math mode, but apparently it isn't.
Workaround until a fix is shipped out:
\documentclass{...
12
votes
Accepted
Prevent line break before :
There is a bug in gloss-french (or more precisely it hasn't been updated to the new xetex yet). The space/boundary has in the newer xetex versions another class. This avoids the break:
\documentclass[...
11
votes
Remove space before punctuation
Probably Polyglossia should offer the possibility of disabling the automatic spacing feature for French in certain contexts such as monospaced text. However, here's how you can do it:
\documentclass{...
11
votes
Accepted
Remove space before punctuation
This is another solution, without extra package.
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{french}
\makeatletter
\newcommand{\nospace}[1]{\nofrench@...
11
votes
Accepted
How can I retrieve (and conditionally act on) the language of my document?
polyglossia stores the main language name in the macro \xpg@main@language, so it's easy to achieve what you want.
Example:
\documentclass{article}
\usepackage{xstring}
\usepackage{fontspec}
\...
11
votes
Accepted
Uneven Line Spacing for Arabic Text using xelatex + memoir + plyglossia
What you are trying to do can be achieved but it will be difficult and frustrating. Questions tagged grid-typesetting contain many details on the matter. Long story short, (Xe)LaTeX is the wrong tool ...
11
votes
Accepted
Turkish small cap dotted 'i' in footnote
Load the font with the Language=Turkish option:
\documentclass[11pt]{memoir}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{turkish}
\setmainfont{Linux Libertine O}[
Language=...
10
votes
Accepted
Beamer in arabic language doesn't accept footnotes
This is a solution.
The option hyperfootnotes is the culprit of this behavior. So, when loading beamer, pass the option hyperfootnotes=false to hyperref, in this way:
\documentclass[hyperref={...
10
votes
Accepted
Latin text not hyphenated at all with LuaLaTeX and polyglossia
It's a bug in gloss-latin.ldf that doesn't advertise the pattern file name for LuaLaTeX.
Workaround: do it yourself.
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\...
10
votes
Accepted
[Babel/Polyglossia]: wrong hyphenation?
while i agree that the hyphenation is unfortunate and wrong, i happen to
have in my possession a printed copy of the dictionary from which the
british hyphenation patterns were generated. (The Oxford ...
10
votes
Accepted
Polyglossia doesn't accent limits (lím) in Spanish
In my opinion, “lim” is a symbolic abbreviation for “limes” (Latin), just like “sin” is for “sinus”.
The fact that the word is translated in various languages doesn't mean the symbol should follow. ...
10
votes
Accepted
How to obtain current language in polyglossia
I guess you are looking for something like this:
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{czech}
\setotherlanguage{english}
\begin{document}
\iflanguage{czech}{czech}{no}
...
10
votes
Accepted
polyglossia or bidi bug: [\d\.] gets inverted to [\.\d]
bidi tests for \if@Latin, so you can get around the problem by setting it to true:
\documentclass{book}
\usepackage{polyglossia}
\setotherlanguage{hebrew}
\makeatletter\@Latintrue\makeatother
\...
10
votes
Accepted
Problem with Polyglossia setting \textgreek after update to TeX Live 2018
fontspec recently changed the behaviour of \newfontfamily. \newfontfamily<cmd> now throws an error if <cmd> is defined. Earlier \newfontfamily would behave like \setfontfamily behaves now. ...
10
votes
Underbrace using STIX2 math font
One should load the mathtools package before the fontspec and/or unicode-math packages. Note: Since the polyglossia package loads fontspec automatically, you should also take care to load mathtools ...
10
votes
Accepted
How to force equal spaces around French quotation marks?
You can tell babel-french to use «» for the guillemets, but there is also a “command form”.
Note that whether you use spaces after « or before » is immaterial; however, remember “backslash-space” ...
9
votes
Accepted
Polyglossia ignores my custom hyphenation
It appears the main language is set up at begin document, it is still US English in the preamble, it works if you delay the setting:
\documentclass{article}
\usepackage{polyglossia}
\...
9
votes
Accepted
How to determine which languages have been loaded by babel or polyglossia?
With babel:
\documentclass{article}
\usepackage[english,ngerman,russian]{babel}
\begin{document}
\makeatletter Loaded languages: \bbl@loaded
\end{document}
I don't see any code in polyglossia which ...
9
votes
Accepted
Modify specific Hebrew "Alpha" numerals on page number
It looks like \alph (or rather, \@alph) is redefined to use the macro \@hebrew@numeral, which produces these numbers.
I'm redefining it to first look up if a number is bad and print something ...
9
votes
Turkish small cap dotted 'i' in footnote
I don't think it should be be needed but you can re-assert turkish in the footnote:
\documentclass[11pt]{memoir}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{turkish}
\...
9
votes
Is it possible to switch languages automatically without tags, in Polyglossia?
It is possible to do this with babel. This new preamble should work with your document, so long as you used \textenglish and \begin{sanskrit} instead of \devanagarifont. It requires luahbtex (...
8
votes
XeLaTeX: How to specify a different font family for Latin text within non-Latin text?
The package ucharclasses does this. For short insertions of text in other alphabets hyphenation shouldn't be a concern; for longer parts, using the various features of polyglossia is recommended.
\...
8
votes
Accepted
XeLaTeX: How to specify a different font family for Latin text within non-Latin text?
Just set the font for the other language like you do for the main language, and then use \text<otherlang>{...} for small portions of that language or \begin{<otherlang>} ... \end{<...
8
votes
Small Caps not Working
A problem with XeLaTeX is that it will use the font that your operating system recognizes as “Times New Roman” and there are several variants thereof around. In my experience, the feature most of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
polyglossia × 820xetex × 280
fontspec × 99
arabic × 85
luatex × 80
fonts × 70
hebrew × 69
babel × 64
languages × 59
hyphenation × 58
biblatex × 55
bidi × 45
greek × 30
right-to-left × 29
csquotes × 23
hyperref × 22
cyrillic × 20
beamer × 19
french × 19
indic × 18
tcolorbox × 17
table-of-contents × 16
errors × 15
footnotes × 13
tikz-pgf × 12