[Solved] How do I stop hyperref from putting PDF text enhancements in the bookmarks?

vy32 Asks: How do I stop hyperref from putting PDF text enhancements in the bookmarks?
In my book I used a stylized font and background to indicate bits, like this:


enter image description here

I do that with this macro:

Code:
newcommand{bindigits}[1]{colorbox{lightlightgray}{tt{#1}rm}xspace}

So I thought it would be fun to put my Part numbers in binary, like this:


enter image description here

Because I couldn’t get the book style part commands to work properly, I wrote my own:

Code:
newcommand{qpart}[3]{%
  cleardoublepagephantomsectionaddcontentsline{toc}{part}{Part {bindigits{#1}} #2}

  thispagestyle{empty}

  vspace{2in}

  titlerule[2pt]

  vspace{2ex}
    begin{center}
    {bfseriesHuge Part bindigits{#1}}\[2pc]
    {Huge #2}
    end{center}

    titlerule
    vspace{1em}
    #3
  cleardoublepage
}

And that works really well. I even get the stylized 01 in the table of contents:


enter image description here

But the PDF bookmarks look like this:


enter image description here

Which is weird.

Is there any way to fix this, or should I just take the enhancements out of the TOC?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.