Perltex 无法找到 Perl 模块

Perltex 无法找到 Perl 模块

我在 Windows 10 上使用 Tex Live 和 Strawberry Perl 安装。我的最终目标是让 LaTeX 从电子表格中检索数据,如下所示旧回应。但是,此时我正尝试使用附加模块让 Perl 代码在 中运行perltex。当尝试在 中使用模块时perltex

! Package perltex Error: Can't locate Excel/Writer/XLSX.pm in @INC (you may need to 
install the Excel::Writer::XLSX module) (@INC contains:
 E:/Programmdateien /texlive/2019/tlpkg/tlperl/lib 
 E:/programmdateien/texlive/2019/tlpkg/tlperl/site/lib
 E:/programmdateien/texlive/2019/tlpkg/tlperl/lib) BEGIN failed--compilation 
aborted at (eval 13) line 6.
(perltex)                .

模块确实安装正确。我知道这一点,因为我可以很好地运行 Perl 代码并获得所需的结果。只有在尝试使用 进行构建时才会出现此问题perltex

答案1

添加到本地 texmf.cnf

TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL = 1

来自 texmf.cnf 文档:

% This variable is specific to Windows.  It must be set to 0 or 1.  The
% default is 0.  Setting it to 1 tells the Windows script wrappers to
% use an already installed Perl interpreter if one is found on the
% search path, in preference to the Perl shipped with TeX Live.  Thus,
% it may be useful if you both (a) installed a full Perl distribution
% for general use, and (b) need to run Perl programs from TL that use
% additional modules we don't provide.  The TL Perl does provide all the
% standard Perl modules.

相关内容