0

I am attempting to use VSCode to generate an index that is separated by the first letter of the word as shown here enter image description here

I created the .ist file as suggested:

headings_flag 1
heading_prefix "{\\textbf{"
heading_suffix "}}\\nopagebreak\n"

and placed the .ist file into a folder named "Packages".

I am not getting the Index to show up with the modified settings as shown above. Can you assist me in getting the correct output?

Thanks!

CODE

\documentclass[a4paper,12pt]{book}

\usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}

\usepackage{imakeidx} \makeindex[options=-s ../Packages/myindex.ist, intoc]

\begin{document}

Some text.\index{Apple}\index{Apricot}\index{Avocado}\index{Banana} \index{Bilberry}\index{Blackberry}\index{Blackcurrant}\index{Blueberry} \index{Currant}\index{Cherry}\index{Cherimoya}\index{Clementine} \index{Date}\index{Damson}\index{Dragonfruit}\index{Durian} \index{Eggplant}\index{Elderberry}\index{Feijoa}\index{Gooseberry} \index{Grape}\index{Grapefruit}\index{Guava}\index{Huckleberry} \index{Jackfruit}\index{Jambul}\index{Kiwi fruit}\index{Kumquat} \index{Legume}\index{Lemon}\index{Lime}\index{Lychee}\index{Mandarine} \index{Mango}\index{Melon}\index{Nectarine}\index{Orange}\index{Peach} \index{Pear}\index{Pitaya}\index{Physalis}\index{Plum}\index{Pineapple} \index{Pomegranate}\index{Purple Mangosteen}\index{Raisin}\index{Raspberry} \index{Rambutan}\index{Redcurrant}\index{Salal berry}\index{Satsuma} \index{Star fruit}\index{Strawberry}\index{Tangerine}\index{Tomato} \index{Ugli fruit}\index{Watermelon}\index{Ziziphus mauritiana}

\newpage \cleardoublepage \printindex

\end{document}

David Carlisle
  • 757,742
Joe
  • 9,080
  • 3
    vscode is not relevant here, that's just the editor you use to write the source. – David Carlisle Nov 30 '23 at 21:14
  • 1
    I used -s myindex.ist, and put myindex,ist in the same directory as the document and got the output you asked for, https://www.overleaf.com/read/tpjvtpcnwfwc#838713 – David Carlisle Nov 30 '23 at 21:19
  • @DavidCarlisle, thanks for your inputs. I am using VSCode as the LaTeX compiler. Good datapoint that the code works on its own. You are correct then, there might be a VSCode setting that is not causing the Index to show up correctly. – Joe Nov 30 '23 at 21:52
  • @DaiBowen, I am not getting the Index to show via using VSCode as the compiler. – Joe Nov 30 '23 at 21:54
  • @Joe no vscode is not a compiler it is a text editor, you have an underlying tex system (texlive or miktex) and you would get the same output whatever editor you used to write the source file. – David Carlisle Nov 30 '23 at 23:07
  • @Joe if the index does not appear you will have an error from latex or from makeindex you should show the .log or .llg log files – David Carlisle Nov 30 '23 at 23:09
  • 1
    is the packages folder at the correct relative location ../ ie under the parent directory of the directory with your source file – David Carlisle Nov 30 '23 at 23:11
  • @DavidCarlisle, yes, the packages folder is under the parent directory. – Joe Dec 01 '23 at 17:09
  • The .idx file has the entries....I also get the message from the VSCode log file...runsystem(makeindex -s ../Packages/myindex.ist Example_Index.idx)...executed safely (allowed). Although this takes place, I do not see the .llg file – Joe Dec 01 '23 at 17:13
  • sorry typo .ilg not .llg – David Carlisle Dec 01 '23 at 17:41
  • actually I'm surprised it can access a parent directory in restricted shell escape, what hapens if you delete ../Packages and put the ist next to the document – David Carlisle Dec 01 '23 at 17:43
  • @DavidCarlisle I tried your suggestion but I got the same results. :-( – Joe Dec 01 '23 at 20:52
  • 1
    check first it works outside the editor, just cd to the directory and pdflatex yourfile.tex and check that works. – David Carlisle Dec 01 '23 at 20:56
  • @DavidCarlisle, in the cmd prompt via pdflatex myfile.tex, I get the correct index to show up. – Joe Dec 01 '23 at 21:04
  • 2
    @Joe so the problem is in your vscode setup not any of the code you have shown – David Carlisle Dec 01 '23 at 21:41
  • @Joe, have you seen this solution https://tex.stackexchange.com/a/65249/245790 from the Linked "column" to the right? – MS-SPO Dec 03 '23 at 15:27
  • 1
    @MS-SPO, thanks for your input. I did see that post and that was where I got the original formatting for this post. However, I am having an issue of it working with VSCode. Thanks! – Joe Dec 04 '23 at 03:07

0 Answers0