4

I've been having compatibility issues when using MikTeX with WinEDT on a Windows 7 laptop. More particularly, when I go to open certain .tex documents that someone else has been working on with a different computer and editor, strange characters appear in the file where they shouldn't, e.g. the  character occurring in the middle of "maximum" like this "maxiÂ-mum". And when I try to build the .tex document, it fails and gives errors such as:

! Package inputenc Error: Keyboard character used is undefined
(inputenc)                in inputencoding `latin1'.

Looking on this site, I found this question which seems to be about the same problem I'm having Kile document doesn't work well in WinEdt. How do I convert it? However, I tried some of the suggestions mentioned there but I couldn't get them to work. First I tried downloading TeXStudio, which was mentioned in one of the comments as being able to work with UTF-8 encoding, but I still get problems with this. Specifically, the strange characters no longer appear in the .tex file when I open it in TeXStudio, but if I build a pdf, the strange characters now appear in the .pdf file. I also tried opening the .tex files in WinEDT using the UTF-8 option, and although the strange characters don't appear in the .tex document when I do this, it still won't build and returns the same errors that I get when I don't open it using the UTF-8 option.

If anyone knows a TeX editor that is more compatible than WinEDT or has an idea of how I can fix the issues I've been having WinEDT or TeXStudio, it would be much appreciated!

7
  • Do you know what encoding this 'other person' might be using? Can you post a small example somewhere that we can check? It's possible you are being sent files that are saved in an encoding that WinEdt is not auto-detecting, but without a file it's hard to say.
    – Joseph Wright
    Commented Aug 14, 2012 at 19:46
  • Thanks for your quick reply! Unfortunately this is a project which a number of different people have been working on over a number of years and I've only started on it recently, so I'm not sure who has been working on these files before me to ask about the encoding. What sort of example should I post? Thanks for your help!
    – Becky
    Commented Aug 14, 2012 at 19:57
  • A link to somewhere we can download a file showing the 'odd' characters is what is needed. We can then take a look and see what the encoding actually is, and might then be able to give more advice.
    – Joseph Wright
    Commented Aug 14, 2012 at 20:01
  • 1
    The option is called utf8. But stop to change your files you can confuse the encoding completly. I hope you still have the original files. Compile them at first without changing anything, then check the pdf and look how non-ascii chars where printed. If they did come out right then you will know from the inputenc option the encoding of the file and can start to figure out how to tell it winedt. Btw: Absolutly no encoding problem will insert funny chars in the middle of maximum. It must already have been there (e.g. as accent or non breakable space). Commented Aug 15, 2012 at 7:39
  • 1
    Continuing: And because of the funny chars in maximum I think that the original files are incorrect and that you will already get errors with the original files. Beside this you should mention which winedt version you are using. There have been major changes between winedt 6 and 7. Commented Aug 15, 2012 at 7:46

2 Answers 2

3

Because it it too long for an comment this answer. I'll try to show you the reason for your errors.

Try to compile the follwing MWE:

\documentclass{article}

\usepackage{lmodern}            % Latin Modern
\usepackage[T1]{fontenc}        % Font encription
%\usepackage[utf8]{inputenc}    % input encription utf-8
 \usepackage[latin1]{inputenc}  % input encription Latin1

\begin{document} 
Test to test encoding (this is written in utf-8): äöüß ÄÖÜ 

\end{document}

You should get errors. Now delete the % sign (line utf-8) and comment the following line (latin1). Compile. Now you should have no errors.

The reason is that file and encoding information are not the same. They have to be the same.

With WinEdt you can store a file as utf-8 with file-- Save as and set file-type to :UTF-8.

If this MWE runs for you try to copy some lines from your tex file into the MWE and try to compile it. Try to save it as utf-8. Hope this helps you.

Update: I just installed WinEDT and found TeX in the bottom line. Click on TeX and you will get a window like this:

WinEDT

Now click on CP Converter and you can see the encription code WinEDT found and you can change it.

0
0

When I used this program, I came across a similar problem. I believe that WinEdt uses strictly ANSI. If the file is saved in another encoding (UTF8), I got this similar error. Helped me when I opened the file in another editor such as Notepad ++ and switched encoding to ANSI. For some characters, I had to done a manual correction.

2
  • 2
    The current version of WinEdt (7.0, around since February or March) is fully unicode-compliant.
    – Mico
    Commented Aug 14, 2012 at 21:34
  • 2
    Even older versions on winedt could handle (a restricted) utf8. Commented Aug 15, 2012 at 7:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .