biblatex-ext icon indicating copy to clipboard operation
biblatex-ext copied to clipboard

Icons for non-OA papers with DOI, URL or eprint

Open schoeps opened this issue 1 year ago • 2 comments

I use biblatex-ext-oa to display beautiful pictograms next to my OA publications. Thank you. Because I no longer need DOIs, eprints and URLs, I hide them and save space. Now, of course, it would also make sense to display an icon (locked padlock?) for non-OA papers and to follow the DOI (or URL of whatever) even if there is a paywall. Any tips on how I can do this? Where can I have a look? Thanks!

schoeps avatar Feb 07 '25 16:02 schoeps

The open access logo based on https://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg is implemented in

https://github.com/moewew/biblatex-ext/blob/d301753e50f2a55418557f0805fbb6f0e8f4aa11/biblatex-ext-oasymb-l3draw.sty#L22-L54

https://github.com/moewew/biblatex-ext/blob/d301753e50f2a55418557f0805fbb6f0e8f4aa11/biblatex-ext-oasymb-pict2e.sty#L24-L44

https://github.com/moewew/biblatex-ext/blob/d301753e50f2a55418557f0805fbb6f0e8f4aa11/biblatex-ext-oasymb-tikz.sty#L20-L39

you could use your preferred impementation as a basis for a new "closed access" logo looking more like, for example https://commons.wikimedia.org/wiki/File:Closed_Access_logo_white.svg or https://commons.wikimedia.org/wiki/File:Closed_Access_logo_alternative.svg.


Currently the open access logo is ultimately printed by

https://github.com/moewew/biblatex-ext/blob/d301753e50f2a55418557f0805fbb6f0e8f4aa11/biblatex-ext-oa.sty#L393-L397

where

https://github.com/moewew/biblatex-ext/blob/d301753e50f2a55418557f0805fbb6f0e8f4aa11/biblatex-ext-oa.sty#L350-L368

It would then probably be easiest to create something a copy of \extblx@oa@marginmark for the closed access logo with the appropriate link (probably just doi > url) and use that in oamark.


Let me know if you need any more pointers. At the moment I'm not sure if I want to add this to the package, because in part I want the package to promote open access and giving closed-access work the cute little icon makes the open access work stand out less. But I guess an option would be possible....

moewew avatar Feb 11 '25 18:02 moewew

Thanks for the careful answer; this was excellent advice! It took me less than half an hour to do a first implementation. I indeed copied \extblx@oa@marginmark to \extblx@noa@marginmark in https://github.com/schoeps/biblatex-ext/commit/125177a7b8a0f0b7d98f254aa2aab234ed47cae4#diff-19ccb8f01ad4825b91da58bea97080464cebb7f4ea9fb86479c2acd1995c39aeR410. Then I added a simple logic to only do something if bestoaurl is empty:

   \newbibmacro*{oamark}{%
     \iffieldundef{bestoaurl}
       {%
            \iffieldundef{doi}{}{\extblx@noa@marginmark}%
       }
       {\extblx@oa@marginmark}}

see https://github.com/schoeps/biblatex-ext/commit/125177a7b8a0f0b7d98f254aa2aab234ed47cae4#diff-19ccb8f01ad4825b91da58bea97080464cebb7f4ea9fb86479c2acd1995c39aeR410. Drawing was also easy: again, I copied the tikz logo and just added another rectangle: https://github.com/schoeps/biblatex-ext/commit/125177a7b8a0f0b7d98f254aa2aab234ed47cae4#diff-8ec6c18bbeb91b4529e21009a30996c3c2288567e1ea8d332f098791d0daf5dfR46. I did not yet invest any time to look into the other logos.

My use case is covered. Thank you! I would surely not mind to clean up my code and contribute (or you may want to rewrite it yourself... it's probably no big issue for you). The question is if you want to integrate it or not. I see the point of pushing OA and this was my original motivation but then again, people may also want symmetry between the two cases (as I explained in my original post).

schoeps avatar Feb 11 '25 21:02 schoeps