# Two consecutive spaces

When using some other editors, when you type two spaces with your space bar, two spaces are effectively displayed. This is not the case in LaTeX (btw, that's not the case on these websites ;) ).

My question is barely simple I guess, but I didn't found some information about it on Google.

How to display two consecutive spaces in LaTeX (I mean two spaces horizontally, with the space bar).

-
What are you actually trying to achieve in your document? Since all good typesetting programs adjust word spacing to best fit the justification of the text, the concept of a "space" doesn't really exist. If you need to format code or something, then there are better ways to this this. –  Alan Munn Jan 1 at 18:17
Adding two consecutive spaces after an end-of-sentence period is nowadays considered old fashioned (see e.g. Bringhurst's Elements of Typographic Style). If I understand correctly, word users have to add the spaces explicitly, which is prone to errors. LaTeX can add them automatically: just put \nonfrenchspacing in your preamble (this is the default). However, if you want a modern look of your document, just put \frenchspacing in your document preamble. This is what I recommend in LaTeX and Friends. –  Marc van Dongen Jan 1 at 19:43
@AlanMunn There are differences in spacing if \frenchspacing is disabled. –  Marc van Dongen Jan 1 at 19:45
As explained by Marc van Dongen, \frenchspacing controls the amount of space added by TeX/LaTeX after a sentence independent from the number of spaces in the source code. However, putting two spaces in the source code can still be useful, as editors like Vi and Vim use them to provide navigation like "move to the end of the current sentence". –  Christian Lindig Jan 1 at 20:04

\documentclass[12pt]{article}
\usepackage{libertine}
\begin{document}
\noindent
Firstword\space             Secondword\\
Firstword\space\space       Secondword\\
Firstword\space\space\space Secondword

% the space between words is \fontdimen2\font

\def\HS{\hspace{\fontdimen2\font}}\the\fontdimen2\font

\noindent
Firstword\HS       Secondword\\
Firstword\HS\HS    Secondword\\
Firstword\HS\HS\HS Secondword

\fontdimen2\font = 5\fontdimen2\font\the\fontdimen2\font

\noindent
Firstword\HS       Secondword\\
Firstword\HS\HS    Secondword\\
Firstword\HS\HS\HS Secondword
\end{document}


-
thanks for sharing. –  Nicholas Hamilton Jan 2 at 1:33