## LaTeX forum ⇒ General ⇒ spacing after periods

LaTeX specific issues not fitting into one of the other forums of this category.
darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

### spacing after periods

Hi all. I'm using a modified report class and need to ensure that there are two spaces after a period ending a sentence. Can someone help me figure out where to look for this info in the style file? Or is there a way to force this by adding something in my preamble? (My Grad Studies dept insists on two spaces regardless of how wrong I tell them it is.) TIA!

Tags:

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi darckhart,

try the effect of this value for example:
\xspaceskip8pt
Btw. the spacing between words and also after punctuation marks has no fixed length, it may be stretched or shrinked by TeX algorithms.

Stefan

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am
Yes, I thought latex used algorithms for variable spacing to work with the left/right justification. I'll see if I can hunt down that book. Thanks.

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
That book is freely available, look on CTAN for the tex source or here as pdf.
In the meantime why don't you try to set \xspaceskip to a bigger value to see the effect.

Stefan

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am
Hi Stefan. Thanks for the link. Changing the value did produce drastic results. (I also found out that my use of the ragged2e package was overwriting certain plain tex algorithms, hence the spacing after periods seemed to be quite different than when using plain tex.)

Another question: how can I display the current value of xspaceskip? (I vaguely remember using some command like \value except that didn't seem to work.)

And another: After reading the section in the TeXbook, the bottom of pg75 explains how TeX calculates spacing by using some parameters specific to the font. For example, he gives the values of the parameters for cmr 10, where normal space = 3.33333 pt, normal stretch = 1.66666 pt, normal shrink = 1.11111 pt, and extra space = 1.11111 pt. Where would I find information like this on the font I am using? (I am using txfonts package.) I presume I would need this info in order to pick an appropriate xspaceskip so that the "double space after the period" requirement could be fulfilled. I checked the pdf help doc, the sty file, and the tex file for txfonts, but could not find mention of those parameters. I am not sure which other files to look at. I see tfm, vf, afm, and pfb files but am not sure how to check/open them.

Thanks for your patience and continued help!
Last edited by darckhart on Tue May 13, 2008 3:33 am, edited 1 time in total.

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi darckhart,

\the\xspaceskip prints the value in the pdf (dvi) output. \showthe\xspaceskip does the same but in the logfile. The default value should be 0.0pt.

Stefan

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am
Oh what luck! You are online too! Sorry I keep editing my post as I find I have more and more questions, but I do like to figure out how it works so that I can understand why it's doing what it's doing. Thanks!

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Yes I am still online. Now I've seen your other question after you edited your posting. Here are some lines that will show those dimensions:
\documentclass[a4paper,10pt]{article}\usepackage{txfonts}\begin{document}\begin{description}   \item[interword space] \the\fontdimen2\font   \item[interword stretch] \the\fontdimen3\font   \item[interword shrink] \the\fontdimen4\font   \item[extra space] \the\fontdimen7\font   \item[xspaceskip] \the\xspaceskip\end{description} \end{document}

Remove \usepackage{txfonts} (or comment out) and you will see the cmr10 standard values.

Stefan

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am
Sorry for late reply, but I don't have internet access at home. Thanks for the examples. From what I'm reading, it appears that the use of spaceskip and xspaceskip will override the algorithms for stretching/shrinking interword and after-period space and replace it with a single defined space of specified dimension respectively.

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi darckhart,

yes, I understand it this way too: \xspaceskip replaces interword space (if it's nonzero and f>=2000). \spaceskip would still be calculated using f. f is set by \sfcode. The value of f for different symbols is set default like this:
\sfcodeâ€˜\.3000\sfcodeâ€˜\?3000\sfcodeâ€˜\!3000\sfcodeâ€˜\:2000\sfcodeâ€˜\;1500\sfcodeâ€˜\,1250

for nonfrenchspacing. With frenchspacing all those values would be set to 1000.

Another good source is the freely available book TeX by Topic by by Victor Eijkhout, see Chapter 20 Spacing.

Stefan