From ef47cb2ec88e888f61291e51f7c61831aac81592 Mon Sep 17 00:00:00 2001 From: adin Date: Tue, 7 Apr 2020 14:00:02 -0300 Subject: [PATCH] Add user interface for highlight style (\hlformat), and use a verbose name for applying the patches instead of the previous bold one. --- academic.sty | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/academic.sty b/academic.sty index d293400..74e7aae 100644 --- a/academic.sty +++ b/academic.sty @@ -312,11 +312,11 @@ \addbibresource{\hlblx@bibfile@name} -\newcommand*{\hlbxl@boldhashes}{} +\newcommand*{\hlbxl@processhashes}{} \DeclareNameFormat{hlblx@hashextract}{% - \xifinlist{\thefield{hash}}{\hlbxl@boldhashes} + \xifinlist{\thefield{hash}}{\hlbxl@processhashes} {} - {\listxadd{\hlbxl@boldhashes}{\thefield{fullhash}}}} + {\listxadd{\hlbxl@processhashes}{\thefield{fullhash}}}} \DeclareCiteCommand{\hlblx@getmethehash} {} @@ -324,16 +324,19 @@ {} {} -\newcommand*{\hlblx@format}{\bfseries} +% internal use +\newcommand{\hlblx@format}{\bfseries} +% user interface +\newcommand{\hlformat}[1]{\renewcommand\hlblx@format{#1}} \newbibmacro*{name:hlblx}[1]{% \def\do##1{\iffieldequalstr{hash}{##1}{\hlblx@format\listbreak}{}}% - \dolistloop{\hlbxl@boldhashes}% + \dolistloop{\hlbxl@processhashes}% } \xpretobibmacro{name:hook}{\usebibmacro{name:hlblx}{#1}}{}{} % User macros \newcommand*{\addboldnames}{\forcsvlist\hlblx@writenametobib} -\newcommand*{\resetboldnames}{\def\hlbxl@boldhashes{}} +\newcommand*{\resetboldnames}{\def\hlbxl@processhashes{}} % Mantained for backwards compatibility \newcommand*{\boldname}[3]{% -- 2.50.1