Skip to content

Commit b382d0a

Browse files
committed
Use xindy to generate index when using xelatex/lualatex/platex
1 parent 6d7feea commit b382d0a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

readthedocs/doc_builder/backends/sphinx.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -395,21 +395,30 @@ def build(self):
395395
# https://github.com/rtfd/readthedocs.org/issues/4454
396396
if self.project.has_feature(Feature.USE_XELATEX_BINARY):
397397
latex_cmd = 'xelatex'
398+
makeindex_cmd = 'xindy'
398399
elif self.project.has_feature(Feature.USE_LUALATEX_BINARY):
399400
latex_cmd = 'lualatex'
401+
makeindex_cmd = 'xindy'
400402
elif self.project.has_feature(Feature.USE_PLATEX_BINARY):
401403
latex_cmd = 'platex'
404+
makeindex_cmd = 'xindy'
402405
else:
403406
latex_cmd = 'pdflatex'
407+
makeindex_cmd = 'makeindex'
404408

405409
latex_cmds = [
406410
[latex_cmd, '-interaction=nonstopmode', tex_file]
407411
for tex_file in tex_files
408412
] # yapf: disable
409413

414+
if makeindex_cmd == 'xindy':
415+
makeindex_args = ['-C', 'utf8', '-M', 'texindy']
416+
else:
417+
makeindex_args = ['-s', 'python.ist']
418+
410419
makeindex_cmds = [
411420
[
412-
'makeindex', '-s', 'python.ist', '{}.idx'.format(
421+
makeindex_cmd, *makeindex_args, '{}.idx'.format(
413422
os.path.splitext(os.path.relpath(tex_file, latex_cwd))[0],
414423
),
415424
]

0 commit comments

Comments
 (0)