-
Notifications
You must be signed in to change notification settings - Fork 69
URL DOI Hyperlinks
Philip Cooksey edited this page May 30, 2019
·
1 revision
Below is an example for creating hyperlinks for the url
or a hyperlink to the doi
if it exists and the url
does not exist. This example would be inserted into the bibtex_template
.
<div class="if url">
<a class="bibtexVar" href="+URL+" extra="url">
<span class="url"></span>
</a>
</div>
<div class="if !url">
<div class="if doi">
<a class="bibtexVar" href="http://dx.doi.org/+DOI+" extra="doi">
https://dx.doi.org/<span class="doi"></span>
</a>
</div>
</div>
We use multiple features of bibtex_js
to create the example above.
- The if-else check for the
url
variable checksif url
exists otherwise if it doesn't existif !url
, see if-else for more details. - The hyperlinks are created the same for both the
url
anddoi
. ThebibtexVar
feature is used where the value inextra
is used to search for any instance of+value+
, e.g.,+DOI+
, see variable-access for more details. - Then the
url
ordoi
is then printed in the span using theclass
.