1

I want make my bibliography in which there is comma between author and article name instead of full stop. And also i want to write name of article in inverted commas (as x). Is there any way of writing such type of bibliography

Example:

 G. Agarwal & S. Sindh,"A comparison between public key authority and certification authority for distribution of public key". International Journal of Computer Science and Information Technologies.1(5):332--336,2010.

My bibliography code:

\RequirePackage{filecontents}
 \begin{filecontents}{mybib.bib}
  @article{link:cac,
 title   = {A comparison between public key authority and certification authority for distribution of public key},
 author  = {Agarwal, Gaurav and Singh, Saurabh},
 journal = {International Journal of Computer Science and Information Technologies},
 volume  = {1},
  number  = {5},
  pages   = {332--336},
  year    = {2010}
 }
\end{filecontents}

\documentclass{article}
 \usepackage[numbers]{natbib}
  \bibliographystyle{abbrvnat}

 \begin{document}
        \noindent
        \citet{link:cac}, \cite{link:cac}
        \bibliography{mybib}
        \end{document}
  • 2
    This should be easy to do with biblatex. – Bernard Jul 22 '17 at 16:32
  • @Bernard but how? – sam Jul 22 '17 at 16:36
  • Which style would you use? Numeric, authoryear, alphabetoc? Usually, one starts with a style close to what one wants, and add some customisation. – Bernard Jul 22 '17 at 16:47
  • @Bernard The MWE makes it quite clear it's a numbered style, abbrvnat. A biblatex answer would also be useful to have, though. – Alan Munn Jul 22 '17 at 17:08
2

As with most traditional BiBTeX formatting issues, this requires hacking the .bst file itself, but it's not that hard to do. An alternative is to use biblatex.

First locate the original abbrvnat.bst file. You can find the exact path for your system by using kpsewhich abbrvnat.bst from the command line. On a current TeXLive system it is in:

/usr/local/texlive/2017/texmf-dist/bibtex/bst/natbib/abbrvnat.bst

Make a copy of this file, and call it e.g. abbrvnat-quotes.bst. Put this in your local texmf folder: ...texmf/bibtex/bst/ or simply place it in the same folder as your source document if you only need this style for that document.

Now you need to make the following changes to the file:

  1. Add a new function enquote to the file. This should go with the other functions. A simple way is to find the emphasize function and copy it and then make it look like this:

FUNCTION {enquote}
 { duplicate$ empty$
     { pop$ "" }
     { "``" swap$ * "''" * }
   if$
 }

For a more flexible version of the enquote function, you can use the csquotes package. See How to modify a bibliography style to surround titles in quotes in a bibliography? for details on how to do this.

  1. Find the article function (line 699) and make the following modifications: Change the following line:

format.title "title" output.check

to:

format.title enquote "title" output.check
  1. To add a comma after the author name requires more extensive changes, since you need to change the format for every publication type. But the general method is the same. In each publication type you will find the following lines:

author format.key output
new.block

You need to change all of these pairs of lines to:

author format.key output

For more complex items, the simple line author format.key output may not be present. In that case you need to look for the new.block line that is between the author output code (whatever that is) and the title code. For the book type, for example you will find:

author empty$
    { format.editors "author and editor" output.check
      editor format.key output
    }
    { format.authors output.nonnull
      crossref missing$
        { "author and editor" editor either.or.check }
        'skip$
      if$
    }
  if$
  new.block
  format.btitle "title" output.check

In this case you need to remove the new.block line.

Save the file and use \bibliographystyle{abbrvnat-quotes} in your source document.

\RequirePackage{filecontents}
 \begin{filecontents}{mybib.bib}
  @article{link:cac,
 title   = {A comparison between public key authority and certification authority for distribution of public key},
 author  = {Agarwal, Gaurav and Singh, Saurabh},
 journal = {International Journal of Computer Science and Information Technologies},
 volume  = {1},
  number  = {5},
  pages   = {332--336},
  year    = {2010}
 }
\end{filecontents}

\documentclass{article}
\usepackage[numbers]{natbib}
\bibliographystyle{abbrvnat-quotes}

\begin{document}
\noindent
\citet{link:cac}, \cite{link:cac}
\bibliography{mybib}
\end{document}

output of code

  • @sam Did you delete your .aux files and recompile? Did any of the changes have an effect? – Alan Munn Jul 28 '17 at 13:09
  • @sam Does the sample document in my answer work? What do the first 4 lines of the .blg file say after you run bibtex? – Alan Munn Aug 4 '17 at 12:25
  • @sam That's not the .blg of the sample answer. And that's not the first four lines of the file, which should begin with "This is BibTeX, version ..." What does the line beginning with "The style file: " show? – Alan Munn Aug 6 '17 at 16:56
  • @sam This shows that you are not using the new copy of the .bst file that you created. Did you change the \bibliographystyle command in your thesis to abbrvnat-quotes (which is the filename I suggested for the modified copy?) – Alan Munn Aug 6 '17 at 17:01
  • @sam Are you sure you don't have a second \bibliographystyle command lurking somewhere later in the document? – Alan Munn Aug 6 '17 at 17:05
3

Here's the biblatex way. Loading csquotes, you have a choice for the quotes style. The default is american quotes, but you may have british, guillemets, &c. It cooperates with babel or polyglossia.

Note the differences with the traditional way: the bibliography style is an option of biblatex the .bib files have to be declared in the preamble with the command \addbibresource{mybib.bib} (with extension), and the bibliography is called with \printbibliography where you want it. The bibliography engine by default is biber, but you can use bibtex with the option backend=bibtex, at the price of the loss of some functionalities. In particular, biber understands utf8.

\RequirePackage{filecontents}
 \begin{filecontents}{mybib.bib}
  @article{link:cac,
 title = {A comparison between public key authority and certification authority for distribution of public key},
 author = {Agarwal, Gaurav and Singh, Saurabh},
 journal = {International Journal of Computer Science and Information Technologies},
 volume = {1},
  number = {5},
  pages = {332--336},
  year = {2010}
 }
\end{filecontents}

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex}
 \usepackage[style=british]{csquotes}%
\addbibresource{mybib.bib}
\DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space}
\DeclareDelimFormat[biblist]{nametitledelim}{\addcomma\space}

\begin{document}

\noindent
\cite{link:cac}, \textcite{link:cac}
\printbibliography

\end{document} 

enter image description here

  • 1
    +1 I think the requested style needs double quotation marks, not single, though. Also, I would really only advise using bibtex as a back end as an absolute last resort. – Alan Munn Jul 22 '17 at 18:40
  • It was just for a demo of what can easily be done. – Bernard Jul 22 '17 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.