Suppose that a document makes a heavy use of one of the abbreviations PhD, Ph.D., DPhil and D.Phil., and for the sake of consistency the author decides to define a \PhD macro and use it whenever they need the abbreviation. So, they pick up on of these definitions:


Now, the problem is that a sentence like

A "graduate student" is a student pursuing education past the bachelor's degree, such as a master's degree or a \PhD.

could be typeset with two periods at the end depending on the definition of \PhD. How can we avoid this problem without giving up the idea to use a \PhD macro? (Assume that we can change the macro definitions.)

  • 5
    \makeatletter\def\PhD{Ph.D\@ifnextchar.{}{.}}\makeatother – Manuel Dec 15 '14 at 11:28

Periods are a strange beast, because the space factor must be set correctly (of course, if you use \nonfrenchspacing).


\xspaceskip=4em % just to verify


A \PhD{} and another \PhD. End.


A \PhD{} and another \PhD. End.


A \PhD{} and another \PhD. End.


A \PhD{} and another \PhD. End.


The setting of \xspaceskip is just to show that the space factor is computed correctly.

In the case of “no period in abbreviation”, the macro \@ borrowed from LaTeX sets the space factor to 1000, so a period after \PhD with the first definition will be still considered sentence ending.

enter image description here

| improve this answer | |
  • It should be possible to leave out the {} when calling the macro, right? So A \PhD and another…, instead of \PhD{}. – jmc Dec 15 '14 at 14:20
  • 1
    @jmc Not really. In LaTeX there's the xspace package, but it's complicated to port to Plain and not really useful. Instead of {} one can use “control space”. – egreg Dec 15 '14 at 14:30
  • — I see. Thanks! I didn't really register that xspace-like behaviour is not (easily) available in Plain-TeX. – jmc Dec 15 '14 at 15:09

I don't know if this was your intend by I try it:



The \PhD\ inside the sentence is different than \PhD.
The Ph.D. inside the sentence is different than PhD.

| improve this answer | |
  • 1
    this will work for "Ph.D.", but for "D.Phil.", unless \frenchspacing is used, the space after the the substitution in the middle of the sentence will be treated as a sentence-ending space. (and for \PhD, the space after it will be just an "ordinary" space at the end of a sentence.) – barbara beeton Dec 15 '14 at 13:29
  • @barbarabeeton After we will know more about OP's intend then we can tune details. At this moment, the usage of \PhD\ or \PhD. (at the end of the sentence) works OK, because the \ space is independent of the spacefactor. But I doubt that OP needs this. Maybe I didn't understand something... – wipet Dec 15 '14 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.