Use of noexpand in the implementation of TextOrMath for eTeXWhen to use edef, noexpand, and expandafter?Does noexpand have to be a primitive?Problem with nested noexpand and edefReplacement for unexpanded without eTeX extensionWhy do some arguments in a macro need to be preceded by noexpand?How to use noexpand in an edef?Why six noexpand in a row?How can I use noexpand and unexpanded without appending a space to the unexpanded tokens?How should I /protect this command for use in csname?ifx doesn't treat noexpand as relax

What is the word for reserving something for yourself before others do?

What are these boxed doors outside store fronts in New York?

Why do falling prices hurt debtors?

Dragon forelimb placement

Risk of getting Chronic Wasting Disease (CWD) in the United States?

Python: next in for loop

Why are electrically insulating heatsinks so rare? Is it just cost?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

Did Shadowfax go to Valinor?

How can bays and straits be determined in a procedurally generated map?

Why was the small council so happy for Tyrion to become the Master of Coin?

Show that if two triangles built on parallel lines, with equal bases have the same perimeter only if they are congruent.

Is a tag line useful on a cover?

Mathematical cryptic clues

Prove that NP is closed under karp reduction?

What's the point of deactivating Num Lock on login screens?

Why are 150k or 200k jobs considered good when there are 300k+ births a month?

Can a Warlock become Neutral Good?

Is this a crack on the carbon frame?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

How does one intimidate enemies without having the capacity for violence?

Why can't I see bouncing of a switch on an oscilloscope?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

How to format long polynomial?



Use of noexpand in the implementation of TextOrMath for eTeX


When to use edef, noexpand, and expandafter?Does noexpand have to be a primitive?Problem with nested noexpand and edefReplacement for unexpanded without eTeX extensionWhy do some arguments in a macro need to be preceded by noexpand?How to use noexpand in an edef?Why six noexpand in a row?How can I use noexpand and unexpanded without appending a space to the unexpanded tokens?How should I /protect this command for use in csname?ifx doesn't treat noexpand as relax













7















In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question






















  • thanks I suppose we could change that:-)

    – David Carlisle
    Apr 2 at 20:24











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    Apr 2 at 20:26















7















In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question






















  • thanks I suppose we could change that:-)

    – David Carlisle
    Apr 2 at 20:24











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    Apr 2 at 20:26













7












7








7








In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!










share|improve this question














In latexrelease 2015/01/01, there are two implementations of TextOrMath: one for regular
TeX, the other one for eTeX-like engines (more precisely: those which support protected). My question concerns the latter:



protectedexpandafterdefcsname TextOrMathspaceendcsname%
(...) % no problem here
edefTextOrMath#1#2% from latex.ltx
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2


I think I understand well these definitions, however I can't figure out why the edef isn't simply written this way:



edefTextOrMath#1#2% from me
csname TextOrMathspaceendcsname
#1#2


Since the internal TextOrMath<space> macro is protected, what is the point of preceding it with noexpand inside the edef? Is it because the author feared that protected might be deficient?..



I made a test like this (ran with pdfTeX):



% From latex.ltx (or p. 153 of source2e.pdf)
protectedexpandafterdefcsname TextOrMathspaceendcsname%
ifmmode expandafter@secondoftwo
else expandafter@firstoftwo fi

edefTextOrMath#1#2%
expandafternoexpandcsname TextOrMathspaceendcsname
#1#2

% My simpler way of doing the same (?)
edefaltTextOrMath#1#2%
csname TextOrMathspaceendcsname
#1#2

showTextOrMath % TextOrMath=macro:#1#2->TextOrMath #1#2.
showaltTextOrMath % altTextOrMath=ditto

ifxTextOrMathaltTextOrMath
identical
else
different
fi

vfill
eject
bye


This test prints 'identical' and seems to indicate that my definition is equivalent to the one in latex.ltx (but slightly simpler). Did I miss something?



Thanks!







macros expansion definition protected-macro






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 2 at 18:56









frougonfrougon

783611




783611












  • thanks I suppose we could change that:-)

    – David Carlisle
    Apr 2 at 20:24











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    Apr 2 at 20:26

















  • thanks I suppose we could change that:-)

    – David Carlisle
    Apr 2 at 20:24











  • Many thanks for your insight into this, I was really puzzled!

    – frougon
    Apr 2 at 20:26
















thanks I suppose we could change that:-)

– David Carlisle
Apr 2 at 20:24





thanks I suppose we could change that:-)

– David Carlisle
Apr 2 at 20:24













Many thanks for your insight into this, I was really puzzled!

– frougon
Apr 2 at 20:26





Many thanks for your insight into this, I was really puzzled!

– frougon
Apr 2 at 20:26










1 Answer
1






active

oldest

votes


















5














No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






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',
    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%2f482829%2fuse-of-noexpand-in-the-implementation-of-textormath-for-etex%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









    5














    No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






    share|improve this answer



























      5














      No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






      share|improve this answer

























        5












        5








        5







        No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....






        share|improve this answer













        No you didn't miss anything, just old habits die hard as we gradually add these modern post 1992 features into the sources....







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 2 at 20:14









        David CarlisleDavid Carlisle

        498k4111441892




        498k4111441892



























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482829%2fuse-of-noexpand-in-the-implementation-of-textormath-for-etex%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

            រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

            QGIS export composer to PDF scale the map [closed] Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Print Composer QGIS 2.6, how to export image?QGIS 2.8.1 print composer won't export all OpenCycleMap base layer tilesSave Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?Export QGIS Print Composer PDF with searchable text labelsQGIS Print Composer does not change from landscape to portrait orientation?How can I avoid map size and scale changes in print composer?Fuzzy PDF export in QGIS running on macSierra OSExport the legend into its 100% size using Print ComposerScale-dependent rendering in QGIS PDF output

            PDF-ში გადმოწერა სანავიგაციო მენიუproject page