Hyperref bug with a def

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












The following very MWE shows the issue, which disappears when the call to hyperref is commented:



documentclassarticle

defntextuptiny N
defttextuptiny T

usepackagehyperref

begindocument

$_t$
$_t$
$_t$
$_t$

enddocument


However, it compiles fine when hyperref is called before the two def.










share|improve this question

















  • 4




    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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
    – moewe
    9 hours ago















up vote
2
down vote

favorite












The following very MWE shows the issue, which disappears when the call to hyperref is commented:



documentclassarticle

defntextuptiny N
defttextuptiny T

usepackagehyperref

begindocument

$_t$
$_t$
$_t$
$_t$

enddocument


However, it compiles fine when hyperref is called before the two def.










share|improve this question

















  • 4




    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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
    – moewe
    9 hours ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











The following very MWE shows the issue, which disappears when the call to hyperref is commented:



documentclassarticle

defntextuptiny N
defttextuptiny T

usepackagehyperref

begindocument

$_t$
$_t$
$_t$
$_t$

enddocument


However, it compiles fine when hyperref is called before the two def.










share|improve this question













The following very MWE shows the issue, which disappears when the call to hyperref is commented:



documentclassarticle

defntextuptiny N
defttextuptiny T

usepackagehyperref

begindocument

$_t$
$_t$
$_t$
$_t$

enddocument


However, it compiles fine when hyperref is called before the two def.







hyperref






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 9 hours ago









pluton

7,834960128




7,834960128







  • 4




    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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
    – moewe
    9 hours ago













  • 4




    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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
    – moewe
    9 hours ago








4




4




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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
– moewe
9 hours ago





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 usepackagehyperrefnewcommandttextuptiny T, you would have gotten an error.
– moewe
9 hours ago











1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










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 showt after begindocument



> t=macro:
->PD1-cmd t PD1t .


Without your redefinition and without hyperref, you'd get



> t=macro:
->OML-cmd t OMLt .


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.






share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459528%2fhyperref-bug-with-a-def%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    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 showt after begindocument



    > t=macro:
    ->PD1-cmd t PD1t .


    Without your redefinition and without hyperref, you'd get



    > t=macro:
    ->OML-cmd t OMLt .


    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.






    share|improve this answer
























      up vote
      4
      down vote



      accepted










      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 showt after begindocument



      > t=macro:
      ->PD1-cmd t PD1t .


      Without your redefinition and without hyperref, you'd get



      > t=macro:
      ->OML-cmd t OMLt .


      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.






      share|improve this answer






















        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        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 showt after begindocument



        > t=macro:
        ->PD1-cmd t PD1t .


        Without your redefinition and without hyperref, you'd get



        > t=macro:
        ->OML-cmd t OMLt .


        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.






        share|improve this answer












        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 showt after begindocument



        > t=macro:
        ->PD1-cmd t PD1t .


        Without your redefinition and without hyperref, you'd get



        > t=macro:
        ->OML-cmd t OMLt .


        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 9 hours ago









        egreg

        696k8518483111




        696k8518483111



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459528%2fhyperref-bug-with-a-def%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay