LaTeX forum ⇒ Generalspacing 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

Postby darckhart » Mon May 12, 2008 12:02 am

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:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8072
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon May 12, 2008 1:03 am

Hi darckhart,

try the effect of this value for example:
  1. \xspaceskip8pt
Try other values for it. You can read about this in the TeXbook Chapter 12 Glue.
Btw. the spacing between words and also after punctuation marks has no fixed length, it may be stretched or shrinked by TeX algorithms.

Stefan
Site admin

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Postby darckhart » Mon May 12, 2008 10:56 pm

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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8072
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon May 12, 2008 11:04 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
Site admin

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Postby darckhart » Tue May 13, 2008 3:08 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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8072
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue May 13, 2008 3:31 am

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
Site admin

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Postby darckhart » Tue May 13, 2008 3:35 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!

User avatar
Stefan Kottwitz
Site Admin
Posts: 8072
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue May 13, 2008 3:48 am

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:
  1. \documentclass[a4paper,10pt]{article}
  2. \usepackage{txfonts}
  3. \begin{document}
  4. \begin{description}
  5. \item[interword space] \the\fontdimen2\font
  6. \item[interword stretch] \the\fontdimen3\font
  7. \item[interword shrink] \the\fontdimen4\font
  8. \item[extra space] \the\fontdimen7\font
  9. \item[xspaceskip] \the\xspaceskip
  10. \end{description}
  11. \end{document}

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

Stefan
Site admin

darckhart
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Postby darckhart » Tue May 13, 2008 6:58 pm

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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8072
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue May 13, 2008 7:40 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:
  1. \sfcode‘\.3000
  2. \sfcode‘\?3000
  3. \sfcode‘\!3000
  4. \sfcode‘\:2000
  5. \sfcode‘\;1500
  6. \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
Site admin


Return to “General”

Who is online

Users browsing this forum: MSNbot Media and 6 guests