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

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

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

Post by jimisola »

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:

Code: Select all

\usepackage[swedish]{babel} % För svensk avstavning och svenska rubriker (t ex "innehållsförteckning)
\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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

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

Post by jimisola »

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

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

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

Post by jimisola »

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

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

Post by Sianis »

Hello!

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

Code: Select all

\documentclass[a4paper,11pt]{article}
\def\magyarOptions{defaults=prettiest}
\def\magyarOptions{hyphenation=huhyphn}
\usepackage[magyar]{babel}
\usepackage{t1enc}
\usepackage[latin2]{inputenc}
\usepackage{indentfirst}
\frenchspacing
\usepackage{times}
\usepackage[pdftex,pdftitle={Jegyzőkönyv},pdfauthor={Nyitrai István},bookmarksnumbered,colorlinks]{hyperref}
\title{Nyári gyakorlat jegyzőkönyv}
\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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

Hi Sianis,

t1enc is obsolete, times too. Instead of t1enc use fontenc, times is replaced by mathptmx.
Instead of

Code: Select all

\usepackage{t1enc}
\usepackage{times}
write

Code: Select all

\usepackage[T1]{fontenc}
\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
LaTeX.org admin
User avatar
Sianis
Posts: 3
Joined: Sun Aug 03, 2008 9:09 pm

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

Post by Sianis »

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

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

Post by dnet »

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.

Code: Select all

\usepackage[unicode]{hyperref}
\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
Post Reply