7

So I'm using latexmk.pl to compile my TextMate LaTeX Project and it's running quite nice. The only thing I'm missing, is, that i want to specify an individual style file for the makeindex command, i.e. latexmk.pl when latexmk decides to run makeindex, it should add something like

makeindex -s mystyle.ist

I won't mind setting the .ist file to my $TM_LATEX_MASTERs name, but it would also be nice to have a seperate style file.

I haven't found anything to define such an option for latexmk that is called from TextMate. Do you have any ideas?

PS: I'm using XeTeX to compile, but i think that might only be of minor interest.

3 Answers 3

3

If you're running a TeX Live 2010 or 2011, or MiKTeX 2.9, you can profit from the imakeidx package: just change \usepackage{makeidx} to

\usepackage{imakeidx}

and \makeindex to

\makeindex[options=-s mystyle]

Then MakeIndex (the program) will be called automatically from within the LaTeX run, with the specified style (doesn't work with the article class and, presently, memoir).

4
  • That's a neat Hint. Though the index just does not show up, but that may also be due to an error in my style-definitions, i'll check that tomorrow. I'm using the Koma-Classes (scrbook actually), so it seems to work (despite the mentioned error). Many thanks.
    – Ronny
    Oct 18, 2011 at 21:19
  • So thanks, it really works, now i have to understand more about the style file itself. I think this solution is great.
    – Ronny
    Oct 18, 2011 at 21:40
  • 1
    @Ronny Well, I'm one of the authors. :)
    – egreg
    Oct 18, 2011 at 21:56
  • I red your manual last night, though i didn't get the link to your username. Thanks for that package, it's e great idea.
    – Ronny
    Oct 19, 2011 at 6:32
9

You just need to redefine the command latexmk uses to run makeindex. Make a file latexmkrc in the directory containing your document, and include in it the following line

$makeindex  = 'makeindex -s mystyle.ist %O -o %D %S';
3
  • Thanks for the help, i think specifying it inside the .tex document as mentioned directly below is a little bit nicer, though i might try your idea, just to learn configuring latexmkrc.
    – Ronny
    Oct 18, 2011 at 21:20
  • So i reset my repository and tried your solution, too. It works, and it would also work on older distributions compared to the solution of egreg, so maybe for some of the readers that might be nice. I prefer the solution using imakeidx, because it's more flexible. I can change the style in my .tex-Files, which is even better for me than the starting point of this thread. Thanks again.
    – Ronny
    Oct 19, 2011 at 6:40
  • @john-collins When you say a latexmkrc file, Do you mean a .latexmkrc file or the dot does not matter?
    – Dox
    Aug 29, 2014 at 12:51
0

You could try entering the contents of your .ist into your .tex file using \begin(filecontents) as in this example:

\begin{filecontents}{\jobname.mst}
delim_0 "\\quad "
delim_1 "\\quad "
delim_2 "\\quad "
delim_n ", "
\end{filecontents}

(Note the file extension needs to be .mst: see https://tex.stackexchange.com/a/117205/128965 for an explanation.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .