我希望在同一个括号内写上作者的首字母及其前缀。
例如 :
Chazelles (Cl.-A. de) 等,但目前我有:
Chazelles(Cl.-A.)(de)...
使用此代码
\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},
}
你有什么想法吗?我不知道是否可行。
提前向您致谢!
编辑 :哦,太棒了!它几乎完美了,但现在,对于 inbook、inproceedings 等,firstname 不在括号中。我想,我们需要更改另一个宏,例如 byeditor,但是怎么做呢?
我的 MWE 特别长,但由于我的主管的建议,有很多变化。
\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}
我无法将我的参考书目与文件内容整合在一起。抱歉。
我希望在 : dir de DELESTRE (X), MERCHESI (H) 中像作者。我还有另一个问题,但我想我会创建一个新主题,因为理想情况下我希望有:在 : DELESTRE (X), MERCHESI (H) 目录中。...
答案1
不幸的是,这不太容易。我们不必操作\mkbibnamefirst
和\mkbibnameprefix
,而是必须name:last-first
直接操作宏。
\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}}}
如果useprefix
打开,我们只需通过将名字括在括号中\mkbibparens{\mkbibnamefirst{#2}
。
如果useprefix
为假,我们在名字之前打印一个左括号(\bibopenparen\mkbibnamefirst{#2}
);只有在没有名字的情况下才会打印名字前缀之前的括号(这意味着只有在尚未打印名字的情况下才会打印;\ifblank{#2}{\bibopenparen}{}
);如果名字或前缀字段包含任何内容,则会打印右括号。
在下面的 MWE 中我们也使用\renewcommand*{\revsdnamepunct}{\addspace}
。
平均能量损失
\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}