2

I am preparing a document in English.

In the preamble I have (amongst other things):

\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc} 
\usepackage[english]{babel}

There are two Icelandic words in the document containing the letters ð and Þ (uppercase þ).

So I change the preamble to my usual

\usepackage[icelandic]{babel}
\usepackage[T1]{fontenc}

But that changes the name of all the in-built beauties such as my \tableofcontents.

Is there an easy way around this perhaps by introducing a new language for only one paragraph?

snoram
  • 240
  • The babel package offers commands for switching the language inside the document. See e.g. http://tex.stackexchange.com/a/20991 . – gernot Sep 13 '16 at 20:50

2 Answers2

3

The main language in babel is the last specified language:

\usepackage[icelandic, english]{babel}

But I would not use icelandic for just two words. The symbols can be used as macros or direct, depending on the loaded input encoding (package inputenc). Thorn is not available in font encoding OT1, therefore font encoding T1 is used:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}
Two Icelandic words with \dh\ and \TH.
\end{document}

Result

Heiko Oberdiek
  • 271,626
  • This seems to work but without \uspackage{lmodern} which seems to conflict with \usepackage{boldline}... Also can't remember why I was using \usepackage[utf8]{inputenc} instead of \usepackage[T1]{fontenc}. Will hope the best. – snoram Sep 13 '16 at 20:59
  • 2
    @snoram you shouldn't use \usepackage[utf8]{inputenc} instead of \usepackage[T1]{fontenc} but very likely in addition. The two serve different purposes. (IIRC there is a question somewhere on tex.sx about that matter) – cgnieder Sep 13 '16 at 21:02
  • 2
  • @clemens What can I say? You saved my life! – snoram Sep 13 '16 at 21:21
2

The T1 encoding supports the letters:

\documentclass[11pt, a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\begin{document}

We can use Icelandic letters with no
problem: Ð ð Þ þ

\end{document}

enter image description here

Beware that not all fonts support the letters, even in T1 encoding, so check carefully if you use a different font.

egreg
  • 1,121,712