3

I am using RSC reference style for the bibliography of my master thesis. I want to hyperlink each of my bibliography item with its doi so that if I click on a reference then it should direct me to its external doi link. But I dont want to show the doi of the references.

I am using natbib package and my bibliography file is .bib file. I am using TeXmaker. I am very new to LateX and as a result of some research on the internet, I know I have to modify the rsc.bst file. I tried but there is no change in the bibliography. I would be thankful if someone help me in this matter. You can download the rsc.bst and .bib files from here.

Following is the minimal working example of the bibliography.

\documentclass[11pt,b5paper,twoside,openright]{report}

\usepackage[T1]{fontenc}
\usepackage{times}

\usepackage[square,numbers,sort&compress]{natbib}

\usepackage{mathtools}
\usepackage{lipsum}
\usepackage{verbatim}

\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{
   colorlinks=true,
   urlcolor=blue,    % color of external links
   linkcolor=black,  % color of toc, list of figs etc.
   citecolor=blue,   % color of links to bibliography
}
\begin{document}

\phantomsection
\addcontentsline{toc}{chapter}{bibliography}   % bibliography in table of contents

This is rsc \cite{RN8423} reference style \cite{RN8437}.

\bibliographystyle{rsc}
\bibliography{thesis_bib}

\end{document}

Added comment:

Actually, I am using rsc style because of my references, there are many chemical formulae or names in the titles. So I don't want to spend much time correcting them by subscripting or supercripting the texts. I am willing to use any other style in which title field is hidden. Also, I am willing to switch to biblatex ...

4
  • Welcome to TeX.SX! Please help us help you and add a minimal working example with bibliography (MWEB) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Jun 12, 2016 at 15:21
  • Thank you so much @samcarter and @Kurt. I have edited my post and added link to download the rsc.bst and .bib files. Also, I have added the minimal working example with bibliography.
    – abideen
    Jun 13, 2016 at 4:18
  • 1
    If you are willing to switch to biblatex: tex.stackexchange.com/questions/48400/… Jun 13, 2016 at 10:46
  • Actually, I am using rsc style because of my references, there are many chemical formulae or names in the titles. So I don't want to spend much time correcting them by subscripting or supercripting the texts. I am willing to use any other style in which title field is hidden. Also, I am willing to switch to biblatex...
    – abideen
    Jun 14, 2016 at 3:16

1 Answer 1

2

Because you mentioned that you are willing to change to biblatex please see the MWE later.

For biblatex are own styles defined, the one simular to your used rsc.bst is chem-rsc and best is to use biber instead of your used bibtex. The following code does what you need (package filecontents is only used to have bib file and tex code together in one compilable code; package csquotes is needed for biblatex and \jobname.bib names the bibfile created with filecontents):

\usepackage{csquotes}
\usepackage[%
  backend=biber, % <====================================================
  doi=false,     % show no doi in the bibliography <====================
  url=false,
  isbn=false,
  style=chem-rsc % <====================================================
]{biblatex}
\addbibresource{\jobname.bib}  % Use bib file created with filecontents

The following code builds the link that should be showed. Depending on the given inputs, it shows the doi, if the doi is not available the url, if no url avaiable the isbn etc.:

\newbibmacro{string+doiurlisbn}[1]{%
  \iffieldundef{doi}{%
    \iffieldundef{url}{%
      \iffieldundef{isbn}{%
        \iffieldundef{issn}{%
          #1%
        }{%
          \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
        }%
      }{%
        \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
      }%
    }{%
      \href{\thefield{url}}{#1}%
    }%
  }{%
    \href{http://dx.doi.org/\thefield{doi}}{#1}%
  }%
}

The following code defines, that the titles or the journal names becomes clickable and shows the given doi, or ...

\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat{journaltitle}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat[article,incollection]{title}%
  {\usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}

If you want to change the sign between two or more auhors and the sign after the last author see the following code and change it as you need:

\renewcommand*{\multinamedelim}{\addcomma\space} % \addand
\renewcommand*{\finalnamedelim}{\addcomma\space} % \addpunct

Because it is not so easy to link the doi to the complete printed bib item I only linked the title or the journal name of your given example.

With the following comlete MWE

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{RN8437,
  author = {Garrett, C. G. B. and Brattain, W. H.},
  title = {Physical theory of semiconductor surfaces},
  journal = {Physical Review},
  volume = {99},
  number = {2},
  pages = {376-387},
  ISSN = {0031-899X},
  DOI = {10.1103/PhysRev.99.376},
  year = {1955},
  type = {Journal Article},
}
@book{RN8423,
  author = {Madou, Marc J. and Morrison, S. Roy},
  title = {Chemical sensing with solid state devices},
  publisher = {Academic Press},
  address = {San Diego},
  series = {Chemical sensing with solid state devices},
  ISBN = {978-0-12-464965-1},
  DOI = {10.1016/B978-0-12-464965-1.50006-5},
  url = {http://www.sciencedirect.com/science/article/pii/B9780124649651500065},
  year = {1989},
  type = {Book},
}
\end{filecontents*}


\documentclass[11pt,b5paper,twoside,openright]{report}

\usepackage[T1]{fontenc}
\usepackage{times}

\usepackage{csquotes}
\usepackage[%
  backend=biber, % <====================================================
  doi=false,
  url=false,
  isbn=false,
  style=chem-rsc % <====================================================
]{biblatex}
\addbibresource{\jobname.bib}

\newbibmacro{string+doiurlisbn}[1]{%
  \iffieldundef{doi}{%
    \iffieldundef{url}{%
      \iffieldundef{isbn}{%
        \iffieldundef{issn}{%
          #1%
        }{%
          \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
        }%
      }{%
        \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
      }%
    }{%
      \href{\thefield{url}}{#1}%
    }%
  }{%
    \href{http://dx.doi.org/\thefield{doi}}{#1}%
  }%
}

%\DeclareFieldFormat{default}{\usebibmacro{string+doiurlisbn}{#1}}
\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat{journaltitle}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat[article,incollection]{title}%
  {\usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}

\renewcommand*{\multinamedelim}{\addcomma\space} % \addand
\renewcommand*{\finalnamedelim}{\addcomma\space} % \addpunct

\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{
   colorlinks=true,
   urlcolor=blue,    % color of external links
   linkcolor=black,  % color of toc, list of figs etc.
   citecolor=blue,   % color of links to bibliography
}


\begin{document}

\phantomsection
\addcontentsline{toc}{chapter}{bibliography}   % bibliography in table of contents

This is rsc \cite{RN8423} reference style \cite{RN8437}. 
%\nocite{*} % to test the complete bib file 

\printbibliography

\end{document}

I get the following result:

resulting bibliography

Change the delimiters as you need please.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .