[Tex/LaTex] Compatibility issues with WinEDT. How to fix it

windowswinedt

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!

Best Answer

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.