Hyperref bug with a def










2














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
    Nov 11 '18 at 22:36
















2














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
    Nov 11 '18 at 22:36














2












2








2







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 Nov 11 '18 at 22:31









pluton

7,960960131




7,960960131







  • 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
    Nov 11 '18 at 22:36













  • 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
    Nov 11 '18 at 22:36








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
Nov 11 '18 at 22:36





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
Nov 11 '18 at 22:36











1 Answer
1






active

oldest

votes


















4














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




















  • Thanks. I should have guess but the error message disturbed me a bit.
    – pluton
    Nov 12 '18 at 8:28










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',
autoActivateHeartbeat: false,
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















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














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




















  • Thanks. I should have guess but the error message disturbed me a bit.
    – pluton
    Nov 12 '18 at 8:28















4














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




















  • Thanks. I should have guess but the error message disturbed me a bit.
    – pluton
    Nov 12 '18 at 8:28













4












4








4






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 Nov 11 '18 at 22:37









egreg

710k8618853170




710k8618853170











  • Thanks. I should have guess but the error message disturbed me a bit.
    – pluton
    Nov 12 '18 at 8:28
















  • Thanks. I should have guess but the error message disturbed me a bit.
    – pluton
    Nov 12 '18 at 8:28















Thanks. I should have guess but the error message disturbed me a bit.
– pluton
Nov 12 '18 at 8:28




Thanks. I should have guess but the error message disturbed me a bit.
– pluton
Nov 12 '18 at 8:28

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




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















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo