2

I use LyX to create my LaTeX files. Recently, when I've used LyX's pdflatex to view my file, the text looks fine, but when I attempt to copy it, I just get strange symbols. If I use LyX's dvipdfm, I can copy fine.

I've attempted to troubleshoot by using a minimal example (as follows) and pdflatex directly.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
here is some text
\end{document}

If I run pdflatex on this file, open it in Okular, and copy "here is some text", the clipboard contains "❤❡r❡ ✐s s♦♠❡ t❡1t". If, however, I remove the second line ( \usepackage[T1]{fontenc}) the pdf is created fine.

Has something gone wrong with pdflatex or LyX's defaults? What has changed? Also, how can I fix this problem while still using LyX?

Sparhawk
  • 494
  • 1
  • 6
  • 13
  • 2
    Related: http://tex.stackexchange.com/questions/64188/what-are-good-ways-to-make-pdflatex-output-copy-and-pasteable – Torbjørn T. Mar 01 '13 at 07:10
  • What fonts does pdflatex include? (see the end of the log file). – Ulrike Fischer Mar 01 '13 at 07:53
  • 1
    Does \usepackage{lmodern} make any difference? – JLDiaz Mar 01 '13 at 08:39
  • @TorbjørnT. I found that question too, but didn't think it directly answered my question. Also, I didn't really understand it all anyway, so it might be more relevant than I realise. – Sparhawk Mar 01 '13 at 09:23
  • @UlrikeFischer I'm not 100% sure which lines you mean, but here are some font-relevant lines: "LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5. LaTeX Font Info: ... okay on input line 5." This is repeated for T1/cmr/m/n, OT1/cmr/m/n, OMS/cmsy/m/n, OMX/cmex/m/n, U/cmr/m/n. Also, "{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) )" and finally "</home/sparhawk/ .texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1000.600pk> " – Sparhawk Mar 01 '13 at 09:24
  • No look at the very end of the log-file (of pdflatex). There should be pathes to real font files. You can also use check if your pdf reader has a menu which shows you the fonts of a document (adobe reader has it). – Ulrike Fischer Mar 01 '13 at 09:27
  • @JLDiaz I'm not sure where you meant to put that line, but if I create a new line between 1 and 2, and insert that text there, it does fix the problem. – Sparhawk Mar 01 '13 at 09:30
  • @Sparhawk, yes that was meant to be put in the preamble. It causes pdflatex to load a different set of fonts. Apparently your default fonts had a weird encoding. – JLDiaz Mar 01 '13 at 09:36
  • @UlrikeFischer I was looking in the log file referenced by the command-line output: i.e. Transcript written on test.log. That was all I really found regarding font paths. I downloaded Adobe Reader, and the font is Type: Type 3; Encoding: Custom; Actual Font: F15, Actual Font Type: Type 3. What is very strange is that it copies fine from Adobe Reader, as well as PDF-XChange Viewer. Both Okular and Evince fail. Perhaps it's a linux pdf package bug then… – Sparhawk Mar 01 '13 at 09:41
  • 3
    Type3 means bitmaps (the .600pk files in your comment above (did you edit it?)) and are certainly the source of the problem. Install the cm-super fonts (or use as suggested lmodern). (But I have no idea why it works with dvipdfm - perhaps it adds additional mapping informations to the pdf). – Ulrike Fischer Mar 01 '13 at 09:59
  • @UlrikeFischer That's it! Installing cm-super (via the Ubuntu repositories) solves the problem in pdflatex and LyX. Sorry, I did edit the comment above. I originally accidentally posted the working log. I thought I did it fast enough, but you read it before I edited! Please create an answer so I can accept it. Thanks so much! P.S. do I understand correctly that the fonts were required for Okular and Evince to view the pdf? But not required for pdflatex itself? – Sparhawk Mar 01 '13 at 11:01

0 Answers0