Bibliography entry reference hyperlink and styling

Hi, is there a way to make bibliography entry reference (automatically, not manually, obviously) into clickable hyperlink to the entry in the bibliography table? Also is it possible to style these references?

I know this topic about bibliography entry hyperlinks exists, but it’s from 2016, and also doesn’t have any answers.

In more detail: the reference to the bibliography looks like this for me in the exported pdf file. Not only is it not clickable, which is a pretty basic feature, I would also like to be able to style it as I see fit, which I can’t seem to be able to do either.

image

Unfortunately I know of no way of doing it. When you customise the Entries structure line, the is no LS nor LE (link start and end) descriptor like there is for TOC.

Have you tried to apply a character style to the reference? Or is your question relative to the bibliography line itself? In the latter case, every descriptor can receive individually a character style.

I must admit I didn’t think about that, thanks. Only downside I can see is that there doesn’t seem to be a way to style the number differently from the brackets, but I’ll probably live without that.

However do I understand correctly that there is a way to change the structure of the reference, similarly to how you can change the structure of the lines in the table?

Or did you mean this window?

I think it makes sense there isn’t LS and LE here, since there can be multiple references to one entry. If there were to be links back, you would have to have a way to list (and format) the occurences here, which I don’t think you can do either.

yes

Thanks to remind me that. When I wrote, I was thinking the other way round, i.e. a link from the reference to the description which needs a target reference in the description. I thought wrongly that LS and LE would also create the needed “bookmark”. When you get tired, you don’t think adequately. Sigh!

I see, so there is no way to edit the structure of the reference in the text, like adding spaces before and after the number, adding leading zeroes, etc.?

Unfortunately no.
The alternative is to use the Identifier of the bibliography database instead of a reference number (selected in the Type tab of the TOC/bibliography configuration dialog).
I checked that Identifiers accept leading spaces and these leading spaces are correctly echoed both in the reference and the bibliography.

But there may be a bug in the bibliography database management. If you modify the identifier (not experimented with the other fields), this changed is not echoed in the document!

EDIT: confirmed, this is bug tdf#122994

I see, thanks.

One more thing I noticed: when placing a bibliographical reference in front of another one, it assumes the number in order: placing before [1] makes it a [1]. However the original [1], [2] and so on never renumber, even after update of the Bibliography.

Is that supposed to happen? I think it doesn’t make sense to have two bibliography entries (as in two distinct books, websites, etc.) with the same number, so there shouldn’t be a reason not to renumber the other references.

Tools>Update All will renumber the other references. I think this is an optimisation trade-off to avoid excessive and often useless rescans of the whole document.

Ah, I see, you’re right, thanks!

Actually it’s even worse. I just noticed that when adding an URL to a citation, it turns it into link to the URL website in the output pdf.


Now that I think about it though, do you think it would be possible to hack it somehow, maybe by making the bibliography entries HTML anchors, and then entering #anchorname as the URL, or something like that?