LaTeX forum ⇒ GeneralEncoding problems with PDF (when cut-n-paste Word) Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Encoding problems with PDF (when cut-n-paste Word)

Postby jimisola » Mon Mar 24, 2008 6:25 pm

Hi!

I'm writing a thesis using (pdf)LaTeX and someone else is going to use part of my text in their report.

However, when using regular cut-n-paste from Acrobat Reader to Word the Swedish characters åäö are totally different and makes cut-n-paste more or less useless. The same goes for when I use "File -> Save As Text" in Acrobat Reader.

My LaTeX document contains the following regards charsets/languages etc:

  1. \usepackage[swedish]{babel} % För svensk avstavning och svenska rubriker (t ex "innehållsförteckning)
  2. \usepackage[latin1]{inputenc}


My Windows version is English as well as Word, but åäö has never been a problem before.
My friend has the same problem on his computer with quite similar Windows/Word configuration.

If anyone has an idea on how to work around this I'd appreciate it a lot as we are in a hurry.

Regards,
Jimisola

jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Postby jimisola » Mon Mar 24, 2008 6:59 pm

I fixed it by adding.

\usepackage[T1]{fontenc} % for cut-n-paste to work

Using cp1252 instead of latin1 might also be better when using Windows (MikTeX).

\usepackage[cp1252]{inputenc} & or latin1


However, the pdf document generated with T1 fontenc has a much lighter (not as dark) text than the pdf generated without T1.
Why is this? Can use T1 and still get the darker text?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8366
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Mar 24, 2008 7:11 pm

Hi Jimisola,

is the text quality lower after changing to T1 font encoding?
You can compare the fonts, if you open T1 and not-T1 both with the adobe reader and look into document properties, fonts. The fonts should be type 1, not type 3 (bitmap).
If that is the case, then you may consider installing the cm-super package, it contains T1 encoded computer modern fonts of type 1.

Stefan

jimisola
Posts: 22
Joined: Sat Feb 02, 2008 2:54 am

Postby jimisola » Mon Mar 24, 2008 7:26 pm

Stefan,

You were right on. The T1 version used type 3 and my system was missing cm-super. After installing it text quality went back to normal.

Thank you!

Jimisola

User avatar
Sianis
Posts: 3
Joined: Sun Aug 03, 2008 9:09 pm

Postby Sianis » Sun Aug 03, 2008 9:22 pm

Hello!

I have same problem under Ubuntu with TexLive and Kile. I write in hungarian.

  1. \documentclass[a4paper,11pt]{article}
  2. \def\magyarOptions{defaults=prettiest}
  3. \def\magyarOptions{hyphenation=huhyphn}
  4. \usepackage[magyar]{babel}
  5. \usepackage{t1enc}
  6. \usepackage[latin2]{inputenc}
  7. \usepackage{indentfirst}
  8. \frenchspacing
  9. \usepackage{times}
  10. \usepackage[pdftex,pdftitle={Jegyzőkönyv},pdfauthor={Nyitrai István},bookmarksnumbered,colorlinks]{hyperref}
  11. \title{Nyári gyakorlat jegyzőkönyv}
  12. \author{Nyitrai István}


Result of the pdflatex:
Looks like everything is ok, but not.

Image
Image
Image


Nyári gyakorlat jegyzőkönyv - after copy and paste - Nyári gyakorlat jegyz˝okönyv

Thanks for help.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8366
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Aug 03, 2008 11:12 pm

Hi Sianis,

t1enc is obsolete, times too. Instead of t1enc use fontenc, times is replaced by mathptmx.
Instead of
  1. \usepackage{t1enc}
  2. \usepackage{times}

write
  1. \usepackage[T1]{fontenc}
  2. \usepackage{mathptmx}

But, to improve copy&paste, you may have to use a different font. Try for instance \usepackage{lmodern} instead of times or mathptmx. If you want to keep a Times like font try TeX Gyre Termes.

Stefan
Site admin

User avatar
Sianis
Posts: 3
Joined: Sun Aug 03, 2008 9:09 pm

Postby Sianis » Mon Aug 04, 2008 7:14 am

Hi!

lmodern and tgtermes can generate better PDF with good and pastable fonts. PDF title still bad, but this isn't important.

Thank you for your help!

dnet
Posts: 1
Joined: Wed Apr 18, 2012 1:51 pm

Postby dnet » Wed Apr 18, 2012 1:56 pm

I found this thread and had the same problem with Hungarian accents in PDF title, but managed to solve it. If anyone else arrives on this post from a search engine, here's the solution: use separate usepackage and hypersetup lines like the following, and it works.

  1. \usepackage[unicode]{hyperref}
  2. \hypersetup{pdftitle={Árvíztűrő tükörfúrógép}}


For further explanation and more links, see my blog post about this topic: http://techblog.vsza.hu/posts/Accented_ ... ields.html


Return to “General”

Who is online

Users browsing this forum: No registered users and 9 guests