Two spaces in LaTeX code
I have a simple question: does it make any difference whether at some point I have two spaces instead of one in the source code, say after a period? That is, will PdfTeX ever output different things with two codes that, everything else being equal, differ in this:
end of. Sentence
vs.
end of. Sentence
I am not asking about the difference between having frenchspacing
or not, I am really just interested in how multiple spaces in the source code are interpreted.
spacing sourcecode
add a comment |
I have a simple question: does it make any difference whether at some point I have two spaces instead of one in the source code, say after a period? That is, will PdfTeX ever output different things with two codes that, everything else being equal, differ in this:
end of. Sentence
vs.
end of. Sentence
I am not asking about the difference between having frenchspacing
or not, I am really just interested in how multiple spaces in the source code are interpreted.
spacing sourcecode
2
As far as I know, the answer is no. In other word:hello world
andhello world
gives the same output.
– JouleV
4 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, likeverb|...|
,lstlisting
orminted
.
– JouleV
3 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago
add a comment |
I have a simple question: does it make any difference whether at some point I have two spaces instead of one in the source code, say after a period? That is, will PdfTeX ever output different things with two codes that, everything else being equal, differ in this:
end of. Sentence
vs.
end of. Sentence
I am not asking about the difference between having frenchspacing
or not, I am really just interested in how multiple spaces in the source code are interpreted.
spacing sourcecode
I have a simple question: does it make any difference whether at some point I have two spaces instead of one in the source code, say after a period? That is, will PdfTeX ever output different things with two codes that, everything else being equal, differ in this:
end of. Sentence
vs.
end of. Sentence
I am not asking about the difference between having frenchspacing
or not, I am really just interested in how multiple spaces in the source code are interpreted.
spacing sourcecode
spacing sourcecode
edited 3 hours ago
Werner
444k689791680
444k689791680
asked 4 hours ago
florflor
484
484
2
As far as I know, the answer is no. In other word:hello world
andhello world
gives the same output.
– JouleV
4 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, likeverb|...|
,lstlisting
orminted
.
– JouleV
3 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago
add a comment |
2
As far as I know, the answer is no. In other word:hello world
andhello world
gives the same output.
– JouleV
4 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, likeverb|...|
,lstlisting
orminted
.
– JouleV
3 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago
2
2
As far as I know, the answer is no. In other word:
hello world
and hello world
gives the same output.– JouleV
4 hours ago
As far as I know, the answer is no. In other word:
hello world
and hello world
gives the same output.– JouleV
4 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, like
verb|...|
, lstlisting
or minted
.– JouleV
3 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, like
verb|...|
, lstlisting
or minted
.– JouleV
3 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago
add a comment |
1 Answer
1
active
oldest
votes
No. Multiple consecutive spaces are gobbled into a single space within the code, unless they are hard coded (like using ~
or
- a control space - or via hspace
, or ...).
The setting of it might differ, however, depending on the other elements within the line of text. This is because the inter-word spacing can shrink/stretch as the paragraph setting is optimised. Here are some examples that hopefully illustrates this:
documentclass{article}
begin{document}
% Same end-of-sentence/period
This is text. Some more text.
This is text. Some more text.
This is text. Some more text.
hrulefill
% Regular space
This is text. Some more text.
This is text.~Some more text.
hrulefill
medskip
% Stretched inter-word space
parbox{120pt}{This is text. Some more text.}
medskip
parbox{120pt}{This is text. Some more text.}
end{document}
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. anindex
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.
– barbara beeton
2 hours ago
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f474797%2ftwo-spaces-in-latex-code%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
No. Multiple consecutive spaces are gobbled into a single space within the code, unless they are hard coded (like using ~
or
- a control space - or via hspace
, or ...).
The setting of it might differ, however, depending on the other elements within the line of text. This is because the inter-word spacing can shrink/stretch as the paragraph setting is optimised. Here are some examples that hopefully illustrates this:
documentclass{article}
begin{document}
% Same end-of-sentence/period
This is text. Some more text.
This is text. Some more text.
This is text. Some more text.
hrulefill
% Regular space
This is text. Some more text.
This is text.~Some more text.
hrulefill
medskip
% Stretched inter-word space
parbox{120pt}{This is text. Some more text.}
medskip
parbox{120pt}{This is text. Some more text.}
end{document}
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. anindex
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.
– barbara beeton
2 hours ago
add a comment |
No. Multiple consecutive spaces are gobbled into a single space within the code, unless they are hard coded (like using ~
or
- a control space - or via hspace
, or ...).
The setting of it might differ, however, depending on the other elements within the line of text. This is because the inter-word spacing can shrink/stretch as the paragraph setting is optimised. Here are some examples that hopefully illustrates this:
documentclass{article}
begin{document}
% Same end-of-sentence/period
This is text. Some more text.
This is text. Some more text.
This is text. Some more text.
hrulefill
% Regular space
This is text. Some more text.
This is text.~Some more text.
hrulefill
medskip
% Stretched inter-word space
parbox{120pt}{This is text. Some more text.}
medskip
parbox{120pt}{This is text. Some more text.}
end{document}
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. anindex
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.
– barbara beeton
2 hours ago
add a comment |
No. Multiple consecutive spaces are gobbled into a single space within the code, unless they are hard coded (like using ~
or
- a control space - or via hspace
, or ...).
The setting of it might differ, however, depending on the other elements within the line of text. This is because the inter-word spacing can shrink/stretch as the paragraph setting is optimised. Here are some examples that hopefully illustrates this:
documentclass{article}
begin{document}
% Same end-of-sentence/period
This is text. Some more text.
This is text. Some more text.
This is text. Some more text.
hrulefill
% Regular space
This is text. Some more text.
This is text.~Some more text.
hrulefill
medskip
% Stretched inter-word space
parbox{120pt}{This is text. Some more text.}
medskip
parbox{120pt}{This is text. Some more text.}
end{document}
No. Multiple consecutive spaces are gobbled into a single space within the code, unless they are hard coded (like using ~
or
- a control space - or via hspace
, or ...).
The setting of it might differ, however, depending on the other elements within the line of text. This is because the inter-word spacing can shrink/stretch as the paragraph setting is optimised. Here are some examples that hopefully illustrates this:
documentclass{article}
begin{document}
% Same end-of-sentence/period
This is text. Some more text.
This is text. Some more text.
This is text. Some more text.
hrulefill
% Regular space
This is text. Some more text.
This is text.~Some more text.
hrulefill
medskip
% Stretched inter-word space
parbox{120pt}{This is text. Some more text.}
medskip
parbox{120pt}{This is text. Some more text.}
end{document}
edited 2 hours ago
answered 3 hours ago
WernerWerner
444k689791680
444k689791680
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. anindex
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.
– barbara beeton
2 hours ago
add a comment |
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. anindex
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.
– barbara beeton
2 hours ago
2
2
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. an
index
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.– barbara beeton
2 hours ago
You might want to be ultra specific and say "multiple consecutive spaces". If something "invisible" (e.g. an
index
entry) comes between two spaces in the input stream, each space is handled separately, and the output can look quite ragged.– barbara beeton
2 hours ago
add a comment |
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f474797%2ftwo-spaces-in-latex-code%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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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
2
As far as I know, the answer is no. In other word:
hello world
andhello world
gives the same output.– JouleV
4 hours ago
Edit of above comment: "hello_world" and "hello_ _ _ _world" are the same, except they are put in a "source-code" environment, like
verb|...|
,lstlisting
orminted
.– JouleV
3 hours ago
No, but one should use Mr.~Smith or {Mr.} Jones when only one space is wanted. Okay, it probably isn't precisely a 2/1 ratio, but it is smaller.
– John Kormylo
2 hours ago