XeTeXUse Norwegian characters in LuaLaTeX

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Use Norwegian characters in LuaLaTeX

Post by drgz »

Hello,

not sure if this is the best sub-forum to place this (maybe a mod. can move it if it's more appropriate elsewhere) but I'll try.

I'm trying to compile a document which includes Norwegian characters with LuaLaTeX.

My preamble looks like the following

Code: Select all

Code, edit and compile here:
\documentclass[11pt,a4paper,norsk]{article}
\usepackage{fontspec}
\setmainfont{XITS}
\usepackage{marvosym}
\usepackage[pdftex]{graphicx}
\usepackage[obeyall]{siunitx}
\pagestyle{empty}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Somewhere in the text I have a word gjennomføre, which obviously includes the norwegian character ø.

However, when the compiler gets to this line I get the following error

Code: Select all

! String contains an invalid utf-8 sequence.
l.63 gjennomf
�re 45\\
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Is there any package I need to include, or anything special I need to do in order to be able to use these characters?

I know that the XITS font supports these characters (tested in MS Office 2007), so that's not the problem. However, since I'm new to LuaLaTeX / XeLaTeX I haven't been able to figure this out yet.

I'm running TeXLive2010 pretest on my Ubuntu 10.04 (32bit) distro, if that should matter.

Any help is appreciated!

Best regards,

D.
Last edited by drgz on Tue Aug 17, 2010 7:15 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Use Norwegian characters in LuaLaTeX

Post by josephwright »

What character set is the file saved in? Can you post a minimal working example rather than just a snippet? Perhaps upload your source so we can see the encoding in use.
Joseph Wright
drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Re: Use Norwegian characters in LuaLaTeX

Post by drgz »

Well, after reading your reply I have to say that I feel like the biggest idiot alive. I had forgotten to make sure that the document was in UTF-8 encoding, so once I copied the same text into a document encoded properly it compiled as desired.

Now I just need to have a post-it on my desk reminding me on that whenever I write documents to be compiled with (Lua/Xe)LaTeX I must encode the document in UTF-8. ;)

As I see this problem as solved I'd like to thank you for the help. Mentioning the encoding got me on the right track.

Best regards,

D.

**

Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Use Norwegian characters in LuaLaTeX

Post by localghost »

drgz wrote:[…] Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?
The English alphabet doesn't contain any special characters like e. g. most of the European languages. So source files for documents in English are independent of the input encoding.


Best regards
Thorsten
drgz
Posts: 44
Joined: Sat Apr 18, 2009 8:40 pm

Use Norwegian characters in LuaLaTeX

Post by drgz »

localghost wrote:
drgz wrote:[…] Just one question in the end; how come the document does not need to be encoded in UTF-8 when the text is in English? I mean, earlier today I compiled some other documents which are entirely in English without any problems, and they all are written with Notepad++ with ASCII encoding. Is this just something that's needed when the text is non-English?
The English alphabet doesn't contain any special characters like e. g. most of the European languages. So source files for documents in English are independent of the input encoding.


Best regards
Thorsten
I should have guessed that; but thanks for clarifying.

Best regards,

D.
Post Reply