初めて索引を作成しています。以下の MWE は、索引に「once」という単語を書き込みますが、本文には書き込みません。したがって、once\index{once}
本文と索引にテキストを含めるには、次のように記述する必要があります。これを行うマクロを記述できるので、`\myindex{once} と記述して、本文と索引に表示させることができます。これを実行する組み込みの LaTeX の方法はありますか?
\documentclass[12pt]{memoir}
\usepackage[makeindex]{imakeidx}
\makeindex
\begin{document}
1. This is how you use the index command\index{command}.\\
2. Instead of typing "command" twice above, I'd rather
type it \index{once}.\\
\printindex
\end{document}