How to "delete" space between Author and semicolon in bibtex

The presence of whitespace between an author's (or editor's) name and the semicolon appears to be a design feature rather than a bug of the alphadin bibliography style. To wit, I was able to locate no fewer than six [6!] instances of " ; " in the file: 2 in the function format.names, and 1 each in the functions format.editors, format.authors.organization, format.editors.organization, and format.crossref.editor.

That said, what's definitely bizarre is that the coding string isn't given as "~; ". Using ~ before ; would disallow a line break immediately before the semicolon. Allowing a line break immediately before a semicolon must surely be a typographic blunder.

If you prefer not to have whitespace before the semicolons, I suggest you proceed as follows:

  • Locate the file alphadin.bst in your TeX distribution. Make a copy of this file and call the copy, say, alphadin-mod.bst. (Do not edit an original file of the TeX distribution directly.)

  • Open the file alphadin-mod.bst in a text editor. The program you use to edit your tex files will do fine.

  • Do a global search-and-replace, changing " ; " to "; ". A total of six instances should be affected.

  • Save the file alphadin-mod.bst either in the directory where your main tex file is located or in a directory that's searched by BibTeX. If you choose the second option, be sure to update the filename database of your TeX distribution suitably.

  • In the main tex file, change the instruction \bibliographystyle{alphadin} to \bibliographystyle{alphadin-mod} and perform a full recompile cycle: LaTeX, BibTeX, and LaTeX twice more.

Happy BibTeXing!


enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{ae:06,
  title={Thoughts},
  author={Arbinger, Don and Erdmann, Jeremy},
  year={2006}
}
\end{filecontents}

\documentclass{scrbook}
\bibliographystyle{alphadin-mod}
\begin{document}
\cite{ae:06}
\bibliography{mybib}
\end{document}

alphadin implements the norm DIN 1505-2, which is now superseded by (the slightly less terrible) (DIN) ISO 690. DIN 1505-2 uses semicolons (as well as en-dashes and slashes) with a leading and following space. In that regard the norm does not follow German tradition, which never places a space before a semicolon, but it also does not go full French, because it does not place spaces before colons.

That behaviour is hard-coded in alphadin.bst and has to be changed manually by modifying the .bst file.

  1. Locate the style you want to change on your machine. You can find the file path by typing kpsewhich alphadin.bst into a terminal. Failing that get the files from CTAN: https://ctan.org/tex-archive/biblio/bibtex/contrib/german/din1505

  2. Copy the file to a place where LaTeX can find it (https://texfaq.org/FAQ-inst-wlcf) – the directory of your current document will do just fine – and rename it. Many LaTeX files require you to rename the file in their license conditions. But even if the license is not clear on that or does not require you to rename a changed file, it is extremely good practice to rename changed files. Let's say the new name is alphadin-nospace.bst

  3. Find all six occurrences of " ; " in the file and replace them with "; ". In my copy the relevant lines are

    • 408
    • 415
    • 449
    • 483
    • 502
    • 1199
  4. Ideally you place a short notice of the changes, your name and the date at the top of the file.

  5. Save the modified and renamed file.

  6. Use \bibliographystyle{alphadin-nospace} instead of \bibliographystyle{alphadin} in your document.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{arbinger2006designing,
  title   = {Designing with an embedded soft-core processor},
  author  = {Arbinger, Don and Erdmann, Jeremy},
  journal = {Embedded cracking the code to systems development},
  year    = {2006},
  volume  = {14},
  pages   = {76-89},
}
\end{filecontents}

\documentclass{article}
\bibliographystyle{alphadin-nosp}
\begin{document}
\cite{arbinger2006designing}
\bibliography{\jobname}
\end{document}

"Arbinger, Don; Erdmann, Jeremy: Designing with an embedded softcore processor. In: Embedded cracking the code to systems development 14 (2006), S. 76–89" with no spaces before the semicolon.


Since Mico gave the same answer just a minute and a half earlier, let me try to justify the presence of this answer with a bit of advertising for biblatex.

As mentioned above DIN 1505-2 has been superseded by ISO 690 and so it makes little sense to continue using alphadin or any of the other styles from the din1505 bundle for new documents. (Unless you really, really like the result the style gives you of course.)

A similar style can be achieved with biblatex, which is much more flexible when it comes to small changes like this. See bibtex vs. biber and biblatex vs. natbib, What to do to switch to biblatex?, Biblatex with Biber: Configuring my editor to avoid undefined citations and Guidelines for customizing biblatex styles for more introductory posts on biblatex.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{arbinger2006designing,
  title   = {Designing with an embedded soft-core processor},
  author  = {Arbinger, Don and Erdmann, Jeremy},
  journal = {Embedded cracking the code to systems development},
  year    = {2006},
  volume  = {14},
  pages   = {76-89},
}
\end{filecontents}

\documentclass[ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=alphabetic]{biblatex}

\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

\DeclareNameAlias{sortname}{family-given}

\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\renewcommand*{\mkbibnamefamily}{\textsc}

\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{#1\isdot}

\addbibresource{\jobname.bib}

\begin{document}
\cite{arbinger2006designing}
\printbibliography
\end{document}

Arbinger, Don; Erdmann, Jeremy. Designing with an embedded soft-core processor. In: Embedded cracking the code to systems development 14 (2006), S. 76–89.