GeneralPackage UTF8 inputenc Error: how to fix it?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tonguim
Posts: 24
Joined: Fri Nov 06, 2009 4:32 pm

Package UTF8 inputenc Error: how to fix it?

Post by tonguim »

Hi all,

i have a "Package inputenc Error" when i run the command pdflatex, as the attachment shows. The document i'm working on is written in french language.
I don't know which distribution or latex editor i do use, since i've installed on my ubuntu operating system the whole latex package in command line running the following command: aptitude install latex.

Please, anyone knows how to fix the error i'm facing with? Thank you.
Attachments
introduction.log
Package inputenc Error log
(26.59 KiB) Downloaded 1037 times

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Package UTF8 inputenc Error: how to fix it?

Post by localghost »

The source code that produces this log would be much more interesting. Seems to me like you are using Unicode (UTF-8 encoding) but your file has not this format. Build a minimal working example (MWE) that shows exactly this behaviour. Note that your editor has to support Unicode as well.


Best regards and welcome to the board
Thorsten¹
tonguim
Posts: 24
Joined: Fri Nov 06, 2009 4:32 pm

Re: Package UTF8 inputenc Error: how to fix it?

Post by tonguim »

Hi Localhost,

thank you for your answer. As attachment, you will see the source code that generate the previous log file. About my editor name, how can i check it please? In recall i use Ubuntu operating system, and i compile my ".tex" in command line. So I don't use a graphic editor nor any one of "Latex community" list.

Thank you.
Attachments
introduction.tex
My source code
(31.12 KiB) Downloaded 1377 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Package UTF8 inputenc Error: how to fix it?

Post by frabjous »

By changing:

\usepackage[utf8]{inputenc}

to

\usepackage[utf8x]{inputenc}

I got it to work. Don't ask me why this works. Maybe one of the gurus can explain the difference.

Although there are some other errors in your document that need fixing too. There's an extra \end{itemize} at the end of section 1.2.3, and a stray "}" after "vpréemption" in the "Ressources" subsection.

For good measure, I'm uploading the resulting PDF.
Attachments
introduction.pdf
(96.2 KiB) Downloaded 958 times
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Package UTF8 inputenc Error: how to fix it?

Post by phi »

I recommend to avoid the utf8x option since the ucs package to which it belongs is not really supported anymore and breaks a lot of packages, e.g. csquotes. The problems in your document result from a few soft hyphens (U+00AD) that are not supported by the utf8 option. Replace them by the \- command.
There are some other errors in your document (a spurious \end{itemize} and closing brace) which you must fix. Also note that you have to care a bit about the quotation marks: see the babel manual (section 29) for details.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Package UTF8 inputenc Error: how to fix it?

Post by localghost »

Beside the remarks of phi you can try the selinput package from the oberdiek bundle. It offers an automatic selection of input encoding by means of a glyph list [1]. For French the usage of the package could look like shown below.

Code: Select all

\usepackage{selinput}
\SelectInputMappings{%
	agrave={à},
	ccedilla={ç},
	Euro={€}
}
Of course you can add more glyphs to the mapping list.

[1] Adobe Glyph List - Wikipedia, the free encyclopedia
tonguim
Posts: 24
Joined: Fri Nov 06, 2009 4:32 pm

Package UTF8 inputenc Error: how to fix it?

Post by tonguim »

Thank you all for answers.
phi wrote:The problems in your document result from a few soft hyphens (U+00AD) that are not supported by the utf8 option. Replace them by the \- command.
Please can i have an example of how to use the (U+00AD) hyphen? Thank you.
Post Reply