A simple option to have the middlename with initial and to typeset initial correctly.
I have two suggestions that are related :
In a classic bibfile like :
@article{andersen1992quantitative,
title={A quantitative study of the human cerebellum with unbiased stereological techniques},
author={Andersen, Birgitte Bo and Korbo, Lise and Pakkenberg, Bente},
journal={Journal of Comparative Neurology},
volume={326},
number={4},
pages={549--560},
year={1992},
publisher={Wiley Online Library}
}
The name will be typeset : Birgitte Bo Andersen, Lise Korbo and Bente Pakkeberg.
It should be a good idea to make available to the user an option to make initial of the middlename to have Birgitte B. Andersen, for example.
In this answer on stackexhange, a code appears to do the job correctly : https://tex.stackexchange.com/questions/187684/abbreviate-only-middle-names-in-biblatex (just have to adapt the mkbibnamefirst into mkbibnamegiven.)
This is my first suggestion as this is a very classic situation.
The second problem, which is related, is the typesetting of the middlename when the user has the initial but not the full name, like this :
@article{albus1971theory,
title={A theory of cerebellar function},
author={Albus, James S},
journal={Mathematical Biosciences},
volume={10},
number={1-2},
pages={25--61},
year={1971},
publisher={Elsevier}
}
In this case : "Albus, James S" will be typeset "James S Albus", which is very uncommon. Of course, the tricks above solve the issue because it considers the S as a middlename and try to abbreviate it which give a S. which is good.
But someone could want to have the full middlename when it is available and to typeset the initial correctly when only initial are available. I think that it should have some routine of detection that detect if an initial is present at the middle name position to automatically mark the dot after it.
Thank you for your suggestion.
I'll have to think about the first idea for a bit. The problem is that the BibTeX format has no notion of a middle name, it knows only given (first) name and family (last) names as well as a prefix (von part) and suffix (Jr. part). So in the data model there is no way to separate a first name from a middle name. Biber's extended name format would make that possible, but that would require a different input and I gather you are looking for an automatic solution that works with the usual BibTeX input format. That means that the split into first and middle name has to happen on the LaTeX/biblatex side. But string manipulation is tricky in TeX.
Re your second point
Unless the middle name is literally "S", the correct input for "James S. Albus" in the .bib file is
author={Albus, James S.},
with a dot after the "S".
For the first point, i imagine that a problem arise only when a first name is indeed composed with several part separed by a space, but is this case really exist in non-asian languages ? If this cas don't exist, it is easy to consider that everything after the first word is a middlename. Even in latex (see the code linked in the stackexhange link). If the case is very rare, the {} should do the tricks for the rare case where a first name is really designed with two part and a space...
For the second point, the problem is that a lot of sources of bibtex/biblatex automatic scientific file, give:
author={Albus, James S},
And not :
author={Albus, James S.},
Google scholar, for example, which is one of the most employed source of bibtex automatic citation file give :
@article{albus1971theory,
title={A theory of cerebellar function},
author={Albus, James S},
journal={Mathematical Biosciences},
volume={10},
number={1-2},
pages={25--61},
year={1971},
publisher={Elsevier}
}
Other like pubmed or research gate give the good typo, but they are not as employed as google scholar ... As the case where a letter alone in middlename is not an abreviation is very very very rare (in fact, i don't really see where this happen) i think it could be a good idea to automaticaly correct these things...
Most of the world has no notion of a middle name. If you took the full name with all given names for example a Scandinavian and applied that rule you would very often get something that would just be wrong. To name a couple of famous Swedes as examples it would be bad to list August Strindberg as "Johan A. Strindberg" or Benny Andersson as "Göran B. B. Andersson". Their full names with all the given names simply shouldn't be in a bibliographic database to begin with. As for the second issue there are (or have at least been) people with single-letter names that insist on them not being abbrevations that should take a period. It is clear what the right input in a bib file should be. Yes, there are lots of bad bib entries around. If you can Google scholar or some other big supplier to bib entries people copy to fix this detail then the world will be better because of it.
The scandinavian exemple is a good exemple, i admit. But in this case, i guess the better approach would be to have a command that can locally say "this name is from [this country]" because there is no real way to identify that Johan August Strindberg should be simply writen "August Strindberg" or not abreviated if an option for middlename abreviation exist. (in fact, even current option that abreviate a part or an other should fails in this case) An approach could be to have author list with their country and others options defined by the user if they want to precise a thing that is outside the scope of default behaviour.
But i have no real idea about it, i guess it need some reflexion...
For your remark about person with a single letter, yes you are right, but it is very exceptionnal and i think it could be ignored as people in this case will just use the {} tricks around the first name...
I'll hold off comments about the first question for now, but about the second point I don't think we (biblatex/Biber) should try to automatically fix bad .bib input. It is much better to fix the data once and for all in the .bib file, either manually or with a helper tool.
If we silently correct bad input that removes the incentive for users to correct mistakes in their files, which may have an effect on portability (what if people want to use a BibTeX style which doesn't apply the fix? suddenly a file that worked perfectly fine before will cause issues). There is also the risk of hypercorrection and wrong applications of overly simplistic rules. One example for a thankfully abandoned auto-fix is https://github.com/plk/biblatex/issues/140.
People need to be aware that .bib export tools sometimes provide low-quality data. See the many examples listed in https://tex.stackexchange.com/q/386053/35864.
Hum, i understand, may be it should be possible to inform google that they have a bug ? Because what they done is wrong in every tex software and package soooo ...
OK, i have send a bug request to google via their google scholar contact form, may be it will give a result :p and so solve one of the two point.