2

This is more or less a followup to a previous question which I asked with in mind and regarding another document class (letter-classic).

Right now I am struggling to be able to mix German, Icelandic and Ukrainian glyphs in a particular KOMA-Script-based class (komacv combined with komacv-multilang).

The outcome of the following MWE (using scrlttr2) illustrates the issue I am running into.

\ifdefined\directlua\else
    \errmessage{LuaTeX is required to typeset this document}
    \csname @@end\expandafter\endcsname
\fi
\documentclass[11pt,a4paper]{scrlttr2}
\usepackage[ukrainian,icelandic,german,english]{babel}
\usepackage{lmodern}

\newcommand{\UKR}[1]{\foreignlanguage{ukrainian}{#1}}
\newcommand{\ISL}[1]{\foreignlanguage{icelandic}{#1}}
\newcommand{\DEU}[1]{\foreignlanguage{german}{#1}}

\begin{document}

    \begin{letter}{Troll family\\\ISL{Elliðaárdalur}\\\ISL{999 Reykjavík}\\ICELAND}
        \setkomavar{fromname}{\UKR{Николай Васильевич Гоголь} (Gogol)}
        \setkomavar{fromaddress}{\UKR{Вулиця Богдана Хмельницького 123\\01234 Київ\\Україна}}

        \opening{Folks,}

        do you know the current address of the \ISL{Jólasveinar} and/or their parents \ISL{Grýla} and \ISL{Leppalúði}?

        \closing{\ISL{Með kveðju,}}

        \ps{PS: feel free to send your return return to the following address instead:\\\DEU{Mäxchen Mustermann\\Musterstraße 123\\12345 Musterstadt\\GERMANY}}
    \end{letter}

\end{document}

looks as follows:

Outcome of the MWE

As you can see none of the Cyrillic characters are rendered which makes me think that the selected font doesn't provide these characters or something along those lines. Both the Icelandic (ð, á, ó, í) and the German (ä, ß) characters render just fine, though.

If I replace \usepackage{lmodern} by \usepackage{biolinum} or \usepackage{libertine} respectively, it also works, but it's not the font family I would like to use (\usepackage{libertineRoman} gets pretty close, though).

Q: What is it I need to do in order to be able to mix these languages and glyphs from these languages in the same LaTeX document when using with the Latin Modern font family?

NB: I am on Linux Mint with TexLive. Also, I reckon that my use of \foreignlanguage isn't strictly necessary to evoke the issue.

  • 3
    latin modern doesn't have the cyrillic glyphs, so you will have to use another font at least for this language. Side remark: icelandic.ldf looks outdated, it still refers to EU1/EU2 instead of TU encoding. – Ulrike Fischer Mar 25 at 22:57
  • While icelandic.ldf still identifies the Unicode encodings as EU1/EU2, babel selects correctly the strings to be used in LuaTeX or XeTeX. With the fonts suggested by @egreg, it works with babel. – Javier Bezos Apr 8 at 17:50
6

The lmodern package should not be used with XeLaTeX or LuaLaTeX.

Also, support for Icelandic in babel has not yet been updated for using the TU encoding. Moreover the Latin Modern font does not support Cyrillic.

Here's the same with fontspec and polyglossia, using the CMU fonts (which are Unicode clones of Computer Modern).

\documentclass[11pt,a4paper]{scrlttr2}

\usepackage{polyglossia}
\usepackage{fontspec}

\setmainfont{CMU Serif}
\setsansfont{CMU SansSerif}
\setmainlanguage{english}
\setotherlanguages{ukrainian,icelandic,german}

\newcommand{\UKR}[1]{\foreignlanguage{ukrainian}{#1}}
\newcommand{\ISL}[1]{\foreignlanguage{icelandic}{#1}}
\newcommand{\DEU}[1]{\foreignlanguage{german}{#1}}

\begin{document}

\begin{letter}{Troll family\\\ISL{Elliðaárdalur}\\\ISL{999 Reykjavík}\\ICELAND}
\setkomavar{fromname}{\UKR{Николай Васильевич Гоголь} (Gogol)}
\setkomavar{fromaddress}{\UKR{Вулиця Богдана Хмельницького 123\\01234 Київ\\Україна}}

\opening{Folks,}

do you know the current address of the \ISL{Jólasveinar} and/or their 
parents \ISL{Grýla} and \ISL{Leppalúði}?

\closing{\ISL{Með kveðju,}}

\ps{PS: feel free to send your return return to the following 
address instead:\\
\DEU{Mäxchen Mustermann\\Musterstraße 123\\12345 Musterstadt\\GERMANY}}
\end{letter}

\end{document}

enter image description here

  • It is the anniversary of the date of my 20th year of university degree. – Sebastiano Mar 25 at 23:37
  • @egreg: polyglossia can be used with LuaLaTeX now? Thanks for pointing out the CMU font family. That one looks perfectly acceptable as a replacement. – 0xC0000022L Mar 26 at 16:14
  • Also @egreg could you point at a source for the statement that lmodern should not be used with either of the mentioned engines. I am always seeing such statements, but I somehow never get to see the reasoning behind these suggestions. Thanks. Btw: tried this with LuaLaTeX and it didn't work for me with polyglossia ... – 0xC0000022L Mar 26 at 16:36
  • 1
    @0xC0000022L Just look at the lmodern.sty file: it contains nothing good for LuaLaTeX. The picture was produced with LuaLaTeX; “doesn't work” is not sufficient, sorry. – egreg Mar 26 at 16:40
  • See my comment above - icelandic works with babel- – Javier Bezos Apr 8 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.