XeTeXLost Text Information after saving with Preview (Mac)

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
jdacu
Posts: 1
Joined: Thu Mar 15, 2012 8:46 pm

Lost Text Information after saving with Preview (Mac)

Post by jdacu »

Hello all,

I have a problem when saving a PDF using Preview.

I create a document using XeLaTeX and the document works fine just after it is created, it looks good, it can be searched, etc. The problem comes when I save the document using preview. For example if I add a note, or highlight something and save the document, it automatically losses all text information.

It can still be opened and looks good, but it cannot be searched any more. In addition, if I try to copy a part of the text all I get are some strange characters that look like a small square with a face on it.

If I do the same procedure (i. e. open, highlight some text, and save) using acrobat PDF reader, the file is still readable both in acrobat and preview.

It has to be fonts related, since it only happens when I use XeLaTeX or LaTeX with some specific fonts, but not with all of them.

Any idea of what can be the reason?


The problem can be reproduced creating a file with the code below and highlighting and saving with Preview.

Code: Select all

\documentclass{report}
\usepackage{fontspec,xltxtra,xunicode}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text]{Courier}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Courier}
\setmonofont[Scale=MatchLowercase]{Courier}

\begin{document}

Example test.

\end{document}

Thanks,
Last edited by localghost on Thu Mar 15, 2012 9:31 pm, edited 1 time in total.

Recommended reading 2024:

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

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

User avatar
justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

Lost Text Information after saving with Preview (Mac)

Post by justdeath »

Welcome to the forum!

But I am quite lost about something. You see XeTeX is the backend, which compiles your document. Are you using LyX, WinEdt to type your document? Then this is in the wrong forum.

Because when compiling from the command prompt everything is OK.
Both with xelatex and lualatex:

Code: Select all

\documentclass{report}
\usepackage{fontspec}
%,xltxtra,xunicode}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text]{Courier New}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Courier New}
\setmonofont[Scale=MatchLowercase]{Courier New}

\begin{document}

Example test.

\end{document}
And from where do you have Courier as TTF? I have only Courier New.

Nikolay
merv
Posts: 1
Joined: Tue Oct 16, 2012 1:38 am

Re: Lost Text Information after saving with Preview (Mac)

Post by merv »

I found this question from a google search and I'm having this Mac Preview issue as well, in non-TeX related PDFs. Though I also happen to be a (noob) LaTeX user.

After OCRing scanned documents, sometimes Preview loses all the text after saving my edits (annotations and highlighting). Highly frustrating. Preview is a great program for reading, making notes and highlighting, and haven't found anything like it, but these little quirks are bothersome. Another quirk is that if you save a file it will overwrite any logical page numbering such as roman numerals in the TOC and preface and such.

Have you found a solution to the lost text issue?

-Merv
User avatar
justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

Re: Lost Text Information after saving with Preview (Mac)

Post by justdeath »

Hello there!

I don't have Mac, so I can't be of much help. But after reading some information on Wikipedia, I recommend that you install Skim and see if the problem persists.

http://en.wikipedia.org/wiki/Skim_%28software%29
http://skim-app.sourceforge.net/

jd
Post Reply