1

I am facing with issue which is also described in babel manual 1.1 Monolingual documents.

I have multi-language document and laualatex complies that for example france and german hyphenation is not preloaded. The document is typeset, but not correctly hyphenated.

In Chapter 2 Loading languages with language.dat, it is written that hyphenation patterns are loaded on the fly when requested by the language if the luatex is used. That's my case.

The mechanism has been devised based solely on language.dat. And there is writthen that "You must rebuild the formats if upgrading from a previous version." (I've been using the Miktex install for a few years now, just doing only update.)

At this point, I don't know what to do. I think I'm on the right track but I didn't find the language.dat file in the Miktex distribution and I don't know where it should be located.

I use the babel in following way:

 \RequirePackage[main=czech,greek,russian,ngerman,english,french]{babel}
    \babelfont[greek]{rm}{Cambria}
    \babelfont[russian]{rm}{Cambria}
    \babelfont[ukrainian]{rm}{Cambria}
    \babelfont[ngerman]{rm}{Cambria}
    \babelfont[english]{rm}{Cambria}
    \babelfont[italian]{rm}{Cambria}
    \babelfont[french]{rm}{Cambria}

% https://tex.stackexchange.com/questions/544153/devanagari-typesetting-in-windows-texmaker-miktex \newfontfamily\sanskritfont{Shobhika}[ Script = Devanagari, Language = Sanskrit] \newfontscript{Devanagari}{deva} \babelfont[sanskrit-devanagari]{rm}{Shobhika}

\setlocalecaption{czech}{chapter}{Přednáška} \newcommand{\GREEK}[1]{\foreignlanguage{greek}{#1}} \newcommand{\GERMAN}[1]{\foreignlanguage{ngerman}{#1}} \newcommand{\ITALY}[1]{\foreignlanguage{italian}{#1}}
\newcommand{\FRENCH}[1]{\foreignlanguage{french}{#1}}
\newcommand{\ENG}[1]{\foreignlanguage{english}{#1}}

Package babel Warning: No hyphenation patterns were preloaded for (babel) the language `LANG' into the format. (babel) Please, configure your TeX system to add them and (babel) rebuild the format. Now I will use the patterns (babel) preloaded for \language=0 instead on input line 57.

@Javier Bezos ask me for MNWE. I tried to keep everything to a minimum. I apologize that the text of the paragraph is in Czech.

MNWE:

\documentclass[12pt]{scrbook}
\usepackage{geometry}
\geometry{a6paper}

% https://tex.stackexchange.com/questions/544153/devanagari-typesetting-in-windows-texmaker-miktex

% https://tex.stackexchange.com/questions/455788/ \usepackage[czech]{babel} \babelfont[greek]{rm}{Cambria}

% https://tex.stackexchange.com/questions/544153/devanagari-typesetting-in-windows-texmaker-miktex \newfontfamily\sanskritfont{Shobhika}[ Script = Devanagari, Language = Sanskrit] \newfontscript{Devanagari}{deva} \babelfont[sanskrit-devanagari]{rm}{Shobhika}

\setmainfont{TeX Gyre Termes} % {TeX Gyre Pagella}

\begin{document} Ve třetí části velkého indického eposu Mahábhárata se mocný duch Jakša ptá nejstaršího a nejmoudřejšího Pánduovce \foreignlanguage{sanskrit-devanagari}{पाण्‍डव} o němž pojednává staroindický epos \emph{Mahábhárata}. Judhišthiry, jaké je největší ze všech mysterií.

Šiva (Devanágarí: \foreignlanguage{sanskrit-devanagari}{शिव})

Zdá se vám to podivné? Je to jako sledovat Slunce při úchvatném západu, kdy pomalu mizí za vzdálenými mraky. Avšak vy si náhle uvědomíte, že se nehýbe Slunce, ale že jev je způsoben otáčením zeměkoule. Ve své mysli spatříte celou naši planetu - včetně vás samotných - jak se otáčí na opačnou stranu směrem od Slunce. V tom okamžiku pohlédnete na svět

Greek: \foreignlanguage{greek}{Κύκλος γαλακτικός} \end{document}

In the lualatex log, it is complaining from fontspec - Language 'Sanskrit' not available for font'Shobhika' with script 'Devanagari'. Interestingly, the Sanskrit text is printed. What is disturbing is that the Czech word splitting at the end of lines does not work. See the picture below where I tried to circle the words that are not split.

Part of log file:

(C:/Users/HP/AppData/Local/Programs/MiKTeX/tex/generic/babel/locale/sa/babel-sanskrit-devanagari.tex) (./grain0089_a.aux

Package babel Info: The following font families will use the default (babel) settings for all or some languages: (babel) * \rmfamily = TeXGyreTermes(0) (babel) TeXGyreTermes:mode=node;script=latn;language=dflt;+tlig; at 12.0pt (babel) * \sffamily = lmss (babel) [lmsans12-regular]:+tlig; (babel) * \ttfamily = lmtt (babel) [lmmono12-regular]: (babel) There is nothing intrinsically wrong with it, but (babel) 'babel' will no set Script and Language, which could (babel) be relevant in some languages. If your document uses (babel) these families, consider redefining them with \babelfont.
(babel) Reported on input line 4.

enter image description here

JardaFait
  • 3,922
  • (1/2) Please, provide a minimal working example and the actual warnings shown, but it looks as a problem in the MikTeX configuration. Anyway, although unrelated: (1) don‘t use main= except if there of some kind of conflict; just place the main language at the end; (2) \babelfont{rm}{Cambria} is enough; no need to declare it for all languages where this font is used... – Javier Bezos Jan 08 '23 at 07:38
  • (2/2)... (3) sanskrit has not been declared; you can do it with \babelprovide; (4) note that for short texts in other languages, there is very often no need to declare them as class or package option; (5) don’t use \RequirePackage instead of \usepackage, except if necessary (difficult to say, because it’s not an MWE); (6) you are declaring the Sanskrit font twice. – Javier Bezos Jan 08 '23 at 07:38
  • @JavierBezos: it works well. I also use biblatex and package complains that "No localisation for language 'sanskrit-devanagari' loaded." That's probably for the next question. I suppose if I had a book in Sanskrit in my bibliography, there would be a problem. – JardaFait Jan 08 '23 at 14:01

1 Answers1

1

First, ignore altogether the warning shown by fontspec. It’s quite misleading and unuseful.

It seems there is a bug in the way babel loads languages on the fly, but there is an easy workaround: just declare sanskrit-devanagari explicitly:

\documentclass[12pt]{scrbook}
\usepackage{geometry}
\geometry{a6paper}

\usepackage[czech]{babel} \babelprovide[import]{sanskrit-devanagari} \babelfont{rm}{TeX Gyre Termes} \babelfont[greek]{rm}{Cambria} \babelfont[sanskrit-devanagari]{rm}{Shobhika}

\begin{document} Ve třetí části velkého indického eposu Mahábhárata se mocný duch Jakša ptá nejstaršího a nejmoudřejšího Pánduovce \foreignlanguage{sanskrit-devanagari}{पाण्‍डव} o němž pojednává staroindický epos \emph{Mahábhárata}. Judhišthiry, jaké je největší ze všech mysterií.

Šiva (Devanágarí: \foreignlanguage{sanskrit-devanagari}{शिव})

Zdá se vám to podivné? Je to jako sledovat Slunce při úchvatném západu, kdy pomalu mizí za vzdálenými mraky. Avšak vy si náhle uvědomíte, že se nehýbe Slunce, ale že jev je způsoben otáčením zeměkoule. Ve své mysli spatříte celou naši planetu - včetně vás samotných - jak se otáčí na opačnou stranu směrem od Slunce. V tom okamžiku pohlédnete na svět

Greek: \foreignlanguage{greek}{Κύκλος γαλακτικός} \end{document}

Javier Bezos
  • 10,003