Does LaTeX redefine [some] TeX primitives?What is the difference between TeX and LaTeX?How is char processed in math mode?Why is there no mudimendef primitive?What is the difference between empty and @empty?Why isn't everything expandable?Creating new primitivesInput/Output primitives of TeXKnuth “Some Implementations of TeX”…Commands in TeX which are different in LaTeXHow to make commands defined by def behave as strings?Should different TeX implementations (e.g. MiKTeX's and TeX Live's) produce identical DVI files?Different file opened by openin (was: between 2017 and 2018)

Word or idiom defining something barely functional

SQL Minimum Row count

How to display a duet in lyrics?

What method to use in a batch apex in order to get authentication token from a remote server?

Plausibility of Ice Eaters in the Arctic

Generator for parity?

What is a "Genuine Geraldo interviewee"?

Is multiplication of real numbers uniquely defined as being distributive over addition?

Why are physicists so interested in irreps if in their non-block-diagonal form they mix all components of a vector?

Does a code snippet compile? Or does it gets compiled?

What happen if I gain the control of aura that enchants an opponent's creature? Would the aura stay attached?

English - Acceptable use of parentheses in an author's name

Sierpinski turtle triangle

Infeasibility in mathematical optimization models

A question about 'reptile and volatiles' to describe creatures

Pretty heat maps

Geometric programming: Why are the constraints defined to be less than/equal to 1?

Yajilin minicubes: the Hullabaloo, the Brouhaha, the Bangarang

Why can I log in to my Facebook account with a misspelled email/password?

Acceptable to cut steak before searing?

Why does Intel's Haswell chip allow multiplication to be twice as fast as addition?

What is the idiomatic way of saying “he is ticklish under armpits”?

Are there any differences in causality between linear and logistic regression?

Reusing story title as chapter title



Does LaTeX redefine [some] TeX primitives?


What is the difference between TeX and LaTeX?How is char processed in math mode?Why is there no mudimendef primitive?What is the difference between empty and @empty?Why isn't everything expandable?Creating new primitivesInput/Output primitives of TeXKnuth “Some Implementations of TeX”…Commands in TeX which are different in LaTeXHow to make commands defined by def behave as strings?Should different TeX implementations (e.g. MiKTeX's and TeX Live's) produce identical DVI files?Different file opened by openin (was: between 2017 and 2018)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I read in "What is the difference between TeX and LaTeX?" that LaTeX is a collection of macros (an extension) built on top of TeX. Supposedly, TeX primitives should then behave in LaTeX the same way they do in TeX. However, it seems it is not always the case. In "How is char processed in math mode?", it is explained why char behaves in text mode differently from math mode. But this is only in TeX. In LaTeX, however, char behaves identically in text and math modes, as it can be seen from the following example:



documentclassarticle 
begindocument
In text mode, we obtain char"5. In math mode, we also obtain $char"5$.
enddocument


In TeX, the result is different:



In text mode, we obtain char"5. In math mode, we obtain $char"5$.
bye


It seems that some TeX primitives (at least one: char) are redefined in LaTeX. I would like to know whether TeX primitives must be redefined in LaTeX. If yes, why? Are there other TeX primitives that are redefined in LaTeX? Are not TeX and LaTeX expected to produce the same result on such a simple piece of code (as in the example)?










share|improve this question









New contributor



spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    6















    I read in "What is the difference between TeX and LaTeX?" that LaTeX is a collection of macros (an extension) built on top of TeX. Supposedly, TeX primitives should then behave in LaTeX the same way they do in TeX. However, it seems it is not always the case. In "How is char processed in math mode?", it is explained why char behaves in text mode differently from math mode. But this is only in TeX. In LaTeX, however, char behaves identically in text and math modes, as it can be seen from the following example:



    documentclassarticle 
    begindocument
    In text mode, we obtain char"5. In math mode, we also obtain $char"5$.
    enddocument


    In TeX, the result is different:



    In text mode, we obtain char"5. In math mode, we obtain $char"5$.
    bye


    It seems that some TeX primitives (at least one: char) are redefined in LaTeX. I would like to know whether TeX primitives must be redefined in LaTeX. If yes, why? Are there other TeX primitives that are redefined in LaTeX? Are not TeX and LaTeX expected to produce the same result on such a simple piece of code (as in the example)?










    share|improve this question









    New contributor



    spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      6












      6








      6








      I read in "What is the difference between TeX and LaTeX?" that LaTeX is a collection of macros (an extension) built on top of TeX. Supposedly, TeX primitives should then behave in LaTeX the same way they do in TeX. However, it seems it is not always the case. In "How is char processed in math mode?", it is explained why char behaves in text mode differently from math mode. But this is only in TeX. In LaTeX, however, char behaves identically in text and math modes, as it can be seen from the following example:



      documentclassarticle 
      begindocument
      In text mode, we obtain char"5. In math mode, we also obtain $char"5$.
      enddocument


      In TeX, the result is different:



      In text mode, we obtain char"5. In math mode, we obtain $char"5$.
      bye


      It seems that some TeX primitives (at least one: char) are redefined in LaTeX. I would like to know whether TeX primitives must be redefined in LaTeX. If yes, why? Are there other TeX primitives that are redefined in LaTeX? Are not TeX and LaTeX expected to produce the same result on such a simple piece of code (as in the example)?










      share|improve this question









      New contributor



      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I read in "What is the difference between TeX and LaTeX?" that LaTeX is a collection of macros (an extension) built on top of TeX. Supposedly, TeX primitives should then behave in LaTeX the same way they do in TeX. However, it seems it is not always the case. In "How is char processed in math mode?", it is explained why char behaves in text mode differently from math mode. But this is only in TeX. In LaTeX, however, char behaves identically in text and math modes, as it can be seen from the following example:



      documentclassarticle 
      begindocument
      In text mode, we obtain char"5. In math mode, we also obtain $char"5$.
      enddocument


      In TeX, the result is different:



      In text mode, we obtain char"5. In math mode, we obtain $char"5$.
      bye


      It seems that some TeX primitives (at least one: char) are redefined in LaTeX. I would like to know whether TeX primitives must be redefined in LaTeX. If yes, why? Are there other TeX primitives that are redefined in LaTeX? Are not TeX and LaTeX expected to produce the same result on such a simple piece of code (as in the example)?







      tex-core






      share|improve this question









      New contributor



      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question









      New contributor



      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question








      edited 6 hours ago









      siracusa

      7,8212 gold badges18 silver badges35 bronze badges




      7,8212 gold badges18 silver badges35 bronze badges






      New contributor



      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 8 hours ago









      spyglass007spyglass007

      333 bronze badges




      333 bronze badges




      New contributor



      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      spyglass007 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          1 Answer
          1






          active

          oldest

          votes


















          4














          LaTeX redefines the primitives input, end, -, /, underline and, in some contexts, par. It does not redefine char, but it uses different math codes.



          In plain TeX we see



          mathcode`^^E="023A % lnot


          but LaTeX doesn't assign a mathcode to ^^E (ASCII 5), so the value is as initially, that is, 5.



          When TeX processes char<number> in math mode, it uses the mathcode of the character, just as if the character was directly input. So in plain TeX you get character "3A in family 2 (lnot); in LaTeX you get character "5 in family 0.



          Redefined primitives




          • input is redefined to allow input<filename>;


          • end is redefined to mark the end of environments;


          • - and / are redefined for technical reasons;


          • underline is redefined to be also used in text mode.

          As far as par is concerned, the redefinitions are essential for list-like environments.



          Why does plain TeX assign a math code to ASCII 5?



          Because Knuth used extended character sets and his keyboard allowed to directly input ¬ and other characters. So he found it convenient to set math codes for the extended character set.






          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
            );



            );






            spyglass007 is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f503599%2fdoes-latex-redefine-some-tex-primitives%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














            LaTeX redefines the primitives input, end, -, /, underline and, in some contexts, par. It does not redefine char, but it uses different math codes.



            In plain TeX we see



            mathcode`^^E="023A % lnot


            but LaTeX doesn't assign a mathcode to ^^E (ASCII 5), so the value is as initially, that is, 5.



            When TeX processes char<number> in math mode, it uses the mathcode of the character, just as if the character was directly input. So in plain TeX you get character "3A in family 2 (lnot); in LaTeX you get character "5 in family 0.



            Redefined primitives




            • input is redefined to allow input<filename>;


            • end is redefined to mark the end of environments;


            • - and / are redefined for technical reasons;


            • underline is redefined to be also used in text mode.

            As far as par is concerned, the redefinitions are essential for list-like environments.



            Why does plain TeX assign a math code to ASCII 5?



            Because Knuth used extended character sets and his keyboard allowed to directly input ¬ and other characters. So he found it convenient to set math codes for the extended character set.






            share|improve this answer































              4














              LaTeX redefines the primitives input, end, -, /, underline and, in some contexts, par. It does not redefine char, but it uses different math codes.



              In plain TeX we see



              mathcode`^^E="023A % lnot


              but LaTeX doesn't assign a mathcode to ^^E (ASCII 5), so the value is as initially, that is, 5.



              When TeX processes char<number> in math mode, it uses the mathcode of the character, just as if the character was directly input. So in plain TeX you get character "3A in family 2 (lnot); in LaTeX you get character "5 in family 0.



              Redefined primitives




              • input is redefined to allow input<filename>;


              • end is redefined to mark the end of environments;


              • - and / are redefined for technical reasons;


              • underline is redefined to be also used in text mode.

              As far as par is concerned, the redefinitions are essential for list-like environments.



              Why does plain TeX assign a math code to ASCII 5?



              Because Knuth used extended character sets and his keyboard allowed to directly input ¬ and other characters. So he found it convenient to set math codes for the extended character set.






              share|improve this answer





























                4












                4








                4







                LaTeX redefines the primitives input, end, -, /, underline and, in some contexts, par. It does not redefine char, but it uses different math codes.



                In plain TeX we see



                mathcode`^^E="023A % lnot


                but LaTeX doesn't assign a mathcode to ^^E (ASCII 5), so the value is as initially, that is, 5.



                When TeX processes char<number> in math mode, it uses the mathcode of the character, just as if the character was directly input. So in plain TeX you get character "3A in family 2 (lnot); in LaTeX you get character "5 in family 0.



                Redefined primitives




                • input is redefined to allow input<filename>;


                • end is redefined to mark the end of environments;


                • - and / are redefined for technical reasons;


                • underline is redefined to be also used in text mode.

                As far as par is concerned, the redefinitions are essential for list-like environments.



                Why does plain TeX assign a math code to ASCII 5?



                Because Knuth used extended character sets and his keyboard allowed to directly input ¬ and other characters. So he found it convenient to set math codes for the extended character set.






                share|improve this answer















                LaTeX redefines the primitives input, end, -, /, underline and, in some contexts, par. It does not redefine char, but it uses different math codes.



                In plain TeX we see



                mathcode`^^E="023A % lnot


                but LaTeX doesn't assign a mathcode to ^^E (ASCII 5), so the value is as initially, that is, 5.



                When TeX processes char<number> in math mode, it uses the mathcode of the character, just as if the character was directly input. So in plain TeX you get character "3A in family 2 (lnot); in LaTeX you get character "5 in family 0.



                Redefined primitives




                • input is redefined to allow input<filename>;


                • end is redefined to mark the end of environments;


                • - and / are redefined for technical reasons;


                • underline is redefined to be also used in text mode.

                As far as par is concerned, the redefinitions are essential for list-like environments.



                Why does plain TeX assign a math code to ASCII 5?



                Because Knuth used extended character sets and his keyboard allowed to directly input ¬ and other characters. So he found it convenient to set math codes for the extended character set.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 7 hours ago

























                answered 7 hours ago









                egregegreg

                761k90 gold badges1987 silver badges3337 bronze badges




                761k90 gold badges1987 silver badges3337 bronze badges























                    spyglass007 is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    spyglass007 is a new contributor. Be nice, and check out our Code of Conduct.












                    spyglass007 is a new contributor. Be nice, and check out our Code of Conduct.











                    spyglass007 is a new contributor. Be nice, and check out our Code of Conduct.














                    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%2f503599%2fdoes-latex-redefine-some-tex-primitives%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

                    ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                    Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу