Invoking input without arguments/parameters












2















I am wondering what the effect is of invoking input without any arguments/parameters followed by an empty line:



Code:



....
input

....









share|improve this question









New contributor




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





















  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

    – Tiuri
    1 hour ago











  • Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

    – Ulrike Fischer
    1 hour ago
















2















I am wondering what the effect is of invoking input without any arguments/parameters followed by an empty line:



Code:



....
input

....









share|improve this question









New contributor




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





















  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

    – Tiuri
    1 hour ago











  • Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

    – Ulrike Fischer
    1 hour ago














2












2








2








I am wondering what the effect is of invoking input without any arguments/parameters followed by an empty line:



Code:



....
input

....









share|improve this question









New contributor




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












I am wondering what the effect is of invoking input without any arguments/parameters followed by an empty line:



Code:



....
input

....






input arguments






share|improve this question









New contributor




Hans-Peter Zehrfeld 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




Hans-Peter Zehrfeld 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 1 hour ago









Tiuri

5,1721630




5,1721630






New contributor




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









asked 1 hour ago









Hans-Peter ZehrfeldHans-Peter Zehrfeld

111




111




New contributor




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





New contributor





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






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













  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

    – Tiuri
    1 hour ago











  • Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

    – Ulrike Fischer
    1 hour ago



















  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

    – Tiuri
    1 hour ago











  • Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

    – Ulrike Fischer
    1 hour ago

















Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

– Tiuri
1 hour ago





Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.

– Tiuri
1 hour ago













Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

– Ulrike Fischer
1 hour ago





Why don't you try it out? (I get d:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored),.

– Ulrike Fischer
1 hour ago










2 Answers
2






active

oldest

votes


















5














The TeX primitive input takes no brace group it parses the following tokens in (rare for TeX) an implementation-specific manner to find a filename, expanding tokens as necessary. In web2c based implementations (almost all current ones) that is a sequence of non white-space characters or spaces within "-quoted strings.



LaTeX wraps this in a definition which looks ahead for { and if it is there takes a brace group and discards the braces, adding a space at the end.



So



input


Is the same as



input{}


and inputs the file .tex (which the latex distribution includes to avoid a low level file not found error on this input)






share|improve this answer
























  • .tex is also included in plain (if there is an empty line after the input).

    – Ulrike Fischer
    1 hour ago











  • @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

    – David Carlisle
    1 hour ago











  • I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

    – Ulrike Fischer
    1 hour ago



















3














It depends on what follows input. If I run tex zehrfeld, where zehrfeld.tex is



input

blank line above

input
no blank line

bye


I get the following console output:



This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
(./zehrfeld.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex
File ignored)
! I can't find file `no'.
l.6 no
blank line
(Press Enter to retry, or Control-D to exit)
Please type another input file name:


The reason is that the blank line is converted into par, which under normal conditions is not expandable. Therefore the filename turns out to be empty in the first case and .tex is tried; it exists in the LaTeX tool distribution.



In the second case the space is again ignored and the file name stops at the space, so no.tex is looked for.



By the way, inputspace story does not look for a file with a leading space.



If you try with LaTeX, the same happens, because input is redefined to look for a following { (eating spaces); if no open brace is found, the primitive input is called. The test file



documentclass{article}
begin{document}

input

blank line above

input
no blank line

stop


produces



This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex)
restricted write18 enabled.
entering extended mode
(./zehrfeld.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) (./zehrfeld.aux
) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)
! I can't find file `no'.
l.9 no
blank line
(Press Enter to retry, or Control-D to exit)
Please type another input file name:


What happens when a file with empty file name is looked for depends on your distribution and may also depend on the TeX implementation. The old TeXtures, for instance, first tried files without extension, because in the Macintosh world(late '80s and '90s) file extensions were not used.



Final note: if par is redefined, other things may happen: try with



defpar{aendgraf}

input

blank line above

input
no blank line

stop


which looks for a.tex because the primitive input does macro expansion until finding character tokens.






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


    }
    });






    Hans-Peter Zehrfeld 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%2f472358%2finvoking-input-without-arguments-parameters%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    The TeX primitive input takes no brace group it parses the following tokens in (rare for TeX) an implementation-specific manner to find a filename, expanding tokens as necessary. In web2c based implementations (almost all current ones) that is a sequence of non white-space characters or spaces within "-quoted strings.



    LaTeX wraps this in a definition which looks ahead for { and if it is there takes a brace group and discards the braces, adding a space at the end.



    So



    input


    Is the same as



    input{}


    and inputs the file .tex (which the latex distribution includes to avoid a low level file not found error on this input)






    share|improve this answer
























    • .tex is also included in plain (if there is an empty line after the input).

      – Ulrike Fischer
      1 hour ago











    • @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

      – David Carlisle
      1 hour ago











    • I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

      – Ulrike Fischer
      1 hour ago
















    5














    The TeX primitive input takes no brace group it parses the following tokens in (rare for TeX) an implementation-specific manner to find a filename, expanding tokens as necessary. In web2c based implementations (almost all current ones) that is a sequence of non white-space characters or spaces within "-quoted strings.



    LaTeX wraps this in a definition which looks ahead for { and if it is there takes a brace group and discards the braces, adding a space at the end.



    So



    input


    Is the same as



    input{}


    and inputs the file .tex (which the latex distribution includes to avoid a low level file not found error on this input)






    share|improve this answer
























    • .tex is also included in plain (if there is an empty line after the input).

      – Ulrike Fischer
      1 hour ago











    • @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

      – David Carlisle
      1 hour ago











    • I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

      – Ulrike Fischer
      1 hour ago














    5












    5








    5







    The TeX primitive input takes no brace group it parses the following tokens in (rare for TeX) an implementation-specific manner to find a filename, expanding tokens as necessary. In web2c based implementations (almost all current ones) that is a sequence of non white-space characters or spaces within "-quoted strings.



    LaTeX wraps this in a definition which looks ahead for { and if it is there takes a brace group and discards the braces, adding a space at the end.



    So



    input


    Is the same as



    input{}


    and inputs the file .tex (which the latex distribution includes to avoid a low level file not found error on this input)






    share|improve this answer













    The TeX primitive input takes no brace group it parses the following tokens in (rare for TeX) an implementation-specific manner to find a filename, expanding tokens as necessary. In web2c based implementations (almost all current ones) that is a sequence of non white-space characters or spaces within "-quoted strings.



    LaTeX wraps this in a definition which looks ahead for { and if it is there takes a brace group and discards the braces, adding a space at the end.



    So



    input


    Is the same as



    input{}


    and inputs the file .tex (which the latex distribution includes to avoid a low level file not found error on this input)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 1 hour ago









    David CarlisleDavid Carlisle

    487k4111271871




    487k4111271871













    • .tex is also included in plain (if there is an empty line after the input).

      – Ulrike Fischer
      1 hour ago











    • @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

      – David Carlisle
      1 hour ago











    • I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

      – Ulrike Fischer
      1 hour ago



















    • .tex is also included in plain (if there is an empty line after the input).

      – Ulrike Fischer
      1 hour ago











    • @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

      – David Carlisle
      1 hour ago











    • I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

      – Ulrike Fischer
      1 hour ago

















    .tex is also included in plain (if there is an empty line after the input).

    – Ulrike Fischer
    1 hour ago





    .tex is also included in plain (if there is an empty line after the input).

    – Ulrike Fischer
    1 hour ago













    @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

    – David Carlisle
    1 hour ago





    @UlrikeFischer yes but only because the file is distributed by latex and the latex input tree is in plains's default input path

    – David Carlisle
    1 hour ago













    I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

    – Ulrike Fischer
    1 hour ago





    I wasn't commenting the file, but that the primitive input looks also for .tex. Your description sounds a bit as if this happens only with the latex wrapper.

    – Ulrike Fischer
    1 hour ago











    3














    It depends on what follows input. If I run tex zehrfeld, where zehrfeld.tex is



    input

    blank line above

    input
    no blank line

    bye


    I get the following console output:



    This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
    (./zehrfeld.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex
    File ignored)
    ! I can't find file `no'.
    l.6 no
    blank line
    (Press Enter to retry, or Control-D to exit)
    Please type another input file name:


    The reason is that the blank line is converted into par, which under normal conditions is not expandable. Therefore the filename turns out to be empty in the first case and .tex is tried; it exists in the LaTeX tool distribution.



    In the second case the space is again ignored and the file name stops at the space, so no.tex is looked for.



    By the way, inputspace story does not look for a file with a leading space.



    If you try with LaTeX, the same happens, because input is redefined to look for a following { (eating spaces); if no open brace is found, the primitive input is called. The test file



    documentclass{article}
    begin{document}

    input

    blank line above

    input
    no blank line

    stop


    produces



    This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex)
    restricted write18 enabled.
    entering extended mode
    (./zehrfeld.tex
    LaTeX2e <2018-12-01>
    (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
    (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) (./zehrfeld.aux
    ) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)
    ! I can't find file `no'.
    l.9 no
    blank line
    (Press Enter to retry, or Control-D to exit)
    Please type another input file name:


    What happens when a file with empty file name is looked for depends on your distribution and may also depend on the TeX implementation. The old TeXtures, for instance, first tried files without extension, because in the Macintosh world(late '80s and '90s) file extensions were not used.



    Final note: if par is redefined, other things may happen: try with



    defpar{aendgraf}

    input

    blank line above

    input
    no blank line

    stop


    which looks for a.tex because the primitive input does macro expansion until finding character tokens.






    share|improve this answer






























      3














      It depends on what follows input. If I run tex zehrfeld, where zehrfeld.tex is



      input

      blank line above

      input
      no blank line

      bye


      I get the following console output:



      This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
      (./zehrfeld.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex
      File ignored)
      ! I can't find file `no'.
      l.6 no
      blank line
      (Press Enter to retry, or Control-D to exit)
      Please type another input file name:


      The reason is that the blank line is converted into par, which under normal conditions is not expandable. Therefore the filename turns out to be empty in the first case and .tex is tried; it exists in the LaTeX tool distribution.



      In the second case the space is again ignored and the file name stops at the space, so no.tex is looked for.



      By the way, inputspace story does not look for a file with a leading space.



      If you try with LaTeX, the same happens, because input is redefined to look for a following { (eating spaces); if no open brace is found, the primitive input is called. The test file



      documentclass{article}
      begin{document}

      input

      blank line above

      input
      no blank line

      stop


      produces



      This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex)
      restricted write18 enabled.
      entering extended mode
      (./zehrfeld.tex
      LaTeX2e <2018-12-01>
      (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
      Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
      (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) (./zehrfeld.aux
      ) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)
      ! I can't find file `no'.
      l.9 no
      blank line
      (Press Enter to retry, or Control-D to exit)
      Please type another input file name:


      What happens when a file with empty file name is looked for depends on your distribution and may also depend on the TeX implementation. The old TeXtures, for instance, first tried files without extension, because in the Macintosh world(late '80s and '90s) file extensions were not used.



      Final note: if par is redefined, other things may happen: try with



      defpar{aendgraf}

      input

      blank line above

      input
      no blank line

      stop


      which looks for a.tex because the primitive input does macro expansion until finding character tokens.






      share|improve this answer




























        3












        3








        3







        It depends on what follows input. If I run tex zehrfeld, where zehrfeld.tex is



        input

        blank line above

        input
        no blank line

        bye


        I get the following console output:



        This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
        (./zehrfeld.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex
        File ignored)
        ! I can't find file `no'.
        l.6 no
        blank line
        (Press Enter to retry, or Control-D to exit)
        Please type another input file name:


        The reason is that the blank line is converted into par, which under normal conditions is not expandable. Therefore the filename turns out to be empty in the first case and .tex is tried; it exists in the LaTeX tool distribution.



        In the second case the space is again ignored and the file name stops at the space, so no.tex is looked for.



        By the way, inputspace story does not look for a file with a leading space.



        If you try with LaTeX, the same happens, because input is redefined to look for a following { (eating spaces); if no open brace is found, the primitive input is called. The test file



        documentclass{article}
        begin{document}

        input

        blank line above

        input
        no blank line

        stop


        produces



        This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex)
        restricted write18 enabled.
        entering extended mode
        (./zehrfeld.tex
        LaTeX2e <2018-12-01>
        (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
        Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
        (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) (./zehrfeld.aux
        ) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)
        ! I can't find file `no'.
        l.9 no
        blank line
        (Press Enter to retry, or Control-D to exit)
        Please type another input file name:


        What happens when a file with empty file name is looked for depends on your distribution and may also depend on the TeX implementation. The old TeXtures, for instance, first tried files without extension, because in the Macintosh world(late '80s and '90s) file extensions were not used.



        Final note: if par is redefined, other things may happen: try with



        defpar{aendgraf}

        input

        blank line above

        input
        no blank line

        stop


        which looks for a.tex because the primitive input does macro expansion until finding character tokens.






        share|improve this answer















        It depends on what follows input. If I run tex zehrfeld, where zehrfeld.tex is



        input

        blank line above

        input
        no blank line

        bye


        I get the following console output:



        This is TeX, Version 3.14159265 (TeX Live 2018) (preloaded format=tex)
        (./zehrfeld.tex (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex
        File ignored)
        ! I can't find file `no'.
        l.6 no
        blank line
        (Press Enter to retry, or Control-D to exit)
        Please type another input file name:


        The reason is that the blank line is converted into par, which under normal conditions is not expandable. Therefore the filename turns out to be empty in the first case and .tex is tried; it exists in the LaTeX tool distribution.



        In the second case the space is again ignored and the file name stops at the space, so no.tex is looked for.



        By the way, inputspace story does not look for a file with a leading space.



        If you try with LaTeX, the same happens, because input is redefined to look for a following { (eating spaces); if no open brace is found, the primitive input is called. The test file



        documentclass{article}
        begin{document}

        input

        blank line above

        input
        no blank line

        stop


        produces



        This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=latex)
        restricted write18 enabled.
        entering extended mode
        (./zehrfeld.tex
        LaTeX2e <2018-12-01>
        (/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
        Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
        (/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo)) (./zehrfeld.aux
        ) (/usr/local/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored)
        ! I can't find file `no'.
        l.9 no
        blank line
        (Press Enter to retry, or Control-D to exit)
        Please type another input file name:


        What happens when a file with empty file name is looked for depends on your distribution and may also depend on the TeX implementation. The old TeXtures, for instance, first tried files without extension, because in the Macintosh world(late '80s and '90s) file extensions were not used.



        Final note: if par is redefined, other things may happen: try with



        defpar{aendgraf}

        input

        blank line above

        input
        no blank line

        stop


        which looks for a.tex because the primitive input does macro expansion until finding character tokens.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 34 mins ago

























        answered 42 mins ago









        egregegreg

        716k8619003188




        716k8619003188






















            Hans-Peter Zehrfeld is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Hans-Peter Zehrfeld is a new contributor. Be nice, and check out our Code of Conduct.













            Hans-Peter Zehrfeld is a new contributor. Be nice, and check out our Code of Conduct.












            Hans-Peter Zehrfeld 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%2f472358%2finvoking-input-without-arguments-parameters%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

            SQL Server 17 - Attemping to backup to remote NAS but Access is denied

            Always On Availability groups resolving state after failover - Remote harden of transaction...

            Restoring from pg_dump with foreign key constraints