Invoking input without arguments/parameters
I am wondering what the effect is of invoking input
without any arguments/parameters followed by an empty line:
Code:
....
input
....
input arguments
New contributor
add a comment |
I am wondering what the effect is of invoking input
without any arguments/parameters followed by an empty line:
Code:
....
input
....
input arguments
New contributor
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 getd:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored
),.
– Ulrike Fischer
1 hour ago
add a comment |
I am wondering what the effect is of invoking input
without any arguments/parameters followed by an empty line:
Code:
....
input
....
input arguments
New contributor
I am wondering what the effect is of invoking input
without any arguments/parameters followed by an empty line:
Code:
....
input
....
input arguments
input arguments
New contributor
New contributor
edited 1 hour ago
Tiuri
5,1721630
5,1721630
New contributor
asked 1 hour ago
Hans-Peter ZehrfeldHans-Peter Zehrfeld
111
111
New contributor
New contributor
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 getd:/texlive/2018/texmf-dist/tex/latex/tools/.tex File ignored
),.
– Ulrike Fischer
1 hour ago
add a comment |
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 getd:/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
add a comment |
2 Answers
2
active
oldest
votes
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)
.tex
is also included in plain (if there is an empty line after theinput
).
– 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 primitiveinput
looks also for.tex
. Your description sounds a bit as if this happens only with the latex wrapper.
– Ulrike Fischer
1 hour ago
add a comment |
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.
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
.tex
is also included in plain (if there is an empty line after theinput
).
– 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 primitiveinput
looks also for.tex
. Your description sounds a bit as if this happens only with the latex wrapper.
– Ulrike Fischer
1 hour ago
add a comment |
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)
.tex
is also included in plain (if there is an empty line after theinput
).
– 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 primitiveinput
looks also for.tex
. Your description sounds a bit as if this happens only with the latex wrapper.
– Ulrike Fischer
1 hour ago
add a comment |
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)
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)
answered 1 hour ago
David CarlisleDavid Carlisle
487k4111271871
487k4111271871
.tex
is also included in plain (if there is an empty line after theinput
).
– 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 primitiveinput
looks also for.tex
. Your description sounds a bit as if this happens only with the latex wrapper.
– Ulrike Fischer
1 hour ago
add a comment |
.tex
is also included in plain (if there is an empty line after theinput
).
– 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 primitiveinput
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited 34 mins ago
answered 42 mins ago
egregegreg
716k8619003188
716k8619003188
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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