Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Adding option to link/color the entire citation, not only the year? #268

Closed
joelostblom opened this issue Nov 13, 2016 · 7 comments
Closed

Comments

@joelostblom
Copy link

I am a fan of the how the journal Cell handles citation formatting. The entire citation is clickable and colored, as seen in the screenshots below from this open access article. I think their approach facilitates quick scanning of the article content, which is more difficult when the citations are in the same color as the main text.

I enjoy the year-only linking and coloring options already present in pandoc, but it is not as quick to skip a section of multiple references when they contain both link-colored and black characters. Therefore, I think the possibility to color the entire citation would make a good addition to the current features, preferably as an option in the YAML-header, but I am also interested in if it is possible to currently achieve this behavior with a custom filter.

Cell article screenshot:
image

@jgm
Copy link
Owner

jgm commented Nov 21, 2016

The reason we only color/link the year is that a single
citation may contain references to multiple articles, e.g.

(see Jones 2003; 2004; 2008, pp. 51-3; Smith 2008).

That only has to do with linking, though. It's possible,
using a filter, to ensure that the entire citation is
colored. The filter would just need to match on "Cite"
inlines and add some raw latex around them to set
the color, assuming you're targeting latex/pdf.

If you're targeting HTML, pandoc already puts the
citation in a span with class "citation" -- you can
just use CSS to color this as you like.

@samueldodson
Copy link

I am guessing that @joelostblom is more interested in linking the whole citation than colouring it, so colouring the whole citation without expanding the link is a poor solution. Would it be possible to expand the link if and only if the citation contains one reference? This approach is used in pandoc-crossref, see lierdakil/pandoc-crossref/issues/109.

@faroit
Copy link

faroit commented May 15, 2018

+1

3 similar comments
@mil-ad
Copy link

mil-ad commented Jul 2, 2018

+1

@khalid-hussain
Copy link

+1

@AndreyAkinshin
Copy link

+1

@jgm jgm changed the title Adding option to color the entire citation, not only the year? Adding option to link/color the entire citation, not only the year? Apr 17, 2019
@CxRes
Copy link

CxRes commented Apr 17, 2019

Looking at the discussion above, imho the nice solution will be to link the year when there are multiple citations for the same author. In single citation per author cases, it just seems nicer to place the link on author and date together. (Or simpler still but little inconsistent, which is what you would have sought to avoid if I am guessing correctly: the first link is Jones 2003, the next link is 2004)

Coloring citations would be nice too, but that as @samueldodson indicates as well, this is not what we (at least I) intend (That could be handled with latex/css also).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants