Is there a way to make the polyglossia
package solve the hyphenation problem that presents itself in the log as "Overfull \hbox
" automatically?
(Note: I find that having shorter lines—even for the entirety of the text—is much less worse than having protruding lines.)
I'm trying to get:
... end of line
end of line
... end of line
... end of line
…but what I have (and don't want) is:
... end of line
... overfullboxishere
... end of line
... end of line
Here's an example of an "overfull box" error:
Another question: that could be related: polyglossia
does not make hyphenation for other specified languages.
Example of "overfull box" error of other language with polyglossia
:
When I use the \textenglish
command, the problem seems to solve itself:
However, the resulting document is contaminated with \textenglish
, and I don't want \textenglish
in my document.
MWE
\documentclass[12pt]{article}
\usepackage{polyglossia}
\usepackage{lipsum}
\setdefaultlanguage{russian}
\setotherlanguages{english}
\setmainfont[Mapping=tex-text]{Times New Roman}
\begin{document}
\lipsum[1]
\begin{itemize}
\item Возможность работать с такими популярными как
% \textenglish{
MySQL, SQLite, PostgreSQL, Oracle, and Microsoft SQL Server.
%}
\end{itemize}
\lipsum[1]
\end{document}
Best Answer
In my opinion, the best strategy is still marking the parts in English as such. However, if your English words are just a few, there are alternative approaches.
With
ucharclasses
Define transitions to and from Latin characters.
With just Polyglossia
Define a set of hyphenation rules for the small number of words you need
The output is the same with the two methods. This still produces a small overfull box, but just 0.8pt, but there's not much to do about this apart from rewording.
Note that the
ucharclass
method is quite heavy, so using it for longer passages in English can slow down processing the file.