TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on an essay written in LaTeX form. I'm facing problems with ligatures - in my pdf output (rendered using pdftex) opened in Adobe Reader I get X's and V's when copy-pasting words including ligatures (ffi, fi, etc.).

I have tried both the cmap and the mmap package - I have tried the mmap package with and without the noTeX parameter without success. To speed up rendering time, I'm pre-compiling headers - can this cause problems do you think? I am putting the \usepackage{mmap} directly under the \documentclass command, however it is in the header that I have pre-compiled - do you suspect this might be of a problem? If so, what would you recommend I do? I would like to, as much as possible, keep my header-hierarchy for the sake of compiling time, but then again, if that's the only way to go then I'm willing to get rid of it.

I am using the Linux Libertine font - might this be of trouble?

Below is my header and the beginning and end of my document: http://latex.pastebin.com/51MUAfA6

The lettrine command and package is used to create dropped caps. I am on a Windows system, running the latest MiKTeX version. Is there anything else you would need to know in order to help me out?

share|improve this question
    
Why don't you try other fonts and other PDF viewers (with and without precompiling headers...) and compare the results? I do get the problem with the libertine package with Adobe Reader, but the same document copies and pastes correctly with the evince PDF reader. Switching to computer modern makes it work with either reader. – frabjous Oct 21 '10 at 16:42
up vote 30 down vote accepted

Try the following. And next time make an example with less fancy formatting. Concentrate on the problem.

\documentclass[a4paper,12pt]{article}

\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\input{glyphtounicode}

\pdfglyphtounicode{f_f}{FB00}
\pdfglyphtounicode{f_f_i}{FB03}
\pdfglyphtounicode{f_f_l}{FB04}
\pdfglyphtounicode{f_i}{FB01}

\pdfgentounicode=1
\begin{document}
ff fl ffi
\end{document}

You can get glyphtounicode.tex here http://pdftex.sarovar.org/misc/

share|improve this answer
    
I deemed it necessary to include the fancy formatting simply because I wasn't sure that it wasn't causing the problem. Your solution works but is somewhat hefty - are you sure there isn't a better way of doing this? I did a c&p in evince and that worked better - why doesn't AReader like ligatures? – Doggie52 Oct 21 '10 at 17:26
6  
The best would be that libertine corrects the glyph names. cmap will not work (it doesn't work with virtual fonts). ntg.nl/pipermail/ntg-pdftex/2009-December/003870.html, tug.org/TUGboat/Articles/tb29-1/tb91thanh-fonts.pdf – Ulrike Fischer Oct 21 '10 at 18:09
19  
@Doggie52: It's better that the person asking the question does the work of figuring out which aspects of their document are responsible for their problem, and removing everything superfluous. It makes it much easier for people to answer the question if it has only the minimal packages and formatting necessary to demonstrate the issue. That way you are likely to get more answers and better ones. – Lev Bishop Oct 21 '10 at 19:10
4  
I shall keep this in mind, Lev! – Doggie52 Oct 24 '10 at 10:10
1  
This does not, however, work if you compile with XeTeX/XeLaTeX, cf. tex.stackexchange.com/questions/110354/… – Sverre Apr 23 '13 at 19:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/4397/make-ligatures-in-linux-libertine-copyable-and-searchable
tex.stackexchange.com
crawl=CC-MAIN-2016-07
82002
application/http; msgtype=response
sha1:TEI7IOO3YIBPMJJRMYNKVBXD7QLBOZLM
<urn:uuid:d3b62732-f505-43c2-bb25-3a55b445e3fe>
2016-02-06T20:26:59Z
104.16.119.182
sha1:ZTJ5DR5B6G3GD5DDSU3JEPWMFY4F4UCU
<urn:uuid:0d0cf61f-2b00-4dd9-8327-159fcac348e9>
http://tex.stackexchange.com/questions/4397/make-ligatures-in-linux-libertine-copyable-and-searchable
response
<urn:uuid:d6f3d1e5-ac5e-4155-8c68-c6d4c546aab1>
robots: classic
hostname: ip-10-236-182-209.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2016-07
operator: CommonCrawl Admin
description: Wide crawl of the web for February 2016
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf