When I try to copy some text from a Word page or pdf an paste it to LaTeX, I get the error below. Any idea how to fix this?

PS: I am using LaTeX on a Mac

While the text which I typed my self works perfectly

Birbirleriyle ilişkili $p$ tane değişkeni bir araya getirerek, az sayıda ve ilişkisiz ve kavramsal olarak anlamlı yeni değişkenler (faktörler, boyutlar) bulmayı amaçlayan amaçlayan çok değişkenli istatistiksel bir yöntemdir. 

The text below I copied & pasted from a pdf file yields the error below.

 Tanımlanan her faktör, değişkenler arasındaki ilişkinin ölçülmesi sonucu aynı özelliği ölçen birbiri ile ilişkili değişken setinden oluşur.

enter image description here

  • 2
    Can you add a copy/paste of the offending line, please? – egreg Apr 18 '15 at 16:57
  • @egreg, I have edited the question. – Günal Apr 18 '15 at 17:02
  • Sorry, but if I copy from the question I have no problem. Can you make a small example available somewhere? – egreg Apr 18 '15 at 17:04
  • @egreg, I produced an example and no problem at all. I suppose this has something to do with the rest of my code – Günal Apr 18 '15 at 17:09

LaTeX has problem with some of the characters with accents you used. This problem can be solved using various techniques:

  1. Add this into your preamble (and change your source file encoding to UTF-8):
\usepackage[utf8]{inputenc}   % Or \usepackage{fontspec} for XeLaTeX
\usepackage[english]{babel}   % Babel, replace with your language
\usepackage[T1]{fontenc}      % Font encoding
\usepackage{lmodern,cmap}     % lmodern font, correctly copyable characters in pdf
  1. Use XeLaTeX which uses UTF-8 encoding and has no problem with any UTF-8 characters. In order to use it just change your \usepackage[utf8]{inputenc} to \usepackage{fontspec}. Don't forget that your source tex file has to be in UTF-8, otherwise XeLaTeX will complain.
  2. Use LaTeX's accents instead of these characters, e.g. instead of ğ use \u{g}.

I have a feeling this happens when copying and pasting from PDFs, and it has more to do with your reader than your LaTeX IDE.

I bet if you copy+paste from your PDF to your notepad you'll get some weird characters for your utf8 ones (try to do this to see what happens).

The fact that you just mentioned there is no problem with the utf8 characters you directly type is what makes me believe there is a problem with your copying process ---Not that you are doing something wrong, is just the way these funny characters are interpreted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.