From 17020f9059449e1911f959ce3138a3a5cdc1f05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20H=C3=B6rner?= <110042110+johanneshoerner@users.noreply.github.com> Date: Sat, 24 Sep 2022 04:42:27 +0200 Subject: [PATCH] add multiple last names in bibliography (#905) Multiple last names can be defined to be highlighted in the bibliography (#904) --- README.md | 6 +++--- _config.yml | 2 +- _layouts/bib.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6fd736fcfd4d..bc4fa8454c76 100644 --- a/README.md +++ b/README.md @@ -367,13 +367,13 @@ You can also add new `*.bib` files and customize the look of your publications h
(click to expand) Author annotation: -In publications, the author entry for yourself is identified by string `scholar:last_name` and string array `scholar:first_name` in `_config.yml`: +In publications, the author entry for yourself is identified by string array `scholar:last_name` and string array `scholar:first_name` in `_config.yml`: ``` scholar: - last_name: Einstein + last_name: [Einstein] first_name: [Albert, A.] ``` -If the entry matches the last name and one form of the first names, it will be underlined. +If the entry matches one form of the last names and the first names, it will be underlined. Keep meta-information about your co-authors in `_data/coauthors.yml` and Jekyll will insert links to their webpages automatically. The coauthor data format in `_data/coauthors.yml` is as follows, ``` diff --git a/_config.yml b/_config.yml index 80b0e1d0c49d..2265a8c30eda 100644 --- a/_config.yml +++ b/_config.yml @@ -225,7 +225,7 @@ display_tags: ['formatting', 'images', 'links', 'math', 'code'] # this tags will scholar: - last_name: Einstein + last_name: [Einstein] first_name: [Albert, A.] style: apa diff --git a/_layouts/bib.html b/_layouts/bib.html index 8588d70b5f93..f92d3829edda 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -41,7 +41,7 @@ {%- for author in entry.author_array limit: author_array_limit -%} {%- assign author_is_self = false -%} {%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%} - {%- if author_last_name == site.scholar.last_name -%} + {%- if site.scholar.last_name contains author_last_name -%} {%- if site.scholar.first_name contains author.first -%} {%- assign author_is_self = true -%} {%- endif -%}