Quantcast
Viewing latest article 5
Browse Latest Browse All 70

XeLaTeX/LuaLaTeX copy and paste broken and document not searchable?

I am on Windows using TeX Live 2016 and both xelatex and lualatex produce broken encodings when building the following

\documentclass{scrartcl}\usepackage{fontspec,unicode-math}\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}\setmainfont[Numbers={Proportional,OldStyle}]{Cambria}\setsansfont[Numbers={Proportional,OldStyle}]{Calibri}\setmonofont{Consolas}\setmathfont[Scale=MatchLowercase]{Cambria Math}\setkomafont{disposition}{\normalfont\scshape}\begin{document}    \section{Main Font}    gaffer fix flow affirm affluent 0123456789    \section{Sans Font}    \textsf{gaffer fix flow affirm affluent 0123456789}    \section{Monospace Font}    \texttt{gaffer fix flow affirm affluent 0123456789}    \section{Math Font}    $x^2 + y^2 = z^2$    \subsection{More Math}    $\sin \theta = \dot{\omega}$    \section{Logo}    \LaTeX{}\end{document}

Copying the result in Adobe results in something like

􀍕 M􀄆􀄎􀄓 F􀄔􀄓􀄙gaffer 􀏐ix 􀏐low af􀏐irm af􀏐luent 􀍔􀍕􀍖􀍗􀍘􀍙􀍚􀍛􀍜􀍝􀍖 S􀄆􀄓􀄘 F􀄔􀄓􀄙gaffer fix flow affirm affluent 􀎺􀎻􀎼􀎽􀎾􀎿􀏀􀏁􀏂􀏃􀍗 M􀄔􀄓􀄔􀄘􀄕􀄆􀄈􀄊 F􀄔􀄓􀄙gaffer fix flow affirm affluent 0123456789􀍘 M􀄆􀄙􀄍 F􀄔􀄓􀄙𝑥􀬶+𝑦􀬶 = 𝑧􀬶􀍘.􀍕 M􀄔􀄗􀄊 M􀄆􀄙􀄍sin 𝜃 = 𝜔̇􀍙 L􀄔􀄌􀄔LATEX􀍕

Small caps, ligatures, old-style numbers, and math are all uncopyable/unsearchable.

Previous questions such as Copy oldstyle numbers from pdf (Minion Pro) have been marked as off-topic because they refer to allegedly fixed bugs (several versions ago).Is this a regression (in both lualatex and xelatex?!) or am I doing something wrong?

Update as of TeXLive 2018:

lualatex now produces sane unicode text on copying, if not necessarily the most compatible versions of each character (e.g., the ω in the equation is copied as 𝜔 [U+1D714, Mathematical Italic Small Omega], which it did before as well, only at the time neither common text editors, nor browsers dealt with it properly).

xelatex is as broken as before.

While both now produce ligatures on the sans serif text (which surprisingly, are copied correctly from the xelatex pdf), neither now emits ligatures in the serif text (but is not copied correctly from the xelatex pdf, oddly enough).


Viewing latest article 5
Browse Latest Browse All 70

Trending Articles