GeneralIssue with Accents in TXC2b1

General information and discussion about TeXnicCenter
Post Reply
scalpas
Posts: 2
Joined: Fri Feb 22, 2013 2:46 am

Issue with Accents in TXC2b1

Post by scalpas »

Hi everyone

I've just found this weird bug with TeXnicCenter (TXC). I have two versions installed :
  • TXC2.0 beta 1 (64 bit) (referred to below as 2b1)
  • TXC1.0 RC1 (referred to as 1RC)
My PC is running Win 7 pro in French.

EDIT : a quick summary, before the long description. When I create a project in 2b1, the accents aren't displayed properly. If I open the project in 1RC, within TXC, the accents are also displayed incorrectly. Adding new text with no accents in 1RC changes nothing, but adding text with accents in 1RC causes all new text added in either version to be displayed correctly. Finally, I did similar tests creating just a tex file in 2b1, and a project in 1RC, and I observed no problem.

I've done my best to describe step by step what happens, but it's a bit long, so please bear with me. :)
  1. In 2b1, I create a new project, using the general/empty project template. I then type the following code :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    \end{document}
    I then build the output, with the latex=>PDF profile, and I get this :
    output1.pdf
    (18.33 KiB) Downloaded 470 times
  2. I close the project, and open it with 1RC. The code looks like this :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    \end{document}
    When I compile the output, I get the same output as in step 1. Interestingly, if I open the .tex file in note pad, the code looks like :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    \end{document}
  3. I close the project, and open it in 2b1 again. Everything happens as in step 1, and in TXC, the code looks like :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    \end{document}
  4. I close the project, open it in 1RC, and add some new text, with no accents :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    blablabla
    \end{document}
    I get the following output :
    output2.pdf
    (18.89 KiB) Downloaded 491 times
  5. I close the project, and open it in 2b1. The code looks like :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    blablabla
    \end{document}
    The output is the same as in the previous step.
  6. I close the project and open it in 1RC. This time I add some text with accents :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    blablabla
    àààà
    \end{document}
    I get the following output :
    output6.pdf
    (19.14 KiB) Downloaded 453 times
  7. Yet again, I close the project, and open it with 2b1. This time the code has changed, and looks like :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    blablabla
    àààà
    \end{document}
    When compiling, I get the same output as in step 6. At this stage, if I open the .tex in notepad, it now looks like the code pasted just above.

    From this point onwards, I can add text, with or without accents, in either version, and all the new text behaves normally (ie the accents are displayed properly).
  8. Now, if I create just a .tex file (not a project) in 2b1, with the following code :

    Code: Select all

    \documentclass{article}
    \usepackage[latin1]{inputenc}
    \usepackage[francais]{babel}
    \begin{document}
    ééé
    \end{document}
    The output in this case is fine:
  9. Finally, if I create a project in 1RC, and open it in 2b1, there is no problem displaying accents.
I'm sorry this post is so long. Can somebody help me out here. This took me a long time to work out: I started out on 2b1, and had no idea why the accents weren't being displayed properly! :? Also, I'm about to start writing my PhD thesis in French, and I really can't afford to suddenly have all my accents replaced by weird characters ! ;)

Thanks for reading !

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Issue with Accents in TXC2b1

Post by MartinC »

It is because your first project is in UTF-8 encoding (Unicode) and you use latin1 for inputenc. You can either:
  1. Save your latex file with ANSI encoding (in the Save As menu).
  2. Use \usepackage[utf8]{inputenc}.
Last edited by localghost on Fri Feb 22, 2013 10:43 am, edited 2 times in total.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Issue with Accents in TXC2b1

Post by localghost »

Forget TXC1 RC1 completely. It doesn't manage Unicode. For European languages like French you can use a semi-automatic determination for the input encoding by the selinput package from the oberdiek bundle. The following lines replace inputenc.

Code: Select all

\usepackage{selinput}  % semi-automatic determination
\SelectInputMappings{  % of input encoding by a
  agrave={à},          % list of selected glyphs
  ccedilla={ç},        % see: http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
  eacute={é}
}

Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Issue with Accents in TXC2b1

Post by MartinC »

Ok, but you don't need Unicode to write in french. ANSI is sufficient.
scalpas
Posts: 2
Joined: Fri Feb 22, 2013 2:46 am

Re: Issue with Accents in TXC2b1

Post by scalpas »

Thanks for your help, all three solutions work !

Thorsten, re your comment about RC1, I've worked with it for years and never had any trouble with accents.

And another question: is there any particular reason to choose either ANSI or Unicode?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Issue with Accents in TXC2b1

Post by localghost »

scalpas wrote:[…] Thorsten, re your comment about RC1, I've worked with it for years and never had any trouble with accents. […]
It is simply outdated and can't even be downloaded any more. Furthermore it has several deficiencies which cause problems. And these do not only concern the encoding.
scalpas wrote:[…] And another question: is there any particular reason to choose either ANSI or Unicode?
Unicode provides all characters you can think of in different languages, especially Asian languages, Arabic, Hebrew and much more. ANSI is based on ASCII, thus very limited. ANSI represents the past, Unicode is the present and the future. The upcoming typesetting engines XeTeX and LuaTeX have native Unicode support.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply