# How may I use selnolig for a bilingual document?

The great package selnolig offers support for the English or the German language. Maybe I have overseen it, but is there a possibility to change the language-option inside the document?

The best way would be to let it change by the macros of polyglossia.

Please see my MWE and the two images!

% arara: lualatex

\documentclass{article}
\usepackage{polyglossia}
\usepackage{microtype}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\setdefaultlanguage[%
,babelshorthands=true
]{german}
\setotherlanguage[%
,variant = british
]{english}
\usepackage[%
%,german
,english
]{selnolig}

\begin{document}
\noindent Auftakt, halftime\\
\begin{english}
Auftakt, halftime
\end{document}


german-option enabled:

english-option enabled:

Edit

It is possible to load both options and to get the correct result for my example. But I guess that there will be clashes between the rules (can't think of an example at the moment). Especially for the future version of selnolig which provides hyphenation rules as well. So my question could also be: Does selnolig recognize the current language when both local options are loaded? A babel solution would be fine, too, but I understand that I should use polyglossia with LuaLaTeX.

Edit 2

As can be seen in my new images, the answer to my last question is "no". The package searches for German/English words over the whole document ignoring the current language environment.

-

I honestly don't know how to achieve your objective via polyglossia's macros and options. I'd simply use the instruction

\usepackage[german,english]{selnolig}


in the preamble. Doing so enables both sets of selective ligature suppression rules. At this time, the package doesn't offer a method for disabling just one set of language rules once they've been loaded.

I'm aware of just a couple of conflicts between the package's German and English ligature suppression rules. Fortunately, these conflicts arise only if the rather pedantic [!] broadf option is enabled on the English-language side. E.g., the rule \nolig{ffing}{ff|ing} -- relevant for words such as ruffing and bluffing -- will inappropriately break up the fi ligature in the German words fünffingrig and Zwölffingerdarm. To overcome this conflict, one could provide the additional rules \keeplig{ffingrig} and \keeplig{ffinger}. (Not to worry, selnolig's rules that suppress the ff ligature in fünffingrig and Zwölffingerdarm are not affected by the provision of these additional \keeplig rules.) Aside: I may well drop the broadf option and the associated ligature suppression rules in a future version of selnolig.

The package does let you suspend its operations locally via a \uselig{...} instruction or globally via the directive \selnoligoff (and resume operations via \selnoligon). However, there's currently no option to suspend (or re-enable) just the German or just the English language-related rules -- let alone make the suspension and resumption of these rules depend on which language is the main or default language. I'd be curious to get any real-world feedback from users who need bilingual support and think this is an issue that needs to be addressed.

-
I'll try to mind the word Zwölffingerdarm in my report. Thank you Mico! –  LaRiFaRi Jun 18 '14 at 20:50
@LaRiFaRi - By the way, many thanks for the compliment about the "great" package! –  Mico Jun 18 '14 at 21:05
@LaRiFaRi - I just an overlap between the rule \nolig{fless}{f|less} (for words such as selfless) -- which is in the "basic", not the "broadf", group of rules -- and Mohnflesserl. Just in case your documents contain that word... –  Mico Jun 21 '14 at 18:34
Damn, the title is "Indigestion in the Duodenum due to Poppy Pastries." I fear, this makes your tool worthless for my work. –  LaRiFaRi Jun 21 '14 at 21:42