latextemplates / LNCS

Improved Lecture Notes in Computer Science (LNCS) template
https://latextemplates.github.io/LNCS/
BSD Zero Clause License
257 stars 64 forks source link

Unable to copy numbers #22

Closed duichwer closed 6 years ago

duichwer commented 6 years ago

Hi,

I used your template for creating an document. Now I have the problem that it is not possible to copy numbers out of the text from the created pdf-file. I always receive the question-mark-box after copying some numbers inside text.

Numbers I added with the package siunitx are copyable. I only added this package and changed nothing else.

koppor commented 6 years ago

I tried with following LaTeX source

Numbers can written using the siunitx package like that:
\SI{100}{\km\per\hour}
or just plain \LaTeX{}:
$100 \frac{\mathit{km}}{h}$.

See also https://github.com/latextemplates/LNCS/commit/650fa382882bc72a8f99995c3d808af61cafc783.

It produces following PDF:

grafik

Copy and paste leads to:

Numbers can written using the siunitx package like that: 100
km
h
or just plain
L
A T E X: 100 km
h
.

What is your input? Did you use other numbers?

duichwer commented 6 years ago

Hi, I've written my numbers inline as Text. Numbers inside math environment $400$ an with \SI{300}{} ar copyable, but outside and as Table-Number or inside the bibliography are not copyable.

koppor commented 6 years ago

Do you use the latest release (1.7.0) or the master branch?

Which system do you use? I tried with following setup:

$ lualatex --version
This is LuaTeX, Version 1.0.4 (TeX Live 2017/W32TeX)

I changed the test text to

Numbers can written plain text (such as 100), by using the siunitx package like that:

I tried SumatraPDF. Now I tried Acrobat Reader, too. Result:

Numbers can written plain text (such as 100), by using the siunitx package
like that: 100 km
h , or by using plain LATEX (and math mode): 100km
h .

Does this also happen with the PDF compiled using CircleCI / the Docker image? I tried https://latextemplates.github.io/LNCS/paper.pdf at Firefox and I cannot copy numbers. Result:

Numbers can written plain text (such as


With http://latextemplates.github.io/LNCS/paper-newtx.pdf, it works.

With https://latextemplates.github.io/LNCS/paper.pdf and Acrobat Reader, I also cannot copy the numbers.

Numbers can written plain text (such as 􀀀􀀀), by using the siunitx package
like that: 100 km
h , or by using plain LATEX (and math mode): 100km
h .

So, we kind of reproduced the issue.

duichwer commented 6 years ago

Hi,

I use the following setup:

I used the download link in the Quick Start section in the README file of the master branch. Afterwards I downloaded the LNCS class and added that file to this directory.

I've also reproduced this copy-error with the plain paper.tex document without any modifications of mine.

I tried to copy from both files paper-newtx.pdf and paper.pdf and I was able to copy numbers inside the default GoogleChrome PDF-Preview.

When I opended both files with Acrobat Reader, I was only able to copy numbers from paper-newtx.pdf

For a fast workaround:

How can I switch the font to Times New Roman with pdflatex?

koppor commented 6 years ago

You could try lualatex in case you don't want to change the font. Would be interesting if that works. (lualatex is recommended by many developers in the latex eco system)

For switching to Times (to get more space):

Change the iftrue to iffalse at https://github.com/latextemplates/LNCS/blob/50cb89e0faefe87889d7c80cc4a42527ab147fe0/paper.tex#L38

To keep the font, you could also try to replace following

    % better font, similar to the default springer font
    % cfr-lm is preferred over lmodern. Reasoning at http://tex.stackexchange.com/a/247543/9075
    \usepackage[%
      rm={oldstyle=false,proportional=true},%
      sf={oldstyle=false,proportional=true},%
      tt={oldstyle=false,proportional=true,variable=false},%
      qt=false%
    ]{cfr-lm}

by

\usepackage{lmodern}

Would be interesting whether lmodern works better than cfr-lm.

duichwer commented 6 years ago

Hi,

I switched to lualatex and now the numbers are copy-able; with default font and also with Tex Gyre Termes.

koppor commented 6 years ago

Forwarded to tex.stackexchange: https://tex.stackexchange.com/q/428111/9075

koppor commented 6 years ago

I got an answer - the fix is to switch from cmap to glyphtounicode - https://github.com/latextemplates/LNCS/commit/da71ea05ae16af964d12ea9e69ce1cd69692e4af

Can you try again with the most recent version?