Skip to content

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.

Example:

<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>

Explanation:

We use multiple features of bibtex_js to create the example above.

  1. The if-else check for the url variable checks if url exists otherwise if it doesn't exist if !url, see if-else for more details.
  2. The hyperlinks are created the same for both the url and doi. The bibtexVar feature is used where the value in extra is used to search for any instance of +value+, e.g., +DOI+, see variable-access for more details.
  3. Then the url or doi is then printed in the span using the class.
Clone this wiki locally