I'm currently trying to get index entries to be automatically shown in italic in the text, i.e. instead of `\textit{Term}\index{Term}`, I want to be able to use `\index{Term}`, which should render the same thing as the first piece of code.

Now so far, I've been able to get *something* similar to work by defining the following macro:

```
\newcommand{\Index}[1]{\textit{#1}\index{#1}}

```

Credit goes to <https://www.namsu.de/Extra/pakete/Makeidx.html>

Now by using `\Index` (note the capitalized "I"), I partly get the desired result. I cannot, however, use the other possibilities that `index` offers, such as `\index{term@termActuallyDisplayed}`.

My next approach was using:

```
\newcommand{\Index}[2][#2]{\textit{#2}\index{#1@#1}}

```

so that `\Index{Term}` renders `\textit{Term}\index{Term@Term}`, while `\Index[ActualIndexTerm]{Term}` renders `\textit{Term}\index{ActualIndexTerm@ActualIndexTerm}`.

My problem, however, is that using the code above will render an error saying "Illegal parameter number in definition [...]". Hence my question - does anyone know how to circumvent this problem, such as using another package or anything?  

(I know that I could just define 2 different commands, but that feels somewhat primitive)

Thanks in advance!