![암호:](https://rvso.com/image/328810/%EC%95%94%ED%98%B8%3A.png)
"이름 색인"에는약간의가능한 카테고리: 이 예에서는 "동물", "예술가", "광물" 및 "식물"입니다.
이 "이름 색인"의 경우, 특히 책갈피에서 "A", "M" 및 "P" 문자 범주를 어떻게 제거합니까? 나는 이것이 다른 지수를 변경하는 것을 원하지 않습니다.
나는 북마크가 다음과 같은 모습을 선호합니다.
Name Index
Animal
Artists
Mineral
Plant
Main Index
C
D
T
관련 질문
- 인덱스 수준 스타일 변경관련이 있는 것 같습니다.
암호:
\documentclass{article}
\usepackage{imakeidx}
\usepackage{xparse}
\usepackage{xcolor}
\usepackage{hyperref}
\newcommand*\lettergroup[1]{\subsection{#1}}
\newcommand*{\IndexWithName}[2]{%
% #1 = word to index
% #2 = index name
\index[#2]{#1}%
}
\NewDocumentCommand{\FormatIndexEntry}{mm}{%
\textcolor{blue}{#1} #2%
}
\NewDocumentCommand{\AddIndexEntry}{%
O{}% #1 = index name
m% #2 = word to index this under
m% #3 = indexed term
m% #4 = symbol (not used in this MWE)
}{%
\expandafter\IndexWithName\expandafter{%
#2!#3@\FormatIndexEntry{#3}{\unexpanded{\unexpanded{#4}}}%
}{#1}%
}
\makeindex[title={Main Index},columns=1,program=texindy,name=Main]
\makeindex[title={Name Index},columns=1,program=texindy,name=Name]
\indexsetup{level=\section}
\begin{document}
some text
\AddIndexEntry[Main]{tree}{leaf}{}
\AddIndexEntry[Main]{tree}{trunk}{}
\AddIndexEntry[Main]{dog}{labrador retriever}{}
\AddIndexEntry[Main]{dog}{german shpherd}{}
\AddIndexEntry[Main]{cat}{siamese}{}
\AddIndexEntry[Main]{cat}{persian}{}
\AddIndexEntry[Main]{cat}{bengal}{}
\AddIndexEntry[Name]{artists}{Picasso}{}
\AddIndexEntry[Name]{artists}{van Gogh}{}
\AddIndexEntry[Name]{artists}{da Vinci}{}
\AddIndexEntry[Name]{plant}{tree}{}
\AddIndexEntry[Name]{plant}{shrub}{}
\AddIndexEntry[Name]{animal}{fox}{}
\AddIndexEntry[Name]{animal}{cat}{}
\AddIndexEntry[Name]{mineral}{quartz}{}
\AddIndexEntry[Name]{mineral}{marble}{}
\clearpage
\setcounter{secnumdepth}{0}
\printindex[Name]
\printindex[Main]
\end{document}