Skip to content

Commit bfc4725

Browse files
add multiple last names in bibliography (alshedivat#905)
Multiple last names can be defined to be highlighted in the bibliography (alshedivat#904)
1 parent 93ab843 commit bfc4725

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,13 @@ You can also add new `*.bib` files and customize the look of your publications h
367367

368368
<details><summary>(click to expand) <strong>Author annotation:</strong></summary>
369369

370-
In publications, the author entry for yourself is identified by string `scholar:last_name` and string array `scholar:first_name` in `_config.yml`:
370+
In publications, the author entry for yourself is identified by string array `scholar:last_name` and string array `scholar:first_name` in `_config.yml`:
371371
```
372372
scholar:
373-
last_name: Einstein
373+
last_name: [Einstein]
374374
first_name: [Albert, A.]
375375
```
376-
If the entry matches the last name and one form of the first names, it will be underlined.
376+
If the entry matches one form of the last names and the first names, it will be underlined.
377377
Keep meta-information about your co-authors in `_data/coauthors.yml` and Jekyll will insert links to their webpages automatically.
378378
The coauthor data format in `_data/coauthors.yml` is as follows,
379379
```

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ display_tags: ['formatting', 'images', 'links', 'math', 'code'] # this tags will
230230

231231
scholar:
232232

233-
last_name: Einstein
233+
last_name: [Einstein]
234234
first_name: [Albert, A.]
235235

236236
style: apa

_layouts/bib.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{%- for author in entry.author_array limit: author_array_limit -%}
4242
{%- assign author_is_self = false -%}
4343
{%- assign author_last_name = author.last | remove: "¶" | remove: "&" | remove: "*" | remove: "†" | remove: "^" -%}
44-
{%- if author_last_name == site.scholar.last_name -%}
44+
{%- if site.scholar.last_name contains author_last_name -%}
4545
{%- if site.scholar.first_name contains author.first -%}
4646
{%- assign author_is_self = true -%}
4747
{%- endif -%}

0 commit comments

Comments
 (0)