无法在代码页 utf8 中找到针对英国语言的 xindy 模块

无法在代码页 utf8 中找到针对英国语言的 xindy 模块

当我使用xindyfor 作为makeglossaries后端时,收到以下警告:

无法在代码页 utf8 中找到针对英国语言的 xindy 模块

但是,词汇表本身的排版没有问题(在我看来一切都很好)。

我看到了有关波斯语的类似问题这里,但我不需要支持除英国英语之外的任何外来语言。我正在使用通过自定义子依赖样式函数latexmk调用的函数。makeglossaries

此警告是什么意思?我该如何消除它?我正在使用luatex

以下是产生此警告的 MWE(main.tex)(另请参阅latexmkrc用于运行此警告的文件):

\RequirePackage{shellesc}
\RequirePackage[debrief]{silence}
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[12pt,a4paper,oneside,openright]{book}

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[backend=biber, style=numeric-comp, sorting=none, citestyle=numeric-comp, maxbibnames=50, url=true, doi=true, eprint=false,backref=true,backrefstyle=three]{biblatex} % seems to have strong dependence on csquotes?
\usepackage[luatex,paper=a4paper,hmarginratio=1:1, vmarginratio=1:1, scale=0.75]{geometry}
\usepackage{graphicx} % important to load before fontspec
\usepackage{lualatex-math}
\usepackage{mathtools}
\usepackage[frac,vfrac,multskip]{mathfixs}
\usepackage{setspace} % Define line spacing
\usepackage{fontspec} % load after graphicx
\usepackage[warnings-off={mathtools-colon}]{unicode-math}
\setmainfont[Numbers={Proportional},Ligatures={TeX, Common%, Historic, Contextual, Rare, Discretionary
}]{Libertinus Serif}
\setsansfont{Libertinus Sans}
\setmonofont[Scale=MatchLowercase]{Latin Modern Mono}
\usepackage{ragged2e} %  "The package should be loaded after the body font and size have been established  for example, after font packages have been loaded

\setmathfont[bold-style=ISO]{Libertinus Math} % https://github.com/libertinus-fonts/libertinus/issues/20
\setmathfont[range={\mathunder,\triangleq,\underbrace},Scale=MatchUppercase]{Latin Modern Math}
\usepackage[british]{babel} % with british, we get OUP hyphenation material for free
\usepackage[final,activate={true,nocompatibility},factor=1100,stretch=10,shrink=10,babel=true]{microtype} % if using option babel=true, babel must be loaded before microtype
\usepackage[british]{selnolig} % if using babel, this package should go after loading babel
\usepackage[newfloat=true]{minted}
\usepackage[minted,most]{tcolorbox}
\usepackage{csquotes} % The fvextra package is loaded by minted, so you should load minted before csquotes

\usepackage[nomain,acronym,automake,xindy]{glossaries-extra}% should be loaded after hyperref % consider 'symbols' package option

\makeglossaries
\glssetcategoryattribute{acronym}{nohyperfirst}{true}
\setabbreviationstyle[acronym]{long-short} % applicable only for glossaries-extra.sty
\newacronym{adc}{ADC}{Analog to Digital Converter}

\begin{document}
\cleardoublepage
\printglossary[type=acronym,title={List of Acronyms}]\label{ch:glossary} % basic style
This is some random text which uses \glspl{adc}.
\cleardoublepage
\end{document}

这是我的latexmkrc

push @generated_exts, "acn";
push @generated_exts, "acr";
push @generated_exts, "alg";
push @generated_exts, "auxlock";
push @generated_exts, "brf";
push @generated_exts, "cb";
push @generated_exts, "cb2";
push @generated_exts, "glg-abr";
push @generated_exts, "glo-abr";
push @generated_exts, "gls-abr";
push @generated_exts, "ist";
push @generated_exts, "nav";
push @generated_exts, "nlg";
push @generated_exts, "nlo";
push @generated_exts, "nls";
push @generated_exts, "nmo";
push @generated_exts, "run.xml";
push @generated_exts, "slg";
push @generated_exts, "snm";
push @generated_exts, "spl";
push @generated_exts, "syg";
push @generated_exts, "syi";
push @generated_exts, "synctex.gz";
push @generated_exts, "tar.gz";
push @generated_exts, "tdo";
push @generated_exts, "thm";
push @generated_exts, "loa";
push @generated_exts, "mypyg";
push @generated_exts, "mtc*";
push @generated_exts, "ptc";
push @generated_exts, "synctex*";
push @generated_exts, 'glo', 'gls', 'glg';
push @generated_exts, 'acn', 'acr', 'alg';


$pdflatex = 'lualatex %O %S --interaction=batchmode -halt-on-error --shell-escape --bibtex --recorder';
$pdf_mode = 4;
$postscript_mode = $dvi_mode = 0;
$clean_ext .= ' %R.ist %R.xdy';


@cus_dep_list = (@cus_dep_list, "glo-abr gls-abr 0 makenomenclature");
sub makenomenclature {
   system("makeindex $_[0].glo-abr -s nomencl.ist -o $_[0].gls-abr"); }

@cus_dep_list = (@cus_dep_list, "syi syg 0 makegls");
sub makegls {
   system("makeindex $_[0].syg -s nomencl.ist -o $_[0].syi"); }

add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');

sub run_makeglossaries {
  if ( $silent ) {
    system "makeglossaries -q '$_[0]'";
  }
  else {
    system "makeglossaries '$_[0]'";
  };
}

sub asy {return system("asy -o \"$_[0]\" \"$_[0]\"");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");

push @file_not_found, '^Package .* No file `([^\\\']*)\\\'';

$bibtex_use=2

答案1

您正在使用automakepackage 选项,这意味着该glossaries包将尝试xindy使用 TeX 的 shell 转义运行。这将在受限模式下失败,因为xindy不在受限列表中,但您的latexmk代码表明您正在使用 运行 LuaLaTeX --shell-escape,这会切换到非受限模式并允许xindy从 TeX 运行。

automake选项不具备 的全部功能makeglossaries,也不提供babel方言到xindy语言的映射,因此它xindy使用运行-L british,但无法识别。latexmk然后运行依赖项,makeglossaries它也会调用xindy,但这次使用-L english,因此会生成正确的文件。

因此,警告很可能来自 shell 转义调用,而xindy不是来自makeglossaries调用xindy。最简单的解决方案是删除选项automake并保留xindy对的调用makeglossaries。如果您确实想使用automake而不是makeglossaries,则需要指定正确的xindy语言名称:

\usepackage[automake,xindy={language=english}]{glossaries}

(对于 也一样glossaries-extra。)请注意,在不受限制的模式下运行 TeX 存在安全风险,因此如果您不是绝对需要它,最好删除--shell-escapeautomakemakeglossaries从 TeX 外部运行。

无关:您latexmk似乎将 和 混glossaries在一起了nomencl。该nomencl.ist文件用于nomencl包,但nomencl包使用.nlo.nls作为文件扩展名。glossaries-extra包使用.glo-abr.gls-abr(缩写)。

答案2

xindy不识别british为一种语言。

$ texindy -L british -C utf8 testtemp.idx
Cannot locate xindy module for language british in codepage utf8.

$ texindy -L english -C utf8 testtemp.idx
Opening logfile "/dev/null" (done)
Reading indexstyle...
[cut lines]
Finished processing index.

Writing markup... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
Markup written into file "./testtemp.ind".

带有测试文件

\documentclass{article}

\usepackage{makeidx}
\makeindex
\begin{document}
Comments on Foo\index{Foo}
\printindex
\end{document}

并已pdflatex跑完一次。

我不知道makeglossaries最终会怎样(也许!)-L british在这里使用。

相关内容