Skip to content

Commit

Permalink
✨ Support for field aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Pezmc committed Feb 22, 2021
1 parent 808f188 commit ac42a3b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions biblatex_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"school": "mastersthesis",
}

fieldAliases = {"school": "institution", "address": "location"}

####################################################################

import string
Expand Down Expand Up @@ -250,6 +252,14 @@ def open(
subproblems = subproblems[:-1]
counterMissingCommas -= 1

# support for type aliases
fields = map(
lambda typeName: fieldAliases.get(typeName)
if typeName in fieldAliases
else typeName,
fields,
)

completeEntry += line + "<br />"

if currentId in usedIds or not usedIds:
Expand Down
13 changes: 12 additions & 1 deletion tests/input.bib
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ @techreport{nistFIPS197Advanced2001
langid = {english}
}

% "report": ["author", "title", "date"]
% "report": ["author", "title", "type", "institution", "year/date"],
% 3 author components (should be 'lastname, firstname')
@report{petersonObservationsModelingSeismic1993,
title = {Observations and Modeling of Seismic Background Noise},
Expand All @@ -84,4 +84,15 @@ @report{petersonObservationsModelingSeismic1993
number = {93-322},
series = {Open-{{File Report}}},
type = {USGS Numbered Series}
}

% "report": ["author", "title", "type", "institution", "year/date"],
% no errors, school is an alias for institution
@report{bibLatexChecker,
author={Pez Cuckow},
title={BibLatex-Check},
school={Robotics and Autonomous Systems},
address={Address is an alias fro location},
type = {Website},
year = {2014},
}

0 comments on commit ac42a3b

Please sign in to comment.