Two spaces in LaTeX code












2















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.










share|improve this question




















  • 2





    As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

    – 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


















2















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.










share|improve this question




















  • 2





    As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

    – 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
















2












2








2








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago









Werner

444k689791680




444k689791680










asked 3 hours ago









florflor

434




434








  • 2





    As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

    – 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
















  • 2





    As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

    – 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










2




2





As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

– JouleV
3 hours ago







As far as I know, the answer is no. In other word: hello world and hello world gives the same output.

– 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





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












1 Answer
1






active

oldest

votes


















5














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:



enter image description here



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}





share|improve this answer





















  • 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











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%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









5














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:



enter image description here



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}





share|improve this answer





















  • 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
















5














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:



enter image description here



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}





share|improve this answer





















  • 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














5












5








5







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:



enter image description here



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}





share|improve this answer















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:



enter image description here



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}






share|improve this answer














share|improve this answer



share|improve this answer








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. 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














  • 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








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


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f474797%2ftwo-spaces-in-latex-code%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

CARDNET

Boot-repair Failure: Unable to locate package grub-common:i386

濃尾地震