emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* fontenc makes pdf non-searchable
@ 2015-03-21  4:47 Martin Leduc
  2015-03-21 16:24 ` William Denton
  2015-08-05  0:00 ` Bastien Guerry
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Leduc @ 2015-03-21  4:47 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

Hi all,
  I'm using org-mode to write a paper and export it to a pdf. It compiles just fine. 

However, when opening the experted pdf (with evince or okular) and searching for a word, the output from the search function is a list of words with apparently incorrect character encoding. 

I get the same result when compiling directly the exported tex file. However, if I remove the line:

\usepackage[T1]{fontenc}

the compiled pdf becomes correctly interpreted by the search function. According to the documentation of the org-article latex class, "There
is no facility to disable loading fontenc".

What should I do to make the pdf searchable with the org exporter ?

Thanks,
Martin

 		 	   		  

[-- Attachment #2: Type: text/html, Size: 968 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-21  4:47 fontenc makes pdf non-searchable Martin Leduc
@ 2015-03-21 16:24 ` William Denton
  2015-03-21 18:56   ` Martin Leduc
  2015-08-05  0:00 ` Bastien Guerry
  1 sibling, 1 reply; 12+ messages in thread
From: William Denton @ 2015-03-21 16:24 UTC (permalink / raw)
  To: Martin Leduc; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: TEXT/PLAIN, Size: 838 bytes --]

On 21 March 2015, Martin Leduc wrote:

> I'm using org-mode to write a paper and export it to a pdf. It compiles just fine.
>
> However, when opening the experted pdf (with evince or okular) and searching for a word, the output from the search function is a list of words with apparently incorrect character encoding.
>
> I get the same result when compiling directly the exported tex file. However, if I remove the line:
>
> \usepackage[T1]{fontenc}
>
> the compiled pdf becomes correctly interpreted by the search function. According to the documentation of the org-article latex class, "There is no facility to disable loading fontenc".

That seems odd to me.  Can you provide an ECM, a minimal complete example, that 
causes this problem?

Bill
-- 
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-21 16:24 ` William Denton
@ 2015-03-21 18:56   ` Martin Leduc
  2015-03-22 17:56     ` William Denton
  2015-03-23  7:18     ` Stefan Nobis
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Leduc @ 2015-03-21 18:56 UTC (permalink / raw)
  To: William Denton; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1426 bytes --]

Thanks for your response Bill.

You can find a minimal example here, with the org file, and the tex and pdf files generated from it. Firts try to search within the pdf. It does not work (at least on my side) To solve the problem, remove the line with 
\usepackage[T1]{fontenc}

in the tex file, and compile it. It should now search normally.

Martin 


> Date: Sat, 21 Mar 2015 12:24:31 -0400
> From: wtd@pobox.com
> To: mart_00@hotmail.com
> CC: emacs-orgmode@gnu.org
> Subject: Re: [O] fontenc makes pdf non-searchable
> 
> On 21 March 2015, Martin Leduc wrote:
> 
> > I'm using org-mode to write a paper and export it to a pdf. It compiles just fine.
> >
> > However, when opening the experted pdf (with evince or okular) and searching for a word, the output from the search function is a list of words with apparently incorrect character encoding.
> >
> > I get the same result when compiling directly the exported tex file. However, if I remove the line:
> >
> > \usepackage[T1]{fontenc}
> >
> > the compiled pdf becomes correctly interpreted by the search function. According to the documentation of the org-article latex class, "There is no facility to disable loading fontenc".
> 
> That seems odd to me.  Can you provide an ECM, a minimal complete example, that 
> causes this problem?
> 
> Bill
> -- 
> William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 2204 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-21 18:56   ` Martin Leduc
@ 2015-03-22 17:56     ` William Denton
  2015-03-22 23:52       ` Martin Leduc
  2015-03-23  7:18     ` Stefan Nobis
  1 sibling, 1 reply; 12+ messages in thread
From: William Denton @ 2015-03-22 17:56 UTC (permalink / raw)
  To: Martin Leduc; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: TEXT/PLAIN, Size: 752 bytes --]

On 21 March 2015, Martin Leduc wrote:

> You can find a minimal example here [1], with the org file, and the tex and pdf files generated from it. Firts try to search within the pdf. It does not work (at least on my side) To solve the problem, remove the line with
> \usepackage[T1]{fontenc}
>
> in the tex file, and compile it. It should now search normally.

"It works for me" is all I can say, which isn't too helpful.  Everything happens 
as it should, and I can search the PDF (in evince).  Maybe it's something with 
your LaTeX setup?  Sorry I can't suggest anything more.

Bill

[1] https://www.dropbox.com/sh/7s6di4en5ljbkcq/AAAzyQeg6VkMHnC1X9dQTg6ua?dl=0

-- 
William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-22 17:56     ` William Denton
@ 2015-03-22 23:52       ` Martin Leduc
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Leduc @ 2015-03-22 23:52 UTC (permalink / raw)
  To: William Denton; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

Hey  finally your response helped me a lot, that is the problem was probably on my side.

I solved it by installing the package cm-super, as suggested here. I still can't search in the pdf I gave you (and still wondering why YOU can), but re-exporting the org file makes a pdf that now works correctly.

Thanks again !
Martin






> Date: Sun, 22 Mar 2015 13:56:45 -0400
> From: wtd@pobox.com
> To: mart_00@hotmail.com
> CC: emacs-orgmode@gnu.org
> Subject: Re: [O] fontenc makes pdf non-searchable
> 
> On 21 March 2015, Martin Leduc wrote:
> 
> > You can find a minimal example here [1], with the org file, and the tex and pdf files generated from it. Firts try to search within the pdf. It does not work (at least on my side) To solve the problem, remove the line with
> > \usepackage[T1]{fontenc}
> >
> > in the tex file, and compile it. It should now search normally.
> 
> "It works for me" is all I can say, which isn't too helpful.  Everything happens 
> as it should, and I can search the PDF (in evince).  Maybe it's something with 
> your LaTeX setup?  Sorry I can't suggest anything more.
> 
> Bill
> 
> [1] https://www.dropbox.com/sh/7s6di4en5ljbkcq/AAAzyQeg6VkMHnC1X9dQTg6ua?dl=0
> 
> -- 
> William Denton ↔  Toronto, Canada ↔  https://www.miskatonic.org/
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 2150 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-21 18:56   ` Martin Leduc
  2015-03-22 17:56     ` William Denton
@ 2015-03-23  7:18     ` Stefan Nobis
  2015-03-23 16:07       ` J. David Boyd
  1 sibling, 1 reply; 12+ messages in thread
From: Stefan Nobis @ 2015-03-23  7:18 UTC (permalink / raw)
  To: emacs-orgmode

Martin Leduc <mart_00@hotmail.com> writes:

> You can find a minimal example here[1], with the org file, and the
> tex and pdf files generated from it. Firts try to search within the
> pdf. It does not work (at least on my side) To solve the problem,
> remove the line with \usepackage[T1]{fontenc}

Your PDF is not generated with pdflatex (or a newer engine like
lualatex), but with dvips and Ghostscript. Thus the fonts are not PS
Type 1 fonts, but Type 3 fonts (bitmap instead of vector; therefore
scaling/zooming will result in bad quality).

I'm not quite sure if this is also the root cause of the inability to
search. But if i recompile your tex-file (from [1]) with pdflatex, I
get Type 1 fonts and have no problems with searching.

Therefore I would suggest to switch the engine to pdflatex.

Another hint: You should try the Latin Modern font (put a
"\usepackage{lmodern}" after loading fontenc) -- it's the
(technically) modern variant of Computer Modern (the old TeX default
font). Lati Modern is available as OpenType font and has less problems
with Unicode and special characters like german umlauts (ä, ü,...) or
other non-ASCII letters.

And maybe you should also have a look at biblatex[2] (as a much more
flexible alternative to natbib).

[1] https://www.dropbox.com/sh/7s6di4en5ljbkcq/AAAzyQeg6VkMHnC1X9dQTg6ua?dl=0
[2] http://ctan.org/pkg/biblatex
-- 
Until the next mail...,
Stefan.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-23  7:18     ` Stefan Nobis
@ 2015-03-23 16:07       ` J. David Boyd
  2015-03-23 17:10         ` Stefan Nobis
  0 siblings, 1 reply; 12+ messages in thread
From: J. David Boyd @ 2015-03-23 16:07 UTC (permalink / raw)
  To: emacs-orgmode

Stefan Nobis <stefan-ml@snobis.de> writes:

> Martin Leduc <mart_00@hotmail.com> writes:
>
>> You can find a minimal example here[1], with the org file, and the
>> tex and pdf files generated from it. Firts try to search within the
>> pdf. It does not work (at least on my side) To solve the problem,
>> remove the line with \usepackage[T1]{fontenc}
>
> Your PDF is not generated with pdflatex (or a newer engine like
> lualatex), but with dvips and Ghostscript. Thus the fonts are not PS
> Type 1 fonts, but Type 3 fonts (bitmap instead of vector; therefore
> scaling/zooming will result in bad quality).
>
> I'm not quite sure if this is also the root cause of the inability to
> search. But if i recompile your tex-file (from [1]) with pdflatex, I
> get Type 1 fonts and have no problems with searching.
>
> Therefore I would suggest to switch the engine to pdflatex.
>
> Another hint: You should try the Latin Modern font (put a
> "\usepackage{lmodern}" after loading fontenc) -- it's the
> (technically) modern variant of Computer Modern (the old TeX default
> font). Lati Modern is available as OpenType font and has less problems
> with Unicode and special characters like german umlauts (ä, ü,...) or
> other non-ASCII letters.
>
> And maybe you should also have a look at biblatex[2] (as a much more
> flexible alternative to natbib).
>
> [1] https://www.dropbox.com/sh/7s6di4en5ljbkcq/AAAzyQeg6VkMHnC1X9dQTg6ua?dl=0
> [2] http://ctan.org/pkg/biblatex

And how did you determine that please?   And how would it be switched?

Dave

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-23 16:07       ` J. David Boyd
@ 2015-03-23 17:10         ` Stefan Nobis
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Nobis @ 2015-03-23 17:10 UTC (permalink / raw)
  To: emacs-orgmode

dboyd2@mmm.com (J. David Boyd) writes:

> And how did you determine that please?

I assume you mean how I determined that the PDF has been produced by
dvips and Ghostscript. In this case: I've just looked into the
document information of the PDF file. For example with Acrobat Reader
I just press CMD+D, with Apple Preview its CMD+I (look out in the
menus for document information or properties).

In this document information there is somewhere a line like "PDF
creator". If the PDF is created with pdftex or pdflatex, this line
should read something like "pdfTeX-1.40.15".

Each PDF viewer shows a different degree of details about the file.
For example with Apple Preview I do not see the used fonts, these are
only shown by Acrobat Reader (or command line tools like pdffonts from
xpdf).

> And how would it be switched?

The default settings of org-mode uses pdflatex. The compilation
process is configurable via the variable org-latex-pdf-process.

I don't know why and how Martin used dvips+gs. Maybe he just generated
the tex file with org and used another tool for generating PDF. Or
maybe he customized org-latex-pdf-process.

-- 
Until the next mail...,
Stefan.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
@ 2015-03-23 22:50 Martin Leduc
  0 siblings, 0 replies; 12+ messages in thread
From: Martin Leduc @ 2015-03-23 22:50 UTC (permalink / raw)
  To: Stefan Nobis; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

You're right, I customized org-latex-pdf-process, which now call a script that basically does latex/dvips/ps2pdf. 
I cannot use pdflatex since my figures are from eps images.

Martin


dboyd2 <at> mmm.com (J. David Boyd) writes:

> And how did you determine that please?

I assume you mean how I determined that the PDF has been produced by
dvips and Ghostscript. In this case: I've just looked into the
document information of the PDF file. For example with Acrobat Reader
I just press CMD+D, with Apple Preview its CMD+I (look out in the
menus for document information or properties).

In this document information there is somewhere a line like "PDF
creator". If the PDF is created with pdftex or pdflatex, this line
should read something like "pdfTeX-1.40.15".

Each PDF viewer shows a different degree of details about the file.
For example with Apple Preview I do not see the used fonts, these are
only shown by Acrobat Reader (or command line tools like pdffonts from
xpdf).

> And how would it be switched?

The default settings of org-mode uses pdflatex. The compilation
process is configurable via the variable org-latex-pdf-process.

I don't know why and how Martin used dvips+gs. Maybe he just generated
the tex file with org and used another tool for generating PDF. Or
maybe he customized org-latex-pdf-process.

-- 
Until the next mail...,
Stefan. 		 	   		  

[-- Attachment #2: Type: text/html, Size: 1662 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-03-21  4:47 fontenc makes pdf non-searchable Martin Leduc
  2015-03-21 16:24 ` William Denton
@ 2015-08-05  0:00 ` Bastien Guerry
  2015-08-08  2:30   ` Martin Leduc
  1 sibling, 1 reply; 12+ messages in thread
From: Bastien Guerry @ 2015-08-05  0:00 UTC (permalink / raw)
  To: Martin Leduc; +Cc: emacs-orgmode@gnu.org

Hi Martin,

Martin Leduc <mart_00@hotmail.com> writes:

> However, when opening the experted pdf (with evince or okular) and
> searching for a word, the output from the search function is a list
> of words with apparently incorrect character encoding.
>
> I get the same result when compiling directly the exported tex file.
> However, if I remove the line:
>
> \usepackage[T1]{fontenc}
>
> the compiled pdf becomes correctly interpreted by the search
> function. According to the documentation of the org-article latex
> class, "There is no facility to disable loading fontenc".
>
> What should I do to make the pdf searchable with the org exporter ?

I would try to remove the relevant entry from
`org-latex-default-packages-alist'.  Did you try this?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-08-05  0:00 ` Bastien Guerry
@ 2015-08-08  2:30   ` Martin Leduc
  2015-08-08  8:48     ` Bastien
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Leduc @ 2015-08-08  2:30 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]

Hi Bastien,  thanks a lot for your response but I finally solved the issue by installing the package cm-super.
Cheers,
Martin

> From: bzg@gnu.org
> To: mart_00@hotmail.com
> CC: emacs-orgmode@gnu.org
> Subject: Re: fontenc makes pdf non-searchable
> Date: Wed, 5 Aug 2015 02:00:52 +0200
> 
> Hi Martin,
> 
> Martin Leduc <mart_00@hotmail.com> writes:
> 
> > However, when opening the experted pdf (with evince or okular) and
> > searching for a word, the output from the search function is a list
> > of words with apparently incorrect character encoding.
> >
> > I get the same result when compiling directly the exported tex file.
> > However, if I remove the line:
> >
> > \usepackage[T1]{fontenc}
> >
> > the compiled pdf becomes correctly interpreted by the search
> > function. According to the documentation of the org-article latex
> > class, "There is no facility to disable loading fontenc".
> >
> > What should I do to make the pdf searchable with the org exporter ?
> 
> I would try to remove the relevant entry from
> `org-latex-default-packages-alist'.  Did you try this?
> 
> -- 
>  Bastien
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 1605 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: fontenc makes pdf non-searchable
  2015-08-08  2:30   ` Martin Leduc
@ 2015-08-08  8:48     ` Bastien
  0 siblings, 0 replies; 12+ messages in thread
From: Bastien @ 2015-08-08  8:48 UTC (permalink / raw)
  To: Martin Leduc; +Cc: emacs-orgmode@gnu.org

Martin Leduc <mart_00@hotmail.com> writes:

> Hi Bastien,  thanks a lot for your response but I finally solved the
> issue by installing the package cm-super.

Thanks for confirming!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-08  8:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21  4:47 fontenc makes pdf non-searchable Martin Leduc
2015-03-21 16:24 ` William Denton
2015-03-21 18:56   ` Martin Leduc
2015-03-22 17:56     ` William Denton
2015-03-22 23:52       ` Martin Leduc
2015-03-23  7:18     ` Stefan Nobis
2015-03-23 16:07       ` J. David Boyd
2015-03-23 17:10         ` Stefan Nobis
2015-08-05  0:00 ` Bastien Guerry
2015-08-08  2:30   ` Martin Leduc
2015-08-08  8:48     ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2015-03-23 22:50 Martin Leduc

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).