3

Set up an index for a book and everything works well, except the page numbers listed for the words in the Index are all underlined---EXCEPT when I add bold face, then they look fine. Any ideas what the problem is? Thanks!

Okay, here it is:

\documentclass[final, leqno]{book}
\usepackage{natbib}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage{epsfig}
\usepackage{graphics} 
\usepackage{color}
\usepackage{hyperref}
\usepackage{rotating}
\usepackage{lscape}

\usepackage{latexsym}
\usepackage{CJK}
\usepackage{pinyin}
\usepackage{setspace}
\usepackage[outercaption]{sidecap}
\usepackage{ccaption}
\usepackage{verbatim}
\usepackage{fancyhdr}

\usepackage{makeidx}

\renewcommand{\figurename}{Fig.}

% Different font in captions
\newcommand{\captionfonts}{\small}

\makeatletter  % Allow the use of @ in command names
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{{\captionfonts #1: #2}}%
  \ifdim \wd\@tempboxa >\hsize
    {\captionfonts #1: #2\par}
  \else
    \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\makeatother   % Cancel the effect of \makeatletter

\renewcommand{\topfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.75}

\oddsidemargin = 0.75 in \evensidemargin = 0.75 in



\title{------------------------------  \\
-----------------}

\author{------ --------    \\
{\small\em \copyright \ Draft date \today}}

\date{}

\makeindex


\setcounter{secnumdepth}{-1}


\begin{document}
\begin{CJK}{GB}{gbsn}

\maketitle

\thispagestyle{empty}
\begin{center}
Copyright $\copyright$ 2005 by ------ --------
\end{center}
\newpage

\addcontentsline{toc}{chapter}{Contents}
\pagenumbering{roman}

\newpage

\tableofcontents

\include{Preface}

\pagestyle{headings} \pagenumbering{arabic}

\include{PartOne}
\include{PartTwo}
\include{PartThree}


\include{Glossary}

\include{Biblo}

\cleardoublepage \addcontentsline{toc}{chapter}{Index} \printindex
%\include{index}

%\cleardoublepage\addcontentsline{toc}{Chapter}{Index} \printindex

\end{CJK}
\end{document}

The page entries for the Index are underlined when I key \index{text} They are bold, not underlined and look fine when I use: \index{text|bf}

I understand that I'm supposed to place: \index{Selected text} after my index word and it should then come out like: Selected text, 34 in the Index, but when I do this & compile, the number is boldly underlined in the Yap assemblage. There must be some very simple solution, right? This version of LaTeX is fairly old---maybe eight years or so.

Apologies for not being equipped to discuss this properly---I obviously don't know anything about LaTeX (my wife set it up & convinced me to use it but she's too swamped to deal with it right now), but have been using it with little problem, finding quick solutions using GOOGLE searches. Surprised I've had no luck with this one, though. The Index is the last task of this 790 page book, which looks fantastic in all other respects---LaTeX really is the way to go.

Thanks, everyone, for trying to help me out.

David Carlisle
  • 757,742
  • 3
    Welcome to TeX.SX! Please add a minimal example that illustrates your problem. Of particular interest is the way you set up the index. – Caramdir Feb 16 '11 at 03:40
  • 4
    Then you use a style file (extension .ist) which underlines such page numbers. –  Feb 16 '11 at 08:39
  • @Rotring: The example shows no \index{...} and we do not know what is in your included files ... Your example does not provide real informations about your problem. –  Feb 16 '11 at 17:02
  • I'd bet my lunch that this example isn't minimal to produce this problem. (p.s. I have already eaten my lunch) – Seamus Feb 16 '11 at 17:02
  • Please look at http://tex.stackexchange.com/editing-help to see how to properly include code samples in your questions and answers. I formatted this one for you. Also, when including example code, try to provide a minimal example that illustrates the behavior you are asking about. Your example uses 16 packages. Does the problem you are describing only happen if you use these exact 16 packages, or can you leave some of them out? Does figurename and captionfont have anything to do with your problem? You should leave out anything that does not relate to your problem. – Jan Hlavacek Feb 16 '11 at 17:06
  • I deleted the other post so that everyone can concentrate on this one. This one had the most recent modification time so I judged it the best to keep. – Andrew Stacey Feb 16 '11 at 17:34
  • 1
    You say that the “number is underlined like a citation”. Citations typically aren't underlined. Are you sure it isn't just your pdf viewer highlighting links? – Caramdir Feb 16 '11 at 17:43
  • I'm still unclear as to what I'm meant to be seeing. I've just voted up your question. If someone else does so as well then you'll have enough reputation to post a screenshot of the relevant page. I think that that would help a great deal. – Andrew Stacey Feb 16 '11 at 18:16
  • Caramdir: Yes, the Yap cites are in parenteses, but the \cite{7} have underlines under the numbers, that's what I was refering to, sorry. Yap shows all Index entries (except the bold text mentioned) are boldly underlined. –  Feb 16 '11 at 22:48
  • Andrew: Thanks a lot. I had anticipated just sneaking in, getting a quick answer to a potentially dumb question, then sneaking out without attracting much attention... –  Feb 16 '11 at 22:58
  • Yes, that really looks like hyperref is underlining links. The hyperref package makes both the \cite{something} and index entries pages into hyperlinks, so they become clickable in pdf. If you have a table of contents, are the items there underlined, too? Or references to figures? All these are made into hyperlinks by hyperref. – Jan Hlavacek Feb 16 '11 at 23:37
  • Jan: YES! The Table of Contents is all underlined, but doesn't print that way. So that's it---an added benefit! That explains why, when I just tried setting up an Index manually, there were no underlines. I knew this had to have a simple explanation. Well, anyway, one quantitative person with a minor in scientific computing I just showed it to (who uses LaTeX all the time for articles) couldn't explain it either, so I don't feel quite as bad... Thanks so much for explaining this for me!!! –  Feb 16 '11 at 23:53
  • @Rotring: instead of thanking him in your question, you should accept Jan's answer by marking it as accepted (click on the checkmark). – Caramdir Feb 17 '11 at 00:07
  • Done. Gave it a click & it didn't seem to register, so I clicked it again. Let me know if it didn't work, or if there is a trick to it. –  Feb 17 '11 at 01:10
  • @Rotring: only click once. The second click undid it again. There is only a very subtle color difference. – Caramdir Feb 17 '11 at 03:41
  • Okay, I think I got it. This is an amazing site. Are you all editors for scientific journals? I was able to use LaTeX for my book without actually getting involved with it much at all. I may have no more need of it. However, it has intrigued me and if I do ever decide to get back into another project, I will attempt to gain some formal background so I know more about what I'm doing. All the best to you and the others who took time to help. –  Feb 17 '11 at 04:01

1 Answers1

3

I am pretty sure it is the hyperref package. This package turns all page numbers in the index into links. Normally, without any special setting, links are indicated by being framed. It is possible that you have a version of hyperref that is set up to underline links instead? In that case, you need to read the hyperref package documentation to see how to turn this off. I believe the colorlinks option will do it. To use it, replace \usepackage{hyperref} by \usepackage[colorlinks]{hyperref}.

Jan Hlavacek
  • 19,242