[Tex/LaTex] Citation and bibliography customization

biblatexbibliographiescustom-bibnatbib

I am currently writing my PhD thesis and I am haunted by the choice of a convenient bibliography package/style/etc to meet exactly my needs of a custom list of references.

\documentclass{book}
\usepackage[sort]{natbib}

\begin{document}
Trying citations
\citep{pollock} and \citet{pollock}

\bibliographystyle{plainnat}
\bibliography{articles}

\end{document} 

with the following articles.bib file:

@article{pollock,
year={2050},
journal={My Journal A},
volume={27},
number={4},
title={The breakdown of single-crystal solidification},
url={https://tex.stackexchange.com/posts/213463},
author={Pollock, T.M. and Murphy, W.H.},
pages={1000-2000},
}

My requirements were basically met by natbib's plainnat or apalike with authordate setting:

  • Cite using author names instead of alpha-style, e.g. [Bao98]
  • Textual citations whenever needed, if not normal parenthical citations
  • Generate a list of references that would include usual items + URL + (most importantly:) a bracketed identifier to the left of the reference, which is generated using alpha style in natbib

The last point is not possible though, which is why I tried searching for alternate solutions, without really finding a suitable one:

  1. dinat solution is great but it supports german citations (produces german words inside the citation and references!)
    enter image description here
  2. Created a custom style.bst using latex makebst tool, however the new promising style produces an error similar to this question but cannot be fixed even after trying the suggested answers ans solutions. Maybe I should have loaded some additional packages before using it

Bottom line, is it possible or is it too much to ask from LateX ? In the meantime, I am 'procrastinating' in these links:

Best Answer

Using Natbib


Considering the comments to my question, the fastest way was to hack the dinat.bst file changing the following:

  • German to english words
  • Authors name font
  • Volume/number/year format
  • Removed urldate field
  • Removed unnecessary dashes
  • Modify spacing between label and reference

Final output: enter image description here

Using BibLateX


\usepackage[american]{babel}% Recommended
\usepackage{csquotes}% Recommended
\usepackage [backend=bibtex,style=authoryear]{biblatex} %style=authoryear %style=apa

\newcommand{\citep}[1]{\parencite{#1}}
\newcommand{\citet}[1]{\textcite{#1}}

\ExecuteBibliographyOptions{hyperref=true,backref=true,firstinits=true, isbn=false, eprint=false,
                            url=true, doi=false, sorting=nyt, minnames=1, maxcitenames=2, maxbibnames=2, 
                            alldates=short, punctfont=true, autopunct=false, block=none, dashed=false}

% Path to bib file (with extension)
\addbibresource{articles.bib}

% Spacing in list of references
\setlength{\bibitemsep}{15pt} %vertical spacing
\setlength{\bibhang}{1cm} %label alignment (0 for perfect align)

% Disable URL dates and language
\AtEveryBibitem{%
    \clearfield{urldate}%
    \clearfield{urlday}%
    \clearfield{urlmonth}%
    \clearfield{urlyear}%
    \clearlist{language}
}%

%Fix the comma problem after the journal name (via addcomma)
\DeclareFieldFormat{journaltitle}{\mkbibemph{#1\isdot}\addcomma\space}

%Fix number and volume format
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
%  \setunit*{\adddot}% DELETED
  \setunit*{\addnbspace}% NEW (optional); there's also \addnbthinspace
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

%Disable In prefix
\renewbibmacro{in:}{}

% Define brackets instead of parenthesis
\makeatletter
\newrobustcmd*{\parentexttrack}[1]{%
  \begingroup
  \blx@blxinit
  \blx@setsfcodes
  \blx@bibopenparen#1\blx@bibcloseparen
  \endgroup}

\AtEveryCite{%
  \let\parentext=\parentexttrack%
  \let\bibopenparen=\bibopenbracket%
  \let\bibcloseparen=\bibclosebracket}
\makeatother

%define label before reference in list  
\renewbibmacro{begentry}{%
\textbf{[\printnames[][-\value{liststop}]{labelname}~\printfield{labelyear}\printfield{extrayear}}]\\}

%define full hyperlink for textcite
\DeclareCiteCommand{\textcite}
  {\boolfalse{cbx:parens}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{textcite}}}
  {\ifbool{cbx:parens}
     {\bibcloseparen\global\boolfalse{cbx:parens}}
     {}%
   \multicitedelim}
  {\usebibmacro{textcite:postnote}}

%define full hyperlink for parencite  
 \DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

The command \printbibliography in the document body will print the list of references with labels. enter image description here