[OS X TeX] Why won't TeXShop pdflatexmk use index style file with my platexmkrc?

Herbert Schulz herbs at wideopenwest.com
Fri Aug 5 19:13:00 CEST 2016

> On Aug 5, 2016, at 10:38 AM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> Source file  styledndex.tex:
>         \documentclass{book}
>         \usepackage{makeidx}
>         \makeindex
>         \begin{document}
>         Some text.\index{apple}\index{apricot}
>         \index{banana}\index{blackberry}\index{blueberry}
>         \index{currant}\index{cherry}
>         \index{date}
>         \printindex
>         \end{document}
> Index style file styledindex.ist:
>         headings_flag 1
>         heading_prefix "{\\medskip\\hfill\\large\\textsf{\\textbf{"
>         heading_suffix "}}\\hfill}\\medskip\\nopagebreak\n”
> When I just (i) run Latex from within TeXShop; (ii) from command line execute
>      makeindex -s styledindex.ist styledindex
> and (iii) again run latex from within TeXShop, I get the index with the style I expect — each letter group is headed by its letter A, B, C, or D (and in a bold sans-serif).
> However, with the following file platexmkrc in the source directory...
>     add_cus_dep('idx', 'ind', 0, 'makeidx2ind');
>                  sub makidx2ind {
>                                 system("makeindex —s '$_[0]'.ist -o '$_[0]'.ind '$_[0]'.idx");
>                  };
> … if instead I run the pdflatexmk engine from within TeXShop, those letter group headings do not appear — the .ist file is being ignored — although of course an index is produced.
> What’s wrong?


The makeindex command is built-in to latexmk so setting a rule doesn't do the job. A platexmkrc file in the same directory as the root .tex file containing the line

$makeindex = "makeindex -s styledindex.ist %O -o %D %S";

(with a blank line afterward) should do the job. Let me know if it doesn't.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://www.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

More information about the macostex-archives mailing list