I'm using the following code for my index.

\documentclass[a4paper,11pt,twoside, openleft]{book}

  \expandafter\formatfirst\expandafter{\@car #1\@empty\@nil}%
  \@cdr #1\@empty\@nil}
  \def\@boldindexhardcode{\boldindexhardcode@i#1 \@nil}%
\def\boldindexhardcode@i#1 #2\@nil{%

\newcommand{\boldindex}[1]{ \textcolor{DarkPurple}{\textbf{\boldindexhardcode{#1}}}}




It renders like this: enter image description here

How am I able to remove the weird italic text, while keeping the bold text?

  • Remove \itshape from newcommand*\boldindexhardcode[1]{…}.
    – Bernard
    Jul 7 at 9:57
  • Thank you so much! How do I close the question?
    – superHenry
    Jul 7 at 10:07
  • I don't know exactly. Sometimes I see in a comment someone proposing to close a question, as it was solved in comments. Maybe, click on ‘Close’ at the bottom.
    – Bernard
    Jul 7 at 10:21

removing \itshape from newcommand*\boldindexhardcode[1]{…}

  • 1
    You just repeat the @Bernard comment ...
    – Zarko
    Jul 7 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.