I implemented the following code that automatically abbreviates first names starting with Ph, Th or Ch into that starting pair of consonant. No manual insertion of \relax in the .bib file is required.
\DeclareSourcemap{%
\maps[datatype=bibtex]{%
\map{%
\stepfixfirstnameabbr{author}%
\stepfixfirstnameabbr{editor}%
\stepfixfirstnameabbr{editora}%
\stepfixfirstnameabbr{editorb}%
\stepfixfirstnameabbr{editorc}%
}}}
\newcommand{\stepfixfirstnameabbr}[1]{
% step 1
\step[fieldsource=#2,
match={\regexp{([^,]\s+)\b(Ch|Th|Ph)(\S*(\s+and|$))}},
replace={\regexp{$1\{$2\}$3}}]%
% step 2
\step[fieldsource=#2,
match={\regexp{(^|[^,]\s+)\b(Ch|Th|Ph)(\S*,)}},
replace={\regexp{$1\{$2\}$3}}]%
% step 3
\step[fieldsource=#2,
match={\regexp{\b(Ch|Th|Ph)([^\}])}},
replace={\regexp{\{\\relax\{\}$1\}$2}}]%
}
Step 1 parses name fields written with form "firstname lastname". It wraps the beginning of a lastname if it matches Ch, Th or Ch.
Philippe Charmet and Charmet, Philippe
=> Philippe {Ch}armet and Charmet, Philippe
Step 2 parses name fields written with form "lastname, firstname". It wraps the beginning of a lastname if it matches Ch, Th or Ch.
Philippe {Ch}armet and Charmet, Philippe
=> Philippe {Ch}armet and {Ch}armet, Philippe
Step 3 wraps Th, Ch or Th starting a first name with a relax, as follows:
Philippe {Ch}armet and {Ch}armet, Philippe
=> {\relax{}Ph}ilippe {Ch}armet and {Ch}armet, {\relax{}Ph}ilippe
Steps 1 and 2 may look useless at first glance but they are not: it is important that no \relax is inserted at the beginning of a family name because it could affect its sorting in an index of authors generated using makeindex.
I did not succeed in doing everything in a single step.
This code has been working pretty well so far so I would like to share it. Any improvement suggestions are welcome.
Yves
droit-fr. – moewe Mar 06 '16 at 07:34biblatex's name handling (bug report #372 and http://mirrors.ctan.org/macros/latex/contrib/biblatex/RELEASE)? From what I could see your style is quite susceptible to these changes. – moewe Mar 12 '16 at 07:22