Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to have in the same parenthesis, the first initial of the author and its prefix.

For example :

Chazelles (Cl.-A. de) etc. but for the moment I have :

Chazelles (Cl.-A.) (de) ...

with this code

\renewcommand{\mkbibnamefirst}[1]{\parentext{#1}}                   
\renewcommand{\mkbibnameprefix}[1]{\parentext{#1}}

@INPROCEEDINGS{chazellesroux10,
  author = {{\relax Cl}aire-Anne de Chazelles and Jean-{\relax Cl}aude Roux},
  title = {La construction en terre crue en France méditerranéenne},
  booktitle = {Archéologie des rivages méditerranéens: 50 ans de recherche},
  pages = {343-349},
}

Do you have any idea? I don't know if is possible.

And thank you very much in advance!

EDIT : Oh wonderful ! It's almost perfect but now, for inbook, inproceedings etc. the firstname is not in parenthesis. I guess, we need to change another macro like byeditor, but how ?

My MWE is particularly long but there is a lot of change because of the recommendations of my director.

 \documentclass[12pt]{report}                                                       %type de document+ police
\usepackage{fontspec}
\usepackage{xunicode}
\setmainfont[Mapping=tex-text,Numbers=OldStyle]{Linux Libertine O}

\usepackage{polyglossia}
\setdefaultlanguage{french}
\setmonofont[Scale=0.75]{DejaVu Sans Mono}
\setotherlanguage[variant=ancient]{greek}
\setotherlanguage{english}




\usepackage{microtype}  %gère la microtypo
\usepackage{csquotes}
\usepackage{shorttoc}

%%% MARGES ET INTERLIGNES
\usepackage{geometry}
    \geometry{a4paper}
    \geometry{top=2cm, bottom=2cm, left=2cm , right=2cm}

                                    %gestion interligne                                                     
\usepackage{setspace}
\onehalfspacing                                                                                         % interligne 1.5
\let\oldquotation\quotation                                                                     %Rédéfinit l'environnement quotation pour avoir un interligne de 1
\let\endoldquotation\endquotation
\renewenvironment{quotation}
{\begin{oldquotation}\singlespace}
 {\end{oldquotation}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%% %BILIOGRAPHIE  
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\usepackage[                                                                                                                %BILIOGRAPHIE
  backend=bibtex,
  language=french,
  style=authoryear,
  firstinits,
  mergedate=false,
  style=authoryear-ibid,
  maxcitenames=2,
   maxbibnames=999
]{biblatex} 

\renewcommand*{\revsdnamepunct}{}
\renewcommand*{\finalnamedelim}{\multinamedelim}
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\DeclareNameAlias{sortname}{last-first}
\renewcommand*{\labelnamepunct}{\space\textendash\space}                %tiret après le label
\renewbibmacro*{date+extrayear}{}%                                          rajoute date

%enlève guillement article et in
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{#1} 
  \renewbibmacro{in:}{%                                                                 
  \ifentrytype{article}
    {}
    {\printtext{\bibstring{in}\intitlepunct}}}

    \renewbibmacro*{issue+date}{%
  \printfield{issue}%
  \setunit{\addcomma\space}%
  \printdate%
  \newunit}

\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{begentry}{\printtext[bold]{\usebibmacro{cite}\addspace\addcolon\space}}

  %Met les abréviations des revues
\renewbibmacro*{journal}{%
  \iffieldundef{shortjournal}
    {%
      \iffieldundef{journaltitle}
        {}
        {%
          \printtext[journaltitle]
            {%
              \printfield[titlecase]{journaltitle}%
              \setunit{\subtitlepunct}%
              \printfield[titlecase]{journalsubtitle}%
             }%
         }%
    }
    {\printtext[journaltitle]{\printfield[titlecase]{shortjournal}}}%
}


%Enlever le tiret lorsqu'il y a une récurrence des auteurs
%
\makeatletter
\AtEveryBibitem{%
  \global\undef\bbx@lasthash%
  \clearfield{extraalpha}}
\makeatother



% "Et al." en ITALIQUE

\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
  \ifboolexpr{
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}
    and
    test \ifmorenames
  }
    {\ifnumgreater{\value{liststop}}{1}
       {\finalandcomma}
       {}%
     \andothersdelim\bibstring[\emph]{andothers}}
    {}}

 %%% Histoire des noms    et al...
\makeatletter
\renewbibmacro*{begentry}{%
  \renewcommand*{\mkbibnamelast}[1]{##1}%
  \defcounter{maxnames}{\blx@maxcitenames}%
  \printtext[bold]{\usebibmacro{cite}\addspace:\space}%
  \defcounter{maxnames}{\blx@maxbibnames}
  \renewcommand*{\mkbibnamelast}[1]{\textsc{\textnohyphenation{##1}}}}
\makeatother
    %minuscule citation
\AtBeginDocument{\renewcommand*{\mkbibnamelast}[1]{#1}}                 
%Enlève parenthèse colloque
\renewbibmacro*{event+venue+date}{                        
  \iffieldundef{eventtitle}
    {}
    {%
      \bibstring{presentedat}%
      \printfield{eventtitle}%
    }%
  \ifboolexpr{
    test {\iffieldundef{venue}}
    and
    test {\iffieldundef{eventyear}}
  }
    {}
    {\setunit*{\addspace}%
     \printtext{%
       \printfield{venue}%
       \setunit*{\addcomma\space}%
       \printeventdate}}%
  \newunit
}

    %modification des chaines de langues
    \DefineBibliographyStrings{french}{%
 byeditor = \iffieldequalstr{keywords}{source}%                         
 {Établit\space par}%
{dir\adddotspace\smartof}, 
in = {\textit{in}},%
 editor           = {dir\adddotspace},%
 editors          = {dir\adddotspace},%
 opcit = \iffieldequalstr{entrytype}{article}{art\adddotspace cit\adddot}{\emph{op\adddotspace cit}\adddot},%
idem = {\emph{idem}},%
ibidem = {\emph{ibid\adddot}},%
%pagetotal = {p\adddot},%
 %pages            = {pp\adddot},%
}

%modifie les pages des articles ... par pp. au lieu de p.
\DeclareFieldFormat[article,inbook,inproceedings,incollection]{pages}{pp\adddotspace #1}%


%enlève la virugule avant dir.
\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
%   \setunit{\addcomma\space}% DELETED
    \setunit{\addspace}% ADDED
    \usebibmacro{bbx:savehash}}%
%     \usebibmacro{#1}% DELETED
     \printtext{\usebibmacro{#1}}% ADDED
     \clearname{editor}}
    {\global\undef\bbx@lasthash}}
\makeatother


 %modifié book pour virgule
 \DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\addcomma         % ajout de la virgule
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

  %Change ordre des entrées pour les in quelquechoses : 
  \DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others}%
  \setunit{\space\textendash\space}\newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock   
  \usebibmacro{in:}%
 \usebibmacro{bybookauthor}%
\newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{inproceedings}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others}%
  \setunit{\space\textendash\space}\newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock   
\usebibmacro{in:}%
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{event+venue+date}%
  \newunit\newblock
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \printlist{organization}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{inbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others}%
  \setunit{\space\textendash\space}\newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock   
\usebibmacro{in:}%
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \usebibmacro{maintitle+booktitle}%
  \usebibmacro{bybookauthor}%
  \newunit\newblock
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{proceedings}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{editor+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{event+venue+date}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \printlist{organization}%
  \newunit
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\addcomma% ajout de la virgule
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}


%% Pour avoir collaboration après l'auteur pour namea
\makeatletter
\renewbibmacro*{author}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{author}%
        \setunit{\addcomma\space}%
        \usebibmacro{bbx:savehash}%
        \usebibmacro{authorstrg}%
        \ifnameundef{namea}
         {}
         {\setunit{\addcomma\space}%
          \global\undef\bbx@lasthash%
          \usebibmacro{authorstrg}%
          \setunit{\addspace}%
          \usebibmacro{bynameastrg}%
          \setunit{\addspace}%
          \printnames{namea}}}}
    {\global\undef\bbx@lasthash}}
\newbibmacro*{bynameastrg}{%
  \iffieldundef{nameatype}
    {}
    {\usebibmacro{bytypestrg}{namea}{editor}}}
\makeatother

  %gère les parenthèses pour les particules
\renewcommand*{\revsdnamepunct}{\addspace}

\renewbibmacro*{name:last-first}[4]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifblank{#3}{}{%
       \ifcapital
         {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
         {\mkbibnameprefix{#3}\isdot}%
       \ifpunctmark{'}{}{\bibnamedelimc}}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibparens{\mkbibnamefirst{#2}}\isdot}}% added \mkbibparens
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2#3}{}{\revsdnamepunct}%
     \ifblank{#2}{}{\bibnamedelimd\bibopenparen\mkbibnamefirst{#2}\isdot}% added \bibopenparen
     \ifblank{#3}{}{\bibnamedelimd\ifblank{#2}{\bibopenparen}{}\mkbibnameprefix{#3}\isdot}% added \ifblank{#2}{\bibopenparen}{}
     \ifblank{#2#3}{}{\bibcloseparen}}}% this line is new



%%%%%%%%%%%%%%%%%% FICHIER BIBLIO
\addbibresource{master01,alire}


 %%%%%%%%%%%%%%%%%% Présentation biblio %%%%%%%%%%


\begin{document} 


\nocite{*}

\begin{spacing}{1}


\printbibliography[keyword=source,title=Les sources primaires]

\printbibliography[notkeyword=source]

 \end{spacing}



\end{document}

enter image description here

I can not integrate my bibliography with filecontent. Sorry.

And I would like in : dir de DELESTRE (X), MERCHESI (H) like author. I also have another problem with it but I think I'll make a new topic as ideally I wish have: in : DELESTRE (X), MERCHESI (H) dir. ...

share|improve this question
    
Don't you think Chazelles de (Cl.-A.) would be better-looking? I don't know if it's easier than what you require, though. –  Bernard Mar 12 at 20:38
    
Could you provide an example for the preoblem with @inbook, @inproceedings. –  moewe Mar 14 at 15:42
    
Unfortunately, the code you posted is not an MWE in the sense that it is not a code that will compile to a full document. Please post a document that starts with \documentclass and has \begin{document} and \end{document} in it (ideally it should also contain the bib entry for "Chazelles, Roux 2010".) –  moewe Mar 14 at 19:22

1 Answer 1

Unfortunately this is not overly easy. Instead of manipulating \mkbibnamefirst and \mkbibnameprefix, we have to manipulate the name:last-first macro directly.

\renewbibmacro*{name:last-first}[4]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifblank{#3}{}{%
       \ifcapital
         {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
         {\mkbibnameprefix{#3}\isdot}%
       \ifpunctmark{'}{}{\bibnamedelimc}}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibparens{\mkbibnamefirst{#2}}\isdot}}
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2#3}{}{\revsdnamepunct}%
     \ifblank{#2}{}{\bibnamedelimd\bibopenparen\mkbibnamefirst{#2}\isdot}%
     \ifblank{#3}{}{\bibnamedelimd\ifblank{#2}{\bibopenparen}{}\mkbibnameprefix{#3}\isdot}%
     \ifblank{#2#3}{}{\bibcloseparen}}}

In case useprefix is turned on we just wrap the first name in parentheses via \mkbibparens{\mkbibnamefirst{#2}.

If useprefix is false we print an open parenthesis before the first name (\bibopenparen\mkbibnamefirst{#2}); the parenthesis before the name prefix is only printed if there was no first name (that means only if one has not been printed already;\ifblank{#2}{\bibopenparen}{}); if either of the first name or prefix field contained anything, a closing parenthesis is printed.

In the MWE below we also use \renewcommand*{\revsdnamepunct}{\addspace}.

MWE

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear,backend=biber]{biblatex}

\renewcommand*{\revsdnamepunct}{\addspace}

\renewbibmacro*{name:last-first}[4]{%
  \ifuseprefix
    {\usebibmacro{name:delim}{#3#1}%
     \usebibmacro{name:hook}{#3#1}%
     \ifblank{#3}{}{%
       \ifcapital
         {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
         {\mkbibnameprefix{#3}\isdot}%
       \ifpunctmark{'}{}{\bibnamedelimc}}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibparens{\mkbibnamefirst{#2}}\isdot}}% added \mkbibparens
    {\usebibmacro{name:delim}{#1}%
     \usebibmacro{name:hook}{#1}%
     \mkbibnamelast{#1}\isdot
     \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
     \ifblank{#2#3}{}{\revsdnamepunct}%
     \ifblank{#2}{}{\bibnamedelimd\bibopenparen\mkbibnamefirst{#2}\isdot}% added \bibopenparen
     \ifblank{#3}{}{\bibnamedelimd\ifblank{#2}{\bibopenparen}{}\mkbibnameprefix{#3}\isdot}% added \ifblank{#2}{\bibopenparen}{}
     \ifblank{#2#3}{}{\bibcloseparen}}}% this line is new

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@INPROCEEDINGS{chazellesroux10,
  author = {Claire-Anne de Chazelles and Jean-Claude Roux},
  title = {La construction en terre crue en France méditerranéenne},
  booktitle = {Archéologie des rivages méditerranéens: 50 ans de recherche},
  pages = {343-349},
}
@book{Goethe:Faust1, 
  title   = {Faust},
  subtitle= {Eine Tragödie},
  author  = {von Goethe},
  year    = {1808},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{chazellesroux10,wilde,cicero,Goethe:Faust1}
\printbibliography
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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