GeneralMessed up charset

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Messed up charset

Post by Monkey D »

Things were working fine when I was using a latex template from Cambridge university.
But my university decided to provide a template for all dissertations.

The problem is that now, non-ascii characters get messed up.
For example, instead of "Stéphane Laveau" I get "StÃl’phane Laveau" or " Stéphane Laveau" (last on if I use inputenc package).
Going update all the names in the bib file isn't an option, because there are a lot of them and I don't have the time.

I tried to compare both template in order to identify the problem, but "items" I found suspicions I've set them equal.
In the .cls file I have:

Code: Select all

...
\DeclareOption{en}{%
  \let\@language=1%
  \PassOptionsToPackage{english}{babel}}
...
\ExecuteOptions{en,twoside,premei,print}
\ProcessOptions
....
....
\RequirePackage[latin1]{inputenc}
One thing I don't understand is how that code is translated to "\usepackage[english]{babel}"

On my linux system I use LANG=en_US.UTF-8 and use a portuguese keyboard.
Last edited by Monkey D on Thu Feb 07, 2008 4:50 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.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Messed up charset

Post by balf »

Did you write \usepackage[T1]{fontenc}?
And compile the bibliography with bibtex8bit?

B.A.
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Messed up charset

Post by Monkey D »

I've know set kile to use bibtex8 (even though I didn't need it with CU's latex template).
I've tried using "\usepackage[T1]{fontenc}" before, after and without the "\RequirePackage[latin1]{inputenc}" line.

No success :-(

The only difference is that now using bibtex8 when I build the project with Kile, it exits with error code 1 (but no error message), and have to built the project 2 more times (so 3 times instead of the common 2).


EDIT:
I noticed this entry in my current class file (the one provided by my university, which is giving me this headache):

Code: Select all

\global\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
I also tried to include CU's bibfile (.bst) but it doesn't fix this charset problem (the file is processed because I see that the bibliographic presentation is changed).
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Messed up charset

Post by balf »

Did you try \usepackage[utf8]{inputenc}? There is also a 'unicode' package.

B.A.
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Re: Messed up charset

Post by Monkey D »

THANK YOU! :mrgreen:
It worked!

I still don't understand from where the problem comes from, since the CU template worked fine without having to do any extra configuration... But oh well... Latex is a black magic thingy...
balf
Posts: 158
Joined: Sat Jan 12, 2008 1:11 am

Re: Messed up charset

Post by balf »

Perhaps, when it worked fine, your linux system didn't use utf-8 encoding?

B.A.
Monkey D
Posts: 22
Joined: Thu Nov 01, 2007 6:12 pm

Re: Messed up charset

Post by Monkey D »

I don't think I changed anything on my Linux system. Nonetheless, even if I did, I can still build the pdf fine with the other template (the one that always worked fine)... so any change would be irrelevant IMO.
Post Reply