Text FormattingSpace after the dot (LaTeX new user)

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
yasso
Posts: 4
Joined: Fri Jun 26, 2009 6:51 am

Space after the dot (LaTeX new user)

Post by yasso »

Using BiBTex and LaTeX

Suppose an author name is to be typset as "G.H. Wills" (no space between . and H)
How to write the name in the BiBTeX database?
{Wills, G.H.} produces "G. Wills"
{Wills, {G.H.}} same
{Wills, G. H.} Produces "G. H. Wills" (with a space.

In other words, how to force TeX so that NOT to add any space after the dot?
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Space after the dot (LaTeX new user)

Post by localghost »

Perhaps special bracing can help.

Code: Select all

author={Wills, {G.}{H.}}

Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
yasso
Posts: 4
Joined: Fri Jun 26, 2009 6:51 am

Re: Space after the dot (LaTeX new user)

Post by yasso »

Thanks Thorsten for the help

But it still does not work

{G.}{H.} (without space) becomes G.
{G.} {H.} with space it becomes G. H. (with space)

I guess the problem is that when BiBTeX converts the .bib file to a .bbl file or whatever for thebibliography environment, all those braces are removed and the citation is formated. It seems that any continuous string of characters (including the dot) are treated as one word and get abbreviated. There must be a way to tell BibTeX or LaTeX or TeX (I am newcommer, so really don't know which is doing what) to just leave author names as is and not change them in any way.

Thanks again for the help
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Re: Space after the dot (LaTeX new user)

Post by localghost »

I think the only way is to keep the space. This only becomes a real problem if it violates any typographic rules.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Space after the dot (LaTeX new user)

Post by frabjous »

Pardon my ignorance if indeed it is, but aren't these sorts of things fixed by the .bst/bibliography style file? Couldn't using a different or modified .bst file help here?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Space after the dot (LaTeX new user)

Post by localghost »

frabjous wrote:Pardon my ignorance if indeed it is, but aren't these sorts of things fixed by the .bst/bibliography style file? Couldn't using a different or modified .bst file help here?
I don think so. It's all about how TeX reads the characters from an input file. If there is no space (character category 10) in the input, there will be no space in the output.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Space after the dot (LaTeX new user)

Post by frabjous »

Not to be contrary, but when I ran "tex makebst" to make a custom .bst file, I got these options:

AUTHOR NAMES:
(*) Full, surname last (John Frederick Smith)
(f) Full, surname first (Smith, John Frederick)
(i) Initials + surname (J. F. Smith)
(r) Surname + initials (Smith, J. F.)
(s) Surname + dotless initials (Smith J F)
(w) Surname + comma + spaceless initials (Smith, J.F.)
(x) Surname + pure initials (Smith JF)
(y) Surname + comma + pure initials (Smith, JF)
(z) Surname + spaceless initials (Smith J.F.)
(a) Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
(b) First name reversed, with full names (Smith, John Fred, Harry Kab Jones)
Select:

Choosing (w) and using

author = {Wills, G. H.}

in the .bib file then produced "Wills, G.H." in the bibliography, with no space. (It does put the surname first, and makebst doesn't give a choice to format it like this with the initials first, at least not with merlin.mbs, but I imagine this can still be done by editing the .bst directly, or with a different .mbs.)

So I cannot see how using a different or modified .bst file wouldn't help here. What .bst file are you using, yasso? Are you free to make your own?
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Space after the dot (LaTeX new user)

Post by localghost »

You are right. I was not aware of this because I never had to use makebst from custom-bib. But nevertheless there has to be a space in the author field. In this moment I remember the TeX command \ignorespaces and I guess this does the trick. The initial request was for the input without any space (and a not specified BibTeX style). Good to have this solution here.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
yasso
Posts: 4
Joined: Fri Jun 26, 2009 6:51 am

Re: Space after the dot (LaTeX new user)

Post by yasso »

Thanks guys for the help.

I was given a custom .bst file which seems to do all bibliography format as expected, except for that space between author's initials.

As a newcommer to LaTeX, I don't know how to produce those .bst files or how to edit them, but I am sure there must be a simple way to modify the .bst file.

Currently, the only trick I can do is: after producing the .bbl file, I open it in notepad and replace all ".~" with just "."

In the .bbl file, the text looks "Wills, G.~H." so it is just a matter of getting rid of the extra "~" hard space.

Problem is that every time I run BiBTeX, a new .bbl is generated and the ~ is back.

Unless there is a way to correct the .bst file itself, I guess I just have to leave it as is and then edit the .bbl file only in the final typesetting of the article.

Thanks again
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Space after the dot (LaTeX new user)

Post by frabjous »

Someone who knows more might be able to tell you how to edit the .bst file appropriately. (It wasn't obvious to me personally how to do it, but maybe with more study...)

You might want to post it here so it can be examined.

However, to me, this really doesn't sound like this should be your problem.

If your publisher (or journal editor or whoever) has provided you with a .bst file, and they are also the ones who are insisting upon no space between initials, you should simply tell them that it's their .bst file that inserts the space, and that they should fix it themselves.

Of course, if the rule and .bst file are from different sources, matters are different.
Post Reply