If you use \newcommand
instead of \def
, you'll clearly see the source of the problem:
! LaTeX Error: Command \t already defined.
Or name \end... illegal, see p.192 of the manual.
The \t
command is defined in the LaTeX Internal Character Representation for the “tie accent” and hyperref
assumes this is the meaning of \t
. Since it has to do several patches for its working, you end up with \t
being essentially redefined to its original meaning, which can be seen if you add \show\t
after \begin{document}
> \t=macro:
->\PD1-cmd \t \PD1\t .
Without your redefinition and without hyperref
, you'd get
> \t=macro:
->\OML-cmd \t \OML\t .
which is essentially the same (the encoding name may change when \show
is used for technical reasons which are beyond the scope of this answer).
Moral: don't use \def
if you don't know precisely what you're doing. And never redefine a command with \renewcommand
if you don't know precisely about it.
hyperref
or one of the packages it loads redefines\t
. I suggest you take a different name for you macro, one letter names are always tightly contested and therefore dangerous. BTW: This is one of the reasons why it makes sense to (1) load all packages before you define custom commands and apply other (re-)definitions and (2) to use\newcommand
. If you had\usepackage{hyperref}\newcommand\t{\textup{\tiny T}}
, you would have gotten an error.