当段落只有一个单词时,XeLaTeX 正向搜索无法正常工作

当段落只有一个单词时,XeLaTeX 正向搜索无法正常工作

备注:我升级到了 TeX Live 2022,但仍然可以重现此问题。奇怪的是,评论者使用相同的 TeX Live 2022,却无法重现


当一个段落只有一个单词时,使用 XeLaTeX 编译时正向同步搜索是错误的。

  1. 创建一个 TeX 文件(例如命名为a.tex

    %! TEX program = xelatex
    \documentclass{article}
    
    \begin{document}
    
    text text
    
    a
    
    b
    
    text text
    
    \end{document}
    

    注意第6行是第一text text行,第8行是该a行,第12行是第二text text行。

  2. 编译

    xelatex -synctex=1 a.tex
    
  3. 尝试使用synctex获取坐标。

    synctex view -i 6:1:./a.tex -o a.pdf
    synctex view -i 8:1:./a.tex -o a.pdf
    synctex view -i 12:1:./a.tex -o a.pdf
    

    请注意,尽管指向两个不同的段落,但前两个输出是相同的。

  4. 或者,打开 zathura 并突出显示 zathura 中的行。

    zathura a.pdf
    zathura --synctex-forward 6:1:./a.tex a.pdf  # first line is highlighted, correct
    zathura --synctex-forward 8:1:./a.tex a.pdf  # first line is still highlighted, wrong
    zathura --synctex-forward 12:1:./a.tex a.pdf  # last line is highlighted, correct
    

对于 LuaLaTeX 来说,结果是正确的。这是 XeLaTeX 的错误吗?


XeLaTeX 版本:

XeTeX 3.141592653-2.6-0.999994 (TeX Live 2022/Arch Linux)
kpathsea version 6.3.4
Copyright 2022 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 71.1; using 71.1
Compiled with zlib version 1.2.12; using 1.2.12
Compiled with FreeType2 version 2.12.0; using 2.12.1
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 4.2.0; using 4.3.0
Compiled with libpng version 1.6.37; using 1.6.37
Compiled with pplib version v2.05 less toxic i hope
Compiled with fontconfig version 2.14.0; using 2.14.0

synctex版本:

$ synctex
This is SyncTeX command line utility, version 1.5
SyncTeX ERROR: Missing options
usage: synctex <subcommand> [options] [args]
Synchronize TeXnology command-line client, version 1.21

The Synchronization TeXnology by Jérôme Laurens is a rather new feature of recent TeX engines.
It allows to synchronize between input and output, which means to
navigate from the source document to the typeset material and vice versa.

Available subcommands:
   view     to perform forwards synchronization
   edit     to perform backwards synchronization
   update   to update a synctex file after a dvi/xdv to pdf filter
   help     this help

Type 'synctex help <subcommand>' for help on a specific subcommand.
There is also an undocumented test subcommand.

当我在 zathura 中按住 Ctrl 键并单击时,反向搜索是正确的,所以它也可能是 synctex 错误,我不知道。

相关内容