0

I'm pretty new to latex. But I was wondering if there is a package out there that allows a click of your citation to go to a google search or google scholar page to access the paper.

I'm currently using the "hyperref" package, so my pdf does jump to wherever my sections are and citations are upon clicking. And I did see that you can also generate links as well using hyperref.

But ideally, I'm looking for something that if I click the citation, it will take me to a google scholar search with the bibtex info in it. Does anyone know of any packages or methods that makes this possible?

Thanks!

--edit--

For example:

@article{grotta2004constraint,
  title={Constraint-induced movement therapy},
  author={Grotta, James C and Noser, Elizabeth A and Ro, Tony and Boake, Corwin and Levin, Harvey and Aronowski, Jarek and Schallert, Timothy},
  journal={Stroke},
  volume={35},
  number={11 suppl 1},
  pages={2699--2701},
  year={2004},
  publisher={Am Heart Assoc}
}

Would it be possible to write something like a function that takes the citation reference "grotta2004constraint" as [1] and open up a page on google resulting in "https://scholar.google.com/scholar?q=Constraint-induced+movement+therapy%2C+Grotta%2C+James+C+and+Noser%2C+Elizabeth+A+and+Ro%2C+Tony+and+Boake%2C+Corwin+and+Levin%2C+Harvey+and+Aronowski%2C+Jarek+and+Schallert%2C+Timothy&btnG=&hl=en&as_sdt=0%2C5" where the title and authors get put into google scholar if I click on the citation?

Mico
  • 506,678
AnoXxi
  • 1
  • Please show us a minimal example and how the query should look like. – TeXnician Jul 22 '17 at 18:12
  • Not sure if I understand your question correctly, but are you looking for the url = {www.google.com} field for your bibtex entries? Or give the doi, if your bibligraphy style supports it, it will create a link to the official website of the paper. – samcarter_is_at_topanswers.xyz Jul 22 '17 at 18:14
  • I added an example, please check the edit. Thanks again for trying to help! – AnoXxi Jul 22 '17 at 19:23
  • 1
    You have to supply the link yourself, I guess. – egreg Jul 22 '17 at 19:46
  • You still haven't given a complete example. Biblatex supports eprint, eprinttype and eprintclass which can be used to link from the bibliography entry to an online reference (e.g. the article or whatever). Then you just give the relevant identifiers in the entry and Biblatex creates the link based on a standard recipe. But since we don't know what recipe you're using for anything, there's no telling how useless this information might be. – cfr Jul 23 '17 at 00:58

1 Answers1

4

This is possible using biblatex, for example by redefining the format of the title to include a link based on the title itself and the list of authors.

The title is the easiest, the non-formatted text is available using the macro \thefield{title}. The authors are more difficult, because this information is stored in a list (instead of a string). Borrowing from https://tex.stackexchange.com/a/60633 (and updated following https://tex.stackexchange.com/a/299084) you can use indexing functions from biblatex to loop the list of authors and store them in a macro.

MWE, compiled with pdflatex myfile.tex, then biber myfile, then pdflatex myfile.tex:

\documentclass{article}
\usepackage[backend=biber,style=numeric]{biblatex}
\usepackage{hyperref}
% only for this example, to create a .bib-file on the fly
\usepackage{filecontents}

% explicit space to separate search terms
\def\space{ }
% add the hyperlink to the title (which is in argument #1)
\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{\href{https://scholar.google.com/scholar?q=\thefield{title}\space\authname}{\mkbibquote{#1\isdot}}}

% macro to store author last (family) names per citation
\newcommand*{\authname}{}
\DeclareIndexNameFormat{getname}{%
  % split the name into parts
  \nameparts{#1}
  % add family name to author list
  \xappto{\authname}{\namepartfamily\space}
}

% make author list for each citation
\AtEveryBibitem{%
  % make list empty
  \undef\authname
  % call 'getname' for each author in a loop
  \indexnames[getname][1-99]{author}
}

% store bibliography on the fly
\begin{filecontents*}{\jobname.bib}
@article{grotta2004constraint,
  title={Constraint-induced movement therapy},
  author={Grotta, James C and Noser, Elizabeth A and Ro, Tony and Boake, Corwin and Levin, Harvey and Aronowski, Jarek and Schallert, Timothy},
  journal={Stroke},
  volume={35},
  number={11 suppl 1},
  pages={2699--2701},
  year={2004},
  publisher={Am Heart Assoc}
}
\end{filecontents*}
% use stored bibliography file
\addbibresource{\jobname.bib}

\begin{document}
Article with Google Scholar link: \cite{grotta2004constraint}
\printbibliography
\end{document}

Result (link target shown in as tooltip):

enter image description here

The conversion to url format (with + and %2C etc) is performed automatically by the pdf reader or the browser (for me at least).

Note that there is no error checking or special processing implemented - problems should be expected when titles or authors contain special characters or formatting. Some of the problems may be solved by removing the author part from the search query (so keep only the DeclareFieldFormat), generally Google Scholar will find the publication also by title alone.

Marijn
  • 37,699
  • 1
    I guess the guys who made the DOI thingie just face plam themselves for not thinking about something that simple. – Johannes_B Jul 24 '17 at 16:07