Skip to content

Commit

Permalink
Use xindy to generate index when using xelatex/lualatex/platex
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Mar 6, 2019
1 parent 6d7feea commit b382d0a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion readthedocs/doc_builder/backends/sphinx.py
Expand Up @@ -395,21 +395,30 @@ def build(self):
# https://github.com/rtfd/readthedocs.org/issues/4454
if self.project.has_feature(Feature.USE_XELATEX_BINARY):
latex_cmd = 'xelatex'
makeindex_cmd = 'xindy'
elif self.project.has_feature(Feature.USE_LUALATEX_BINARY):
latex_cmd = 'lualatex'
makeindex_cmd = 'xindy'
elif self.project.has_feature(Feature.USE_PLATEX_BINARY):
latex_cmd = 'platex'
makeindex_cmd = 'xindy'
else:
latex_cmd = 'pdflatex'
makeindex_cmd = 'makeindex'

latex_cmds = [
[latex_cmd, '-interaction=nonstopmode', tex_file]
for tex_file in tex_files
] # yapf: disable

if makeindex_cmd == 'xindy':
makeindex_args = ['-C', 'utf8', '-M', 'texindy']
else:
makeindex_args = ['-s', 'python.ist']

makeindex_cmds = [
[
'makeindex', '-s', 'python.ist', '{}.idx'.format(
makeindex_cmd, *makeindex_args, '{}.idx'.format(
os.path.splitext(os.path.relpath(tex_file, latex_cwd))[0],
),
]
Expand Down

0 comments on commit b382d0a

Please sign in to comment.