3

I have some problem in customizing bibliography style of @article using biblatex and biber when writing my paper. The picture shows the bibliography style generated by running .tex file. Refstyle

However, I want to: 1. Remove the comma (,) between the last and first names of authors. 2. Switch the sequence of volume, number and year as: year; volume(number):

For example, in the picture Reference[3]: 56.7 (2013) should be 2013; 56(7):

Many thanks.

The following are my .tex and .bib files:

.tex file

\documentclass[a4paper, 10pt]{article}

\usepackage[top=2cm, bottom=2cm, left=3cm, right=3cm]{geometry}
\usepackage[backend=biber,style=numeric-comp,sortcites=true,maxbibnames=100,firstinits=true,terseinits=true,sorting=none]{biblatex}
\usepackage{hyperref}  
\addbibresource{mybib.bib}

\renewcommand*{\finalnamedelim}{\multinamedelim} 

\renewcommand*{\bibpagespunct}{\intitlepunct}

\DeclareFieldFormat[book, article, thesis, inproceedings]{title}{#1}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{default}{last-first}

\renewbibmacro{in:}{\ifentrytype{article} {} {\printtext{\bibstring{in} \intitlepunct}}}


\begin{document}

This is an example for illustration of customizing bibliography style.~\cite{gams,AIChE,Azeez2013}

\printbibliography

\end{document}

.bib file

@article{Azeez2013,
    author = {Azeez, O. S. and Isafiade, A. J. and Fraser, D. M.},
    title = {Supply-based superstructure synthesis of heat and mass exchange networks},
    journal = {Computers \& Chemical Engineering},
    volume = {56},
    number = {7},
    pages = {184--201},
    year = {2013}
}

@book{gams,
    author = {Rosenthal, Racd Ejijig},
    title = {GAMS---A User's Guide},
    year = {2010},
    publisher = {GAMS Development Corporation}
}

@inproceedings{AIChE,
    author = {Savelski, Minor J and Bagajewicz, Michel J},
    title = {Design and retrofit of water utilization systems in refineries and process plants},
    booktitle = {Annual National AIChE Meeting},
    year = {1997},
    location = {Los Angeles, USA}
}
moewe
  • 175,683
Nick
  • 761
  • what is the special in the output desired? – touhami Jul 31 '15 at 09:49
  • 2
    Normally it is preferred to ask one question at a time. Many components of your question have already been answered elsewhere. A good start is Guidelines for customizing biblatex styles. This \DeclareNameAlias{default}{last-first} \renewcommand*{\finalnamedelim}{\multinamedelim} \DeclareFieldFormat*{title}{#1} \DeclareFieldFormat*{booktitle}{#1} already does some of the things you asked for. – moewe Jul 31 '15 at 09:51
  • It would also be really helpful if you could state what exactly you want changed. (I find it quite hard to see the pattern with the semicolon). But please conduct a search of this site first for each of the items. – moewe Jul 31 '15 at 09:52
  • @moewe I edited my problem to make it clearer. Thanks, moewe. I am now reading the materials you offered. I hope I could solve the problem. – Nick Aug 01 '15 at 02:33
  • If you want to get rid of the pp maybe see my question on avoiding a side-effect. (Also implicitly explains how to get rid of it.) Especially if you might want to specify non-default pagination still. I also asked about in. – cfr Aug 01 '15 at 02:52
  • Now, I think you'll find that the code in my first comment above answers (1) and (2). For (3), please refer to the very well known Suppress “In:” biblatex (incidentally, googling for "biblatex in" brings that post up as the first result). (5) Can be dealt with either by \DeclareFieldFormat{pages}{#1} or by the code given in cfr's link above. – moewe Aug 01 '15 at 05:43
  • In your new picture I note you got rid of the semicolons was that intended? In your question, however, you still ask for "year;volume" (with a semicolon and without space ...). – moewe Aug 01 '15 at 05:45
  • Seeing that all points except for the modifications of the @article have been answered, I suggest you make this question about these specific modifications you want applied to @articles. – moewe Aug 01 '15 at 05:55
  • @moewe Thank you, moewe. I have revised the question specific for article modification. – Nick Aug 01 '15 at 07:51
  • The first question could be solved by adding: \renewcommand*{\revsdnamepunct}{} – Nick Aug 01 '15 at 08:11

1 Answers1

4

The necessary modifications for @article to look as you wish are as follows

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \setunit{\addsemicolon\space}%
  \usebibmacro{volume+number+eid}%
  \newunit}

To change the order of the fields: first year, only then volume and number.

Then

\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

To typeset volume and number as "56(3)".

And finally

\renewbibmacro*{issue+date}{%
  \iffieldundef{issue}
    {\usebibmacro{date}}
    {\printfield{issue}%
     \setunit*{\addspace}%
     \usebibmacro{date}}%
  \newunit}

To make sure the date is not wrapped in parentheses.

MWE

\documentclass[a4paper, 10pt]{article}
\usepackage{geometry}
\usepackage[backend=biber,style=numeric-comp,sortcites=true,maxbibnames=100,firstinits=true,terseinits=true,sorting=none]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}  

\begin{filecontents*}{\jobname.bib}
@article{Azeez2013,
    author = {Azeez, O. S. and Isafiade, A. J. and Fraser, D. M.},
    title = {Supply-based superstructure synthesis of heat and mass exchange networks},
    journal = {Computers \& Chemical Engineering},
    volume = {56},
    number = {7},
    pages = {184--201},
    year = {2013}
}

@book{gams,
    author = {Rosenthal, Racd Ejijig},
    title = {GAMS---A User's Guide},
    year = {2010},
    publisher = {GAMS Development Corporation}
}

@inproceedings{AIChE,
    author = {Savelski, Minor J and Bagajewicz, Michel J},
    title = {Design and retrofit of water utilization systems in refineries and process plants},
    booktitle = {Annual National AIChE Meeting},
    year = {1997},
    location = {Los Angeles, USA}
}
\end{filecontents*}

\addbibresource{\jobname.bib}

\renewcommand*{\finalnamedelim}{\multinamedelim} 

\renewcommand*{\bibpagespunct}{\intitlepunct}

\DeclareFieldFormat[book, article, thesis, inproceedings]{title}{#1}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{pages}{#1}

\DeclareNameAlias{default}{last-first}

\renewbibmacro{in:}{\ifentrytype{article} {} {\printtext{\bibstring{in} \intitlepunct}}}


\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \setunit{\addsemicolon\space}%
  \usebibmacro{volume+number+eid}%
  \newunit}

\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\renewbibmacro*{issue+date}{%
  \iffieldundef{issue}
    {\usebibmacro{date}}
    {\printfield{issue}%
     \setunit*{\addspace}%
     \usebibmacro{date}}%
  \newunit}

\begin{document}

This is an example for illustration of customizing bibliography style.~\cite{gams,AIChE,Azeez2013}

\printbibliography

\end{document}

Azeez, OS, Isafiade, AJ, Fraser, DM. Supply-based superstructure synthesis of heat and mass exchange networks. Computers & Chemical Engineering 2013; 56(7): 184–201.

moewe
  • 175,683
  • Can you change the title of the question to a more specific one? – Johannes_B Aug 01 '15 at 12:35
  • @Johannes_B Mhh, can you think of a good title? – moewe Aug 01 '15 at 12:37
  • :-D No, that's why i asked you :-) It is hard as this is a multi-question Q. – Johannes_B Aug 01 '15 at 12:38
  • @Johannes_B So it's a stand-off, then. All I could come up with would be something like: Change the order of volume, number and year in Articles, but that is neither catchy nor a very good description of the problem... – moewe Aug 01 '15 at 12:41
  • Maybe finding a good duplicate? – Johannes_B Aug 01 '15 at 12:48
  • by the way: Many thanks for helping out on golatex :-) – Johannes_B Aug 01 '15 at 12:48
  • @Johannes_B I'm not sure whether there is an exact duplicate, though parts of the answer will be scattered throughout other questions on this site (the "volume(number)" thing surely has more than one solution here, I wouldn't expect that for the semicolon though, and the year probably has been moved to all kinds of places). – moewe Aug 01 '15 at 12:52
  • Then i'd say the semicolon deal stands out and should go to the title :-) – Johannes_B Aug 01 '15 at 12:53
  • @Johannes_B Good analysis :-)! Maybe Swap year and volume and separate them by semicolon for Articles is a cumbersome but more or less accurate title? – moewe Aug 01 '15 at 12:57
  • 1
    That seems to be fine :-) Go for it. – Johannes_B Aug 01 '15 at 13:13
  • @moewe Where could I find the macro code of "journal+issuetitle", "volume+number+eid" and "issue+date". Having these codes, I may do some modification to get my desired bibliography style. Thanks. – Nick Aug 02 '15 at 13:26
  • 1
    Most of these macros are in standard.bbx, but some are in biblatex.def. Other still (that are more style-dependent) can be found in the .bbx and .cbx files of your style, in your case numeric-comp.bbx/numeric-comp.cbx. If you don't know where to find these files, type kpsewhich <file> in your command line and the command line will tell you where the file resides. Keep in mind that you should never modify a file you got from your TeX distribution, with biblatex it suffices to make the adjustments in the preamble. – moewe Aug 02 '15 at 15:26
  • @moewe Thank you, moewe. Have found the "journal+issuetitle", "volume+number+eid" and "issue+date" definition in standard.bbx and biblatex.def files. They are helpful for customizing bibliography style. – Nick Aug 03 '15 at 02:12
  • @moewe I want to put the codes for customizing bibliography style in other files, such as biblatex.cfg, as mentioned here: [http://tex.stackexchange.com/questions/12806/guidelines-for-customizing-biblatex-styles], load this style file in my .tex file. How could I achieve that? Many thanks. – Nick Aug 03 '15 at 09:16
  • As far as I know you can just create a biblatex.cfg where LaTeX can find it and add your code. – moewe Aug 03 '15 at 09:19