0
\documentclass[10pt,a5paper]{abntex2}
\usepackage[brazil]{babel}
\usepackage{hyphenat}

\useshorthands{~}\defineshorthand{~=}{\hyp{}}

\begin{document}

\chapter{First~=Chapter}

\end{document}

Instead of ~= to become - (hyphen) on my bookmarks entries, it become = (a space and an equal sign):

z

1

hyperref doesn't let you do that, apparently. A bit hackish, but try this (this assumes that whatever ~ in a section title will become a valid pdf string):

\documentclass[10pt,a5paper]{abntex2}
\usepackage[brazil]{babel}
\usepackage{hyphenat}

\makeatletter
\def\HyPsd@LetUnexpandableSpace#1{%
  \if\noexpand~\noexpand#1%
  \else
    \expandafter\@firstofone
  \fi{\expandafter\futurelet\expandafter#1\expandafter\@gobble\space\relax}}
\makeatother

\useshorthands{~}
\defineshorthand{~=}{\hyp{}}

\begin{document}

\chapter{First~=Chapter}

\end{document}

enter image description here

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.