TransWikia.com

Using EveryShipout corrupts the copyable text

TeX - LaTeX Asked on February 9, 2021

This is a strange bug. I’m using the everyshi package to place text at a certain position on the page. (Actually I’m using the textpos package, but I isolated the problem to its usage of everyshi.) Consider this document:

documentclass{article}

usepackage{everyshi}
usepackage{fontspec}
usepackage{polyglossia}
setmainlanguage{sanskrit}
newfontfamilydevanagarifont[Renderer=HarfBuzz,Script=Devanagari]{Chandas}

begin{document}

EveryShipout{%
globalsetbox255=vbox{%
vbox to 0pt{%
vskip 2in
hbox{added later किं  बहुना । परस्परं द्वैधम् उत्पन्नम् । added later}
vss}
unvbox255}}

Some text.

newboxfoo
setboxfoo=vbox{hbox{boxed किं  बहुना । परस्परं द्वैधम् उत्पन्नम् । boxed}}

inline किं  बहुना । परस्परं द्वैधम् उत्पन्नम् । and also below
unvboxfoo

end{document}

(The Chandas font is from here.) The resulting PDF looks like:

result

The Devanagari text is the same in all three places. As in my previous question Getting correct searchable text for Devanagari text, everything works fine (when compiled with lualatex from Tex Live 2020) i.e. selecting and copying text from the PDF gives correct results, for the inline text and for the manually unvboxed text,

inline किं बहुना । परस्परं द्वैधम् उत्पन्नम्। and also below

boxed किं बहुना । परस्परं द्वैधम् उत्पन्नम्। boxed

but for the text added later with EveryShipout, I get:

added later ��� बहु�� । परस्पर� ��ध�� उत्पन्न�� । added later

What could be the reason? Is there a fix?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP