[-- 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 --]
[-- 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/
[-- 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 --]
[-- 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/
[-- 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 --]
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.
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
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.
[-- 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 --]
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 #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 --]
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