Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Icelandic, utf8 and utf8x in LaTeX

First of all, what's the difference between utf8 and utf8x in

\usepackage[utf8]{inputenc}
\usepackage[utf8x]{inputenc}

when used in LaTeX?

Secondly, what packages are required when writing an article in Icelandic using LaTeX? I found:

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

after experimenting a bit but I have a feeling some part of the code may be redundant. And even with them the aforementioned packages, the code inside

\begin{lstlisting}
...
\end{lstlisting}

isn't rendered with Icelandic characters when outputted through pdflatex in Ubuntu, although it works on my friend's computer (who's running Debian). What's missing?

like image 872
Iceland_jack Avatar asked Nov 25 '09 15:11

Iceland_jack


People also ask

What does \Usepackage UTF-8 ]{ Inputenc do in LaTeX?

In fact UTF-8 is so popular that the LaTeX team decided to make \usepackage[utf8]{inputenc} the default in LaTeX. Since the April 2018 release of LaTeX, LaTeX has automatically pre-loaded \usepackage[utf8]{inputenc} . That means that you no longer need to specify \usepackage[utf8]{inputenc} in order to use UTF-8 input.

What is UTF-8 package LaTeX?

Encoding. Overleaf uses the UTF-8 encoding for all text files. UTF-8 is the most widely used character encoding on the web today. You can use it to represent any unicode character, which includes an enormous variety of letters, numbers and symbols, including Greek letters and letters with accents.

What is UTF-8 package?

utf8 is an R package for manipulating and printing UTF-8 text that fixes multiple bugs in R's UTF-8 handling.


1 Answers

[UTF8] is "supported" by the LaTeX team and covers a fairly specific/limited range of unicode input characters. It only defines those symbols that are known to be available with the current font encoding.

[UTF8x], AFAIK, is no longer supported, but covers a much broader range of input symbols. I would recommend only trying it if [UTF8] doesn't do what you need.


Secondly, the listings package (and most other related packages that do character scanning) does not support UTF8 input. (If it's working on a friend's machine they must be using an 8-bit input encoding instead.) The listingsutf8 package provides a UTF8-compatible replacement for \lstinputlisting but not for the main lstlisting environment. Using XeLaTeX might help you here, however.

like image 83
Will Robertson Avatar answered Oct 12 '22 12:10

Will Robertson