Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for citation links to include name and year, not just year. #428

Closed
JohnLukeBentley opened this issue May 25, 2016 · 8 comments

Comments

Projects
None yet
3 participants
@JohnLukeBentley
Copy link

commented May 25, 2016

Request an option for Biblatex to support hyperlinks that include the name and year, not just a year. That is, when using an authoryear style.

At the moment we get something like ...

Phasellus Nam lacus libero risus vitae leo (Chalmers 1995).

The requested option would give us ...

Phasellus Nam lacus libero risus vitae leo (Chalmers 1995).

Many more cases are handled perfectly in Audrey's answer to http://tex.stackexchange.com/questions/15951/hyperlink-name-with-biblatex-authoryear-biblatex-1-4b

And indeed the code from Audrey's answer solves the issue.

Personally I think that the hyperlinking of name and year (or more precisely hyperlinking that matches all of Audrey's test cases) ought not only be an option, but be the default.

@JohnLukeBentley JohnLukeBentley changed the title Option for citation links include name and year, not just year. Option for citation links to include name and year, not just year. May 25, 2016

@plk

This comment has been minimized.

Copy link
Owner

commented Jun 5, 2016

@aboruvka - I think the solution you gave in the linked SE question should probably be the default - could you implement?

@aboruvka

This comment has been minimized.

Copy link
Collaborator

commented Jun 5, 2016

I don't agree. The link target can only be consistently and unambiguously applied to the (extra) year part of the label in the presence of prenotes and compact labels. Handling these cases is possible, but leads to an inconsistent, messy solution (see for example http://tex.stackexchange.com/q/27607). It seems to me that PL's choice to link only part of the label (rather than conform with natbib), was deliberate.

@plk

This comment has been minimized.

Copy link
Owner

commented Jun 5, 2016

Ah, ok, that makes sense.

@JohnLukeBentley

This comment has been minimized.

Copy link
Author

commented Jun 12, 2016

Andrew, I don't follow.

I'm not sure if you are saying that ...

  • ... there is no in-principle algorithm that doesn't lead to an inconsistent, messy solution....; or
  • ... the internal implementation details of biblatex makes implementing an in-principle algorithm lead to an inconsistent, messy solution.

I also don't see what you mean to illustrate by pointing to http://tex.stackexchange.com/questions/27607/biblatex-authoryear-comp-and-hyperlinks that isn't already illustrated by my pointing to http://tex.stackexchange.com/questions/15951/hyperlink-name-with-biblatex-authoryear-biblatex-1-4b (and in particular the images that you've pasted in your respective answers, illustrating the different cases).

Perhaps my framing of the initial issue was misleading. And perhaps your imaged examples don't get it right, and that's what you are pointing to.

As an in-principle matter I do agree that the lowest common denominator in-text citation for a work will entail the hyperlinking the year (or shorthand, title, shorttitle etc). That would, make ...

lorem Aristotle (see, e.g., 1986, p. 15).
lorem Aristotle (see, e.g., 1877,1968).

... the way to go (which is at odds with some of your examples).

However, the most common case will be a bracketed author-year combinations, in that case ...

lorem (Aristotle 1968).

... would be the way to go (consistent with your examples).

The idea, of course, is to hyperlink that part of the string which identifies the work, not the author as such.

Would the following (conceptual) algorithm cover all possible cases in-principle?

  • Determine the lowest common denominator work label. This depends on both the style in use and the keys available for the entry. It never includes an author name. This will result in a:
    • year 1914;
    • a year with a differentiating alphabetic 1914b;
    • a shorthand ZU;
    • a title Thus Spoke Zarathustra;
    • shorttitle Zarathustra; or
    • (something else?).
  • Don't hyperlink anything outside brackets.
  • Hyperlink the lowest common denominator work label only,
    • Unless an author name appears inside the brackets and only one work of the author's is cited between that pair of brackets. In that case hyperlink the author name and the lowest common denominator work label only.

That would seem to result in a clean and consistent ...

Hyperlinking the lowest common denominator work label only (here a year) because the author name is outside the brackets.
lorem Aristotle (see, e.g., 1986, p. 15).
lorem Aristotle (see, e.g., 1877; 1968).

Hyperlinking the lowest common denominator work label only (here a year or year plus alpha). While the author name is inside the brackets, multiple works are cited against that name.
lorem (Knuth 1984; 1986a; 1986b)

An author name appears inside the brackets and only one work of the author's is cited. In that case hyperlink the author name and lowest common denominator work label (here a year).
lorem (Aristotle 1968).
lorem (see, e.g., Aristotle 1968; Epictetus 1924; Epicurus 1954, p. 15])

Other kinds of "lowest common denominator label"
Title:
lorem Aristotle (Nicomachean Ethics).
Shorthand:
lorem (Aristotle NE; M; PA, p. 234)

Unless you can think of counter examples I don't think this is messy and inconsistent. At least, that is, not messy in a manner above the messiness of citations themselves (without any hyperlinking).

(Citation messiness arising out of what we want as writers, not in virtue of problems with biblatex. Biblatex does very well to cope with the variety of citations we want as writers - thanks in part to your hands on the code).

@aboruvka

This comment has been minimized.

Copy link
Collaborator

commented Jun 17, 2016

I raised two problems with this request: (1) the desired result leads to inconsistent, ambiguous links and (2) implementing the desired result is a mess.

To see (1), suppose that the links are not coloured or boxed. Where can one consistently anticipate the links in a given citation? Even with coloured or boxed links, consider compact labels. What is the target of the common part of the label? The answers are not obvious. The current behaviour solves all of these problems. PL deviated from natbib-like links, and I think his solution is better. So it should remain the only one offered by default.

To see (2), compare the default style implementation with the solutions I've posted (linked above). Links are applied at the style level. Changes to internals won't make this any easier.

Considering (1) and the fact that this is a style issue and you already have a solution, I closed the issue.

@JohnLukeBentley

This comment has been minimized.

Copy link
Author

commented Jun 18, 2016

For the moment if we look only at ...

(2) implementing the desired result is a mess.

A. By ...

To see (2), compare the default style implementation with the solutions I've posted (linked above).

... you mean that neither your of Tex StackExchange answers:

... are superior to the default style implementations. That is, your Tex StackExchange answers illustrate the "mess".

... as expressed in the Tex StackExchange comments for the authoryear-comp style ...

Why is this not an option in biblatex yet? – Oleg Dec 20 '15 at 20:11
[At]Oleg Because the default behaviour is the best way to apply the links. – Audrey Jun 6 at 0:42

B. Therefore my prior speculation that ...

And perhaps your imaged examples don't get it right, and that's what you are pointing to.

... bears out.

C. My claim in my original post that ...

Many more cases are handled perfectly in Audrey's [Tex StackExchange] answer [for the authoryear style].

... is false. You mean your TexStackExchange code results in, and so illustrates, messy (inconsistent and ambiguous) cases. That is, the cases are quite far from perfection.

D. Your "solution" in "you already have a solution" (from the post above) means to reference:

  • The default implementation styles; and not
  • Any of the code you've posted to Tex StackExchange.

Are A, B, C, & D all true?

@aboruvka

This comment has been minimized.

Copy link
Collaborator

commented Jun 18, 2016

This doesn't need to be argued further. The issue is style related and you have a solution. From what I remember, it was the cleanest one I could find.

@JohnLukeBentley

This comment has been minimized.

Copy link
Author

commented Jun 18, 2016

That makes me think D is false. So now I'm more confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.