GeneralHidden active commands - Help

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
MarLeoSch
Posts: 2
Joined: Thu Sep 08, 2022 8:48 am

Hidden active commands - Help

Post by MarLeoSch »

Good morning. I would like to create a keyword directory. For this, I use the package "makeidx". Using the \index{} command, I can now define keywords. Is there any way I can run this command without having to display it in the text? So, I would like to put under the chapter heading similar to \label{}. \index{} and thus link to the chapter without the word in the command being printed in the text. With % I deactivate the whole command. Thanks for your help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

Hidden active commands - Help

Post by MjK »

I don't understand the problem:

Code: Select all

\documentclass{scrbook}

\usepackage{imakeidx}
\makeindex
%\usepackage{hyperref}

\begin{document}
\tableofcontents
\chapter{Hidden\index{entry (hidden)} Index Commands\index{command}\index{example}}
Command \verb|\index| usually does not print anything, but only adds an entry
to the index.
\printindex
\end{document}
Here you have three entries to the index and non of them is printed in the chapter heading. This works same, if you activate loading of hyperref in line 5.

So if you have a problem with \index in your own document, please show us a Infominimal working example (and tag it correctly as code, so it can be processed in the online editor).

Disclaimer: This is no one of my main topics. So don't expect, that I'll do further replies to this discussion.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
MarLeoSch
Posts: 2
Joined: Thu Sep 08, 2022 8:48 am

Hidden active commands - Help

Post by MarLeoSch »

Hi. Thanks for your answer. I think i figured it out with the \dontshow{}command.
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

Hidden active commands - Help

Post by MjK »

MarLeoSch wrote:Hi. Thanks for your answer. I think i figured it out with the \dontshow{}command.
:?
\dontshow is neither provided by the LaTeX kernel, nor the standard classes (or the KOMA-Script classes from my example), nor any of the standard packages from tools or required. I even do not know any class or package, which provides this command. So you reply is as unclear as your question.

If you'll have further questions I'd recommend to be somehow more detailed.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Post Reply