제시된 첫 번째 솔루션을 구현 중입니다.여기biblatex 참고문헌에서 이름 선택을 굵게 표시합니다.
내가 가진 문제는 이름에 빈 공간 " "이 포함되어 있다는 것입니다. 그러면 솔루션이 적용되지 않습니다. 예 Le Texier
:
@article{schindlerHowFarPeople2022,
title = {How Far Do People Travel to Use Urban Green Space? {{A}} Comparison of Three {{European}} Cities},
author = {Schindler, Mirjam and Le Texier, Marion and Caruso, Geoffrey},
date = {2022-04-01},
journaltitle = {Applied Geography},
volume = {141},
pages = {102673},
doi = {10.1016/j.apgeog.2022.102673},
}
제안된 솔루션에 제공된 예를 기반으로 필터를 구성했습니다.
\forcsvlist{\listadd\boldnames} %this is the model of filter
{{Herrmann, Wolfgang~A.}, {Herrmann, W.~A.}, {Herrmann, Wolfgang\bibnamedelima A.},
{Herrmann, W\bibinitperiod\bibinitdelim A\bibinitperiod}}
\forcsvlist{\listadd\boldnames} %this is my implementation of the filter
{{Le Texier, Marion}, {Le~Texier, Marion}, {Le Texier, M.}, {Texier, M\bibinitperiod}}
필터는 모든 작성자 이름에 대해 작동하지만 빈 공간이 포함된 특정 이름에 대해서는 실패합니다.
답변1
문자열 기반 접근 방식에서는 공백이 포함된 이름이 까다로울 수 있습니다. 파일 을 확인해보면 .bbl
Biber가 생성하는 것을 볼 수 있습니다.
{{hash=31cbf23407084cad2911631ec94eba70}{%
family={Le\bibnamedelima Texier},
familyi={L\bibinitperiod\bibinitdelim T\bibinitperiod},
given={Marion},
giveni={M\bibinitperiod}}}%
그게 전부 이므로 대신에 biblatex
사용해야합니다Le\bibnamedelima Texier
Le Texier
\forcsvlist{\listadd\boldnames}
{{Le\bibnamedelima Texier, Marion}, {Le\bibnamedelima Texier, M\bibinitperiod}}
이는 다음 MWE에 표시된 대로 작동합니다.
\documentclass{article}
\usepackage{biblatex}
\usepackage{xpatch}
\makeatletter
\newbibmacro*{name:bold}[2]{%
\edef\blx@tmp@name{\expandonce#1, \expandonce#2}%
\def\do##1{\ifdefstring{\blx@tmp@name}{##1}{\bfseries\listbreak}{}}%
\dolistloop{\boldnames}}
\newcommand*{\boldnames}{}
\makeatother
\xpretobibmacro{name:family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:given-family}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:family-given}{\begingroup\usebibmacro{name:bold}{#1}{#2}}{}{}
\xpretobibmacro{name:delim}{\begingroup\normalfont}{}{}
\xapptobibmacro{name:family}{\endgroup}{}{}
\xapptobibmacro{name:given-family}{\endgroup}{}{}
\xapptobibmacro{name:family-given}{\endgroup}{}{}
\xapptobibmacro{name:delim}{\endgroup}{}{}
\forcsvlist{\listadd\boldnames}
{{Le\bibnamedelima Texier, Marion}, {Le\bibnamedelima Texier, M\bibinitperiod}}
\begin{filecontents}{\jobname.bib}
@article{schindlerHowFarPeople2022,
title = {How Far Do People Travel to Use Urban Green Space?
A Comparison of Three {European} Cities},
author = {Schindler, Mirjam and Le Texier, Marion
and Caruso, Geoffrey},
date = {2022-04-01},
journaltitle = {Applied Geography},
volume = {141},
pages = {102673},
doi = {10.1016/j.apgeog.2022.102673},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
% just for demonstration
\ExecuteBibliographyOptions{maxnames=99,giveninits}
\DeclareNameAlias{default}{family-given/given-family}
\begin{document}
\nocite{schindlerHowFarPeople2022}
\printbibliography
\end{document}
이와 같은 문제 때문에 저는 다음과 같이 구현된 해시 기반 접근 방식을 적극 권장합니다.내 대답에게biblatex를 사용하여 특정 저자를 굵게 표시.
그러면 다음과 같이 표시되며, \addboldnames
파일에 쓰는 것과 마찬가지로 이름을 전달할 수 있습니다 .bib
.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber,style=numeric]{biblatex}
\makeatletter
\def\nhblx@bibfile@name{\jobname -nhblx.bib}
\newwrite\nhblx@bibfile
\immediate\openout\nhblx@bibfile=\nhblx@bibfile@name
\immediate\write\nhblx@bibfile{%
@comment{Auto-generated file}\blx@nl}
\newcounter{nhblx@name}
\setcounter{nhblx@name}{0}
\newcommand*{\nhblx@writenametobib}[1]{%
\stepcounter{nhblx@name}%
\edef\nhblx@tmp@nocite{%
\noexpand\AfterPreamble{%
\noexpand\setbox0\noexpand\vbox{%
\noexpand\nhblx@getmethehash{nhblx@name@\the\value{nhblx@name}}}}%
}%
\nhblx@tmp@nocite
\immediate\write\nhblx@bibfile{%
@misc{nhblx@name@\the\value{nhblx@name}, author = {\unexpanded{#1}}, %
options = {dataonly=true},}%
}%
}
\AtEndDocument{%
\closeout\nhblx@bibfile}
\addbibresource{\nhblx@bibfile@name}
\newcommand*{\nhblx@boldhashes}{}
\DeclareNameFormat{nhblx@hashextract}{%
\xifinlist{\thefield{hash}}{\nhblx@boldhashes}
{}
{\listxadd{\nhblx@boldhashes}{\thefield{hash}}}}
\DeclareCiteCommand{\nhblx@getmethehash}
{}
{\printnames[nhblx@hashextract][1-999]{author}}
{}
{}
\newcommand*{\addboldnames}{\forcsvlist\nhblx@writenametobib}
\newcommand*{\resetboldnames}{\def\nhblx@boldhashes{}}
\newcommand*{\ifhashinboldlist}{%
\xifinlist{\thefield{hash}}{\nhblx@boldhashes}}
\makeatother
\newcommand*{\mkboldifhashinlist}[1]{%
\ifhashinboldlist
{\mkbibbold{#1}}
{#1}}
\DeclareNameWrapperFormat{boldifhashinlist}{%
\renewcommand*{\mkbibcompletename}{\mkboldifhashinlist}%
#1}
\DeclareNameWrapperAlias{sortname}{default}
\DeclareNameWrapperAlias{default}{boldifhashinlist}
\addboldnames{{Le Texier, Marion}}
\begin{filecontents}{\jobname.bib}
@article{schindlerHowFarPeople2022,
title = {How Far Do People Travel to Use Urban Green Space?
A Comparison of Three {European} Cities},
author = {Schindler, Mirjam and Le Texier, Marion
and Caruso, Geoffrey},
date = {2022-04-01},
journaltitle = {Applied Geography},
volume = {141},
pages = {102673},
doi = {10.1016/j.apgeog.2022.102673},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{schindlerHowFarPeople2022}
\printbibliography
\end{document}