3

I am trying to create a nice looking style for my index.

Here is what I have achieved vs. what I want to reach :

Achieved :

enter image description here

Goal :

enter image description here

Here is my file tablealphab.ist :


heading_prefix "
\\vspace*{0.5cm}
\\nopagebreak\n
\\tikz
\\draw (0,0) [draw=gray, fill=gray] circle (0.35cm) node{" heading_suffix "};
\\tikz
\\draw (0,0) [color=gray, fill=gray] coordinate (a) [bend right=0] to +(4.4cm,0) coordinate (b) [bend right] to +(0,-0.7cm) coordinate (c) [bend right] to (a |- c) [bend right=60] to cycle ;
\\vspace*{0.2cm}
\\nopagebreak\n"

headings_flag 1
symhead_positive "Symboles"
symhead_negative "symboles"
numhead_positive "Nombres"
numhead_negative "nombres"
delim_0 "}\\hspace{0pt},\\hspace{6pt}"
delim_1 "\\hspace{0pt},\\hspace{5pt}"
delim_2 "\\hspace{0pt},\\hspace{4pt}"
delim_t "."
item_0 "\n \\item {\\acasB " 
item_x1 "} \\acasR \\subitem "
item_1 "} \\acasR \\subitem "
item_01 "} \\acasR \\subitem "

And the rest of my code :

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{calc}                         
\usepackage{xcolor}                       
\definecolor{gray}{HTML}{999999}
\definecolor{white}{HTML}{FFFFFF}
\usepackage{tikz}
\usetikzlibrary{positioning, shapes.geometric, arrows.meta}

\usepackage{imakeidx}
\makeindex[columns=2, title=Alphabetical Index, 
           options= -s tablealphab.ist]

\begin{document}

\tableofcontents

\section{Introduction}
This is a test\index{test}, several keywords\index{keywords} will be used which are important and deserve to appear in the Index\index{index}.

Terms can be pretty long, who knows\index{terms can be pretty long, who knows}.

\clearpage

\section{Second section}
This second section\index{section} may include some special word, and expand the ones already used\index{used}. 

\printindex
\end{document}

I have managed to get a circle and a one-side-rounded rectangle. But can I get an ellipse and an accordingly distorted rectangle? And how can I reduce the height of my rectangle? And choose its width so as it fills the whole line?

Thank you all for your help!

0

1 Answer 1

2

I know this might not exactly be what you're looking for, but here is what i use (Sorry for german notations, if necessary i can translate them):

% Fancy Headings
heading_prefix "
\\nopagebreak\n
\\tikz{%
\\node[rounded rectangle, rounded rectangle west arc=0pt, minimum height=0.7cm,fill=black!20!teal,text=white, drop shadow={opacity=.5,shadow xshift=0pt}](text){\\large\\noindent\\bfseries\\sffamily " % Hier wird der Buchstabe eingefügt
heading_suffix "};
\\draw ([xshift=4mm]text.north east) [color=gray, fill=gray, drop shadow={opacity=.5,shadow xshift=2pt}] coordinate (a) [bend right=0] to ([xshift=5.2cm]text.north west) coordinate (b) [bend right] to +(0,-0.7cm) coordinate (c) [bend right] to (a |- c) [bend right=60] to cycle ;
}
\\nopagebreak\n"
headings_flag  1 % wir benutzen Überschriften
% Übersetzungen
symhead_positive "Symbole"
symhead_negative "symbole"
numhead_positive "Zahlen"
numhead_negative "zahlen"
% Schönere unterpunkte
item_01 "\n \\subitem$\\bullet$ "
item_1 "\n \\subitem$\\bullet$ "
item_12 "\n \\subsubitem - "
item_2 "\n \\subsubitem - "
delim_0 "\\dotfill" % Punktzeile zwischen Einträgen und Seitenzahlen (Ebene 0)
delim_1 "\\dotfill" % Punktzeile zwischen Einträgen und Seitenzahlen (Ebene 1)
delim_2 "\\dotfill" % Punktzeile zwischen Einträgen und Seitenzahlen (Ebene 2)
delim_r "--" % Trenner zwischen Start und Ende eines Seitenbereiches
suffix_2p "\\,f." % Suffix bei einem bereich aus 2 Seiten
suffix_3p "\\,ff." % Suffix bei einem bereich aus 3 Seiten

this produces something like this: Deonstration of the code

The nice thing about this solution is that you don't have to worry about the curve changing and it looks clean either way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .