我有一些论文中引用的文章。参考书目中的作者应该用粗体显示,但我不知道该怎么做。我尝试\textbf
在 bibtex 文件中使用它,但格式不再正确。如果有人能帮助我就好了。
我已经得到这个来定义条目。只需复制并粘贴它。
\DeclareNameAlias{default}{last-first}
\renewbibmacro*{author/editor+others/translator+others}{%
\mkbibbold{% ADDED
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{author}}
{\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{editor+others}}
{\usebibmacro{translator+others}}}}
}% ADDED
\renewcommand*{\multinamedelim}{\addsemicolon\space}
\renewcommand*{\finalnamedelim}{\addsemicolon\space}
\renewcommand*{\labelnamepunct}{\addcolon\space}
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
%% {\setunit*{addcolon\space}}% DELETED
{\setunit*{~:\space}}% ADDED
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
\DeclareFieldFormat{edition}{%
\ifinteger{#1}
%% {\mkbibordedition{#1}~\bibstring{edition}}% DELETED
{\mkbibordedition{#1}\bibstring{edition}}% ADDED
{#1\isdot}}
答案1
使用:
\usepackage[backend=biber,citestyle=alphabetic,bibstyle=alphabetic,sorting=nyt,abbreviate=false]{biblatex}
\renewbibmacro*{author}{%
\ifboolexpr{ test \ifuseauthor and not test {\ifnameundef{author}}}
{\ifentrytype{article}{%
\def\mkbibnamelast##1{\textbf{\textsc{##1}}}%
\def\mkbibnameprefix##1{\textbf{\textsc{##1}}}%
\def\mkbibnamefirst##1{\textbf{\textsc{##1}}}}{}%
\printnames{author}%
\iffieldundef{authortype}{}{\setunit{\addcomma\space}%
\usebibmacro{authorstrg}}}
{}}
答案2
您可以修改first-last
名称格式(bibstyle 使用alphabetic
)以包含条目类型的测试article
:
\documentclass{article}
\usepackage[style=alphabetic]{biblatex}
\DeclareNameFormat{first-last}{%
\ifentrytype{article}{%
\mkbibbold{%
\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}%
\usebibmacro{name:andothers}%
}%
}{%
\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}%
\usebibmacro{name:andothers}%
}%
}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Bli74,
hyphenation = {english},
author = {Blinder, Alan S.},
year = {1974},
title = {The economics of brushing teeth},
journaltitle = {Journal of Political Economy},
volume = {82},
number = {4},
pages = {887--891},
}
@book{Kop04,
hyphenation = {ngerman},
author = {Kopka, Helmut and Daly, Patrick W.},
year = {2004},
title = {Guide to \LaTeX},
edition = {4},
location = {Boston},
publisher = {Addison-Wesley},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}