BibTeX, biblatex and biberHow to customize the bib items with BibLaTeX?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
CMP
Posts: 13
Joined: Thu Aug 22, 2019 8:33 pm

How to customize the bib items with BibLaTeX?

Post by CMP »

Hi Everyone,

I am here again with one more question.

I recently decided to switch with BibLaTeX from natbib reference management.
Therefore, I am a beginner learner with BibTe.
But as always I need some customization on the existing options. :)

I have attached an MWE herewith along with my concern at the end.

Code: Select all

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage[
    style=numeric,
    url=false,
    doi=false,
    isbn=false
]{biblatex}
\usepackage{hyperref,url}
\usepackage{color}
\usepackage[autostyle, english = american]{csquotes}

\addbibresource{BibRef.bib}
 
\newcommand{\red}{\color[rgb]{1,0,0}}
\hypersetup{,colorlinks=true,allcolors=red}
 
\begin{document}

\begin{center}
{\LARGE 
Solving NP-hard Problems
}

\vspace{15mm}

{\large\sc
Author\footnote[1]{
Author, is an Assistant Professor in the Department of XYZ, 
XYZ University. 
~~ {\em e-mail\/}: ~{\tt xyz@university.edu}}} 

\vspace{1mm}

{\large\em XYZ University}

\vspace{15mm}

\end{center}

\vspace{3mm}

\begin{quote}
{\bf\em Abstract}.
XYZ.

\vspace{4mm}

\end{quote}

\section{Introduction}

About the paper!
 
\section{Main Results} 

Main results!
Markov Chains \cite{n97}
 
\section{Some Additional Results}
 
A graduate text in Mathematics \cite{ds14} 
 
\section{Something More} 
 
Probability and Measure Theory, \cite{MR1810041}.
 
\section{Additional Things}
 
Algebra, \cite{MR1034353}.

\section{Albert Einstein}
Here we go \cite{ae05}.
 
\printbibliography

\newpage 

\noindent 
{\red But the desired reference style is as below 
--
everything plain and fields are separated by comma!}

\begin{enumerate}[label={[}\arabic*{]}]
\item 
R.B. Ash, Probability and Measure Theory, second ed., 
Academic Press, Burlington, MA, 2000.

\item 
A. Einstein, On the electrodynamics of moving bodies, 
Annalender Physik 322 (10) (1905) 891--921.

\item 
T.W. Hungerford, A counterexample in Galois theory,
Amer. Math. Monthly 97 (1) (1990) 54--57.

\item 
J.R. Norris, Markov Chains,
Cambridge University Press, 1997.

\item 
D.W. Stroock, 
An Introduction to Markov Processes,
second ed.,
Springer, Berlin, Heidelberg, 2014.
\end{enumerate}

\noindent 
{\red 
So, I am wondering how is it possible to achieve this customized reference style 
with BibTaTeX?}
\end{document}
The corresponding .bib file is as below:

Code: Select all

@book {MR1810041,
    AUTHOR = {Ash, Robert B.},
     TITLE = {Probability and Measure Theory},
   EDITION = {Second},
 PUBLISHER = {Academic Press, Burlington, MA},
      YEAR = {2000},
     PAGES = {xii+516},
      ISBN = {0-12-065202-1},
   MRCLASS = {28-01 (60-01)},
  MRNUMBER = {1810041},
}

@article{ae05,
    AUTHOR = {Albert Einstein},
    TITLE = {On the electrodynamics of moving bodies},
    JOURNAL =  {Annalen der Physik},
    VOLUME = {322},
    NUMBER = {10},
    PAGES = {891--921},
    YEAR = {1905},
    DOI = {http://dx.doi.org/10.1002/andp.19053221004},
    keywords = {physics},
}

@article {MR1034353,
AUTHOR = {Hungerford, Thomas W.},
TITLE = {A counterexample in {G}alois theory},
JOURNAL = {Amer. Math. Monthly},
FJOURNAL = {American Mathematical Monthly},
VOLUME = {97},
YEAR = {1990},
NUMBER = {1},
PAGES = {54--57},
ISSN = {0002-9890},
MRCLASS = {12F10},
MRNUMBER = {1034353},
URL = {https://doi.org/10.2307/2324007},
}
 
@book {n97, 
    AUTHOR = {Norris, J. R.},
     TITLE = {Markov Chains}, 
 PUBLISHER = {Cambridge University Press},
      YEAR = {1997},
       DOI = {10.1017/CBO9780511810633},
}
 
@book {ds14, 
   AUTHOR = {Stroock, Daniel W.},
    TITLE = {An Introduction to Markov Processes}, 
PUBLISHER = {Springer, Berlin, Heidelberg},
  EDITION = {Second}, 
     YEAR = {2014},
     ISBN = {978-3642405228},
    PAGES = {IX+275},
    DOI = {10.1007/978-3-642-40523-5},
}
Then we get the following Reference listing which I do not want.

[img]
UnWantedRef.png
UnWantedRef.png (44.13 KiB) Viewed 5847 times
[/img]

But what I wanted is the following.

[img]
WantedRef.png
WantedRef.png (59.02 KiB) Viewed 5847 times
[/img]

Any help would greatly be appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

How to customize the bib items with BibLaTeX?

Post by Bartman »

From your description it is relatively clear what you have and what you want. Thanks for that.

Since i am not a biblatex professional, i wanted to wait and see if someone has a solution for you. Maybe my suggestion can help you, if you have not yet been able to develop a solution.

Code: Select all

\begin{filecontents}{\jobname.bib}
@book {MR1810041,
    AUTHOR = {Ash, Robert B.},
    TITLE = {Probability and Measure Theory},
    EDITION = {2},
    PUBLISHER = {Academic Press, Burlington, MA},
    DATE = {2000},
    PAGES = {xii+516},
    ISBN = {0-12-065202-1},
    MRCLASS = {28-01 (60-01)},
    MRNUMBER = {1810041},
}
     
@article{ae05,
    AUTHOR = {Albert Einstein},
    TITLE = {On the electrodynamics of moving bodies},
    JOURNALTITLE =  {Annalen der Physik},
    VOLUME = {322},
    NUMBER = {10},
    PAGES = {891--921},
    DATE = {1905},
    DOI = {http://dx.doi.org/10.1002/andp.19053221004},
    keywords = {physics},
}
     
@article {MR1034353,
    AUTHOR = {Hungerford, Thomas W.},
    TITLE = {A counterexample in {G}alois theory},
    JOURNALTITLE = {Amer. Math. Monthly},
    FJOURNAL = {American Mathematical Monthly},
    VOLUME = {97},
    DATE = {1990},
    NUMBER = {1},
    PAGES = {54--57},
    ISSN = {0002-9890},
    MRCLASS = {12F10},
    MRNUMBER = {1034353},
    URL = {https://doi.org/10.2307/2324007},
}
     
@book{n97, 
    AUTHOR = {Norris, J. R.},
    TITLE = {Markov Chains}, 
    PUBLISHER = {Cambridge University Press},
    DATE = {1997},
    DOI = {10.1017/CBO9780511810633},
}
     
@book{ds14, 
    AUTHOR = {Stroock, Daniel W.},
    TITLE = {An Introduction to Markov Processes}, 
    PUBLISHER = {Springer},
    LOCATION  = {Berlin and Heidelberg},
    EDITION = {2}, 
    DATE = {2014},
    ISBN = {978-3642405228},
    PAGES = {IX+275},
    DOI = {10.1007/978-3-642-40523-5},
}
\end{filecontents}

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage[
%    style=numeric,% default
    url=false,
    doi=false,
    isbn=false,
    giveninits
]{biblatex}
\usepackage{xcolor}
\usepackage[
    autostyle%,
%    english = american% not necessary
]{csquotes}
\usepackage{xpatch}% for \xpatchbibdriver
\usepackage{fmtcount}% for \ordinalstringnum
\usepackage{hyperref}
     
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\hypersetup{colorlinks=true,allcolors=red}
     
% biblatex.def
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{edition}{%
    \ifinteger{#1}
        {\ordinalstringnum{#1}~\bibstring{edition}}
        {#1\isdot}}

\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimAlias{finallistdelim}{multilistdelim}
     
\renewcommand*{\newunitpunct}{\addcomma\space}
     
\renewbibmacro{in:}{%
    \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
     
\renewcommand*{\bibpagespunct}{\addspace}
     
% standard.bbx
\renewbibmacro*{volume+number+eid}{%
    \printfield{volume}%
%    \setunit*{\adddot}%
    \setunit*{\addspace}%
    \printfield[parens]{number}%
    \setunit{\addcomma\space}%
    \printfield{eid}}
        
\renewbibmacro*{publisher+location+date}{%
    \printlist{publisher}%
    \setunit*{\addcomma\space}%
%    \iflistundef{publisher}
%        {\setunit*{\addcomma\space}}
%        {\setunit*{\addcolon\space}}%
    \printlist{location}%
    \setunit*{\addcomma\space}%
    \usebibmacro{date}%
    \newunit}
     
\xpatchbibdriver{book}
    {\newunit\newblock
    \usebibmacro{chapter+pages}}
    {}
    {}{\typeout{failed to patch bibmacro book to remove page macro}}

      
% article.cls
\renewenvironment{abstract}{%
    \quote
    {\bfseries\itshape\abstractname\par}%
}
{\endquote}
     
\begin{document}
\begin{center}
    {\LARGE Solving NP-hard Problems\par}
     
    \vspace{15mm}
    {
        \large\scshape
        Author\footnote{%
            Author, is an Assistant Professor in the Department of XYZ, 
            XYZ University.\\\emph{e-mail\/}:~\url{xyz@university.edu}%
        }
        \par
    }
     
    \vspace{1mm}
    \large\emph{XYZ University}
\end{center}
     
\vspace{18mm}
     
\begin{abstract}
XYZ.
\end{abstract}

\vspace{4mm}
     
\section{Introduction}
About the paper!
     
\section{Main Results} 
Main results!
Markov Chains \autocite{n97}
     
\section{Some Additional Results}
A graduate text in Mathematics \autocite{ds14} 
     
\section{Something More} 
Probability and Measure Theory, \autocite{MR1810041}.
     
\section{Additional Things}
Algebra, \autocite{MR1034353}.
     
\section{Albert Einstein}
Here we go \autocite{ae05}.

\section{\LaTeX}     
\autocite{companion}

\printbibliography
\end{document}
CMP
Posts: 13
Joined: Thu Aug 22, 2019 8:33 pm

How to customize the bib items with BibLaTeX?

Post by CMP »

Thank you Bartman!

That helps a lot!
Post Reply