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}
Alan Munn
  • 218,180
sam
  • 113

2 Answers2

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

Bernard
  • 271,350
  • 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
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

Alan Munn
  • 218,180
  • @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 04 '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 06 '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 06 '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 06 '17 at 17:05
  • @sam I really don't know what to say. The file reported in the .blg file should match the file in the bibliographystyle command assuming you are starting with all the .aux, .blg, .bbl files deleted. – Alan Munn Aug 06 '17 at 18:12
  • oh sorry, i forget to delete the .blg and .bbl files. Now it works. But not work in references of @books and @inproceedings @misc. – sam Aug 06 '17 at 19:37
  • @sam Which part doesn't work for these items? The quotation marks or the comma part? – Alan Munn Aug 06 '17 at 19:44
  • both are not working. This is only working for article – sam Aug 06 '17 at 19:50
  • @sam First of all, book titles shouldn't be in quotation marks; they should be in italics. Second, did you remove the new.block lines from between the author code and the title code for all of the entries? I've updated the answer to show how to do this for the book. type. – Alan Munn Aug 06 '17 at 19:58