1

This is a strange bug. I'm using the textpos package (which in turn uses the everyshi package) to place text at a certain position on the page. Consider this document:

% !TEX TS-program = lualatex
\documentclass{article}
\usepackage[absolute]{textpos}
\usepackage{fontspec}
\setmainfont[Renderer=HarfBuzz,Script=Devanagari]{Chandas}

\begin{document}

% package textpos uses \paperheight and \paperwidth
\paperheight=1561bp
\paperwidth=1044bp
\TPGrid{1044}{1561}
\begin{textblock}{200}(173,213)
added later किं  बहुना । परस्परं द्वैधम् उत्पन्नम् । added later
\end{textblock}

Some text.
\newbox\foo
\setbox\foo=\vbox{\hbox{boxed किं  बहुना । परस्परं द्वैधम् उत्पन्नम् । boxed}}

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

\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: see on Overleaf) 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 textpos, I get:

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

What could be the reason? Is there a fix?

14
  • I see a previous question that may be related, but it has no details and it is at -1 and the OP's answer mentions AtEveryPageHook which as far as I can tell doesn't exist and probably cannot be used for this use-case anyway. Commented Sep 13, 2020 at 17:12
  • Looks like everyshi is only 32 lines of well-motivated and self-contained code... Commented Sep 13, 2020 at 17:20
  • 1
    I see no difference in the copy&paste behaviour. Unrelated: everyshi will be replaced by kernel code in the next latex release. The textpos code is currently not compatible and will break. The maintainer has been informed some weeks ago, but I don't know when he will update. Commented Sep 13, 2020 at 17:36
  • @UlrikeFischer Thanks for taking a look…. Do you get broken results in both cases or are both fine? I've uploaded the resulting PDF (from "This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)" on macOS); are your results different? Commented Sep 13, 2020 at 18:01
  • 1
    I see now a difference, but only in adobe reader. But I see also the difference in the pdf code. I need to discuss this with Marcel. Commented Sep 13, 2020 at 18:24

0

You must log in to answer this question.

Browse other questions tagged .