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.
General ⇒ Package UTF8 inputenc Error: how to fix it?
Package UTF8 inputenc Error: how to fix it?
- Attachments
-
- introduction.log
- Package inputenc Error log
- (26.59 KiB) Downloaded 1037 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Package UTF8 inputenc Error: how to fix it?
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¹
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Package UTF8 inputenc Error: how to fix it?
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.
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
Re: Package UTF8 inputenc Error: how to fix it?
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.
\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
Package UTF8 inputenc Error: how to fix it?
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.
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.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Package UTF8 inputenc Error: how to fix it?
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.
Of course you can add more glyphs to the mapping list.
[1] Adobe Glyph List - Wikipedia, the free encyclopedia
Code: Select all
\usepackage{selinput}
\SelectInputMappings{%
agrave={à},
ccedilla={ç},
Euro={€}
}
[1] Adobe Glyph List - Wikipedia, the free encyclopedia
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Package UTF8 inputenc Error: how to fix it?
Thank you all for answers.
Please can i have an example of how to use the (U+00AD) hyphen? Thank you.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.