I would like to place a letter (that indicates which letter in the dictionary is shown) on the outer side of the book, set it for example in a darker box and position that letter vertically. Users of the dictionary can later easily access a searched headword by using the letter division on the side.
Minimum example:
\documentclass[twocolumn]{book}
\usepackage[top=1.5cm, bottom=1.5cm, left=2cm, right=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage[utf8x, utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand\entry[3][]{\hangpara{2em}{1}{\fontfamily{phv} selectfont{\textbf{{#2}}}}\
#3\ifx\relax#1\relax\markboth{#2}{#2}\else\markboth{#1}{#1}\fi
\par}\nopagebreak[4]
\newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\par}
\pagestyle{fancy}
\fancypagestyle{basicstyle}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[LE,RO]{\textbf{\chaptitle}}
\fancyhead[LO,RE]{\textbf{\thepage}}}
\fancypagestyle{dictstyle}{%
\fancyhf{}
\fancyhead[LE,LO]{{\fontfamily{phv}\selectfont{\textbf{\rightmark}}}}
\fancyhead[CO,CE]{\thepage}
\fancyhead[RE,RO]{{\fontfamily{phv}\selectfont{\textbf{\leftmark}}}}}
\begin{document}
\pagestyle{dictstyle}
\dictchar{a}
\entry[headwords]{headwords}{translations}
\clearpage
\dictchar{b}
\entry[headwords]{headwords}{translations}
\end{document}
How can I place thumb indexes from \dictchar values now to the right odd and left even margin?
Best Answer
I guess what you want are chapter thumbs or a thumb index. Here’s a nearly automatic solution using TikZ:
Update
I made an update so it is now possible to set how many letter thumbs should fit in the margin before the next letter group starts from the to again. Thats better for a high number of group where the box height will be very small otherwise. I renamed
lettersum
byletterdiv
so the name matches the function.The counter
letterdiv
is used to set the number of boxes fitting in the page height. I set it to4
in my example to show how it works. As you can see the fifth letterE
is printed at the first position form to again.