1

I am writing my doctoral thesis, but I am frustrated when I try to output the reference format as my school required, it's required as follow (Only the following three types are needed in my thesis),

Journal [J]

enter image description here

Book [M]

enter image description here

Conference [C] enter image description here

Other requirements:

  1. Multiple authors: when the number of authors are greater than 3, keep first three and use "et al" for the rest authors.
  2. Sorting: By appearance.

My question is what kind of the bibliography style the above is?

and if there is none of the existing bibliography styles fitting for it, how should I build this style from scratch?

.bib:

@article{brauner91,
  author = {Brauner, N.},
  title = {Vapour absorption into falling film},
  journal = {ASME J},
  year = {1991},
  volume = {34},
  pages = {76-82},
  number = {3}
}
@book{baehr1994,
  title={Heat and mass transfer},
  author={Baehr, H. D.},
  year={1994},
  page={221}
  publisher={Berlin:Springer-Verlag}
}
@inproceedings{leiner1989,
  year  = {1989},
  pages={68--71},
  author = {Leiner, A.},
  title = {Optical techniques for heat transfer measurements},
  booktitle = { COLLINS W. Proc Int Conf on Energy and Environment},
  publisher={New York: Academic Press}
}
wayne
  • 1,331
  • 1
    Is there a number in front of the entry? or is this really all there is? – Johannes_B Mar 27 '16 at 14:43
  • Yes, it has. I omitted here for sake of simplicity. – wayne Mar 27 '16 at 14:44
  • 3
    Is there any explanation as to why there is a "[J]" after the title? The rest looks fairly standard. You have to play around with the name format a bit and some care will be needed for the journal and number. Please be aware though that this is not nearly enough to properly write a style for your thesis. What about @books, @incollections etc. Normally it is preferred to ask only one specific question per question here. How do I write a style for this can easy become a very broad issue. – moewe Mar 27 '16 at 14:48
  • 3
    That omitting for the sake of simplicity is actually hiding useful information. So you want to use a simple numeric citation/bibliography style. – Johannes_B Mar 27 '16 at 14:59
  • @moewe Thanks for your reply, I have updated my questions based on your answer, plz have a look. – wayne Mar 27 '16 at 15:08
  • @Johannes_B Thanks for your reminder. Yes, I want a numeric citation. – wayne Mar 27 '16 at 15:09
  • 1
    That is unfortunately still not enough information to properly write up a style. What if you have two or more authors? How is the list sorted? ... – moewe Mar 27 '16 at 15:10
  • There was a similar questiion not long ago, and my response. – Johannes_B Mar 27 '16 at 15:13
  • @moewe Updated, 1) Two more authors: greater than 3 authors, use "et al" for the rest authors. 2) Sorting: Numeric – wayne Mar 27 '16 at 15:19
  • 1
    What sorting is "numeric"? By appearance? And I don't understand what you are saying with the names. If I have more than three authors, do I give one and et al the others or do I give up to two? – moewe Mar 27 '16 at 15:20
  • @moewe Yes, like the IEEE style. – wayne Mar 27 '16 at 15:21
  • @moewe I just mistaken your reply, regarding the author names, if authors are 4, keep first 3, and replace the rest as 'et al' – wayne Mar 27 '16 at 15:41

1 Answers1

4

Try the following

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=numeric,backend=biber,giveninits=true,sorting=none,maxnames=3,minnames=3]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareNameAlias{default}{family-given}
\renewcommand*{\revsdnamepunct}{}
\renewrobustcmd*{\bibinitperiod}{}
\renewcommand*{\finalnamedelim}{\multinamedelim}

\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat*{issuetitle}{#1}
\DeclareFieldFormat*{maintitle}{#1}
\DeclareFieldFormat*{booktitle}{#1}

\newbibmacro*{title}{%
  \ifboolexpr{
    test {\iffieldundef{title}}
    and
    test {\iffieldundef{subtitle}}
  }
    {}
    {\printtext[title]{%
       \printfield[titlecase]{title}%
       \setunit{\subtitlepunct}%
       \printfield[titlecase]{subtitle}}%
     \ifentrytype{article}{\setunit{}\printtext{[A]}}{}
     \ifentrytype{book}{\setunit{}\printtext{[B]}}{}%
     \ifentrytype{inproceedings}{\setunit{}\printtext{[C]}}{}
     \newunit}%
  \printfield{titleaddon}}

\renewbibmacro*{in:}{\ifentrytype{article}{}{\printtext{//}}}

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

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

\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon\addspace}
\renewcommand{\postnotedelim}{%
  \iffieldpages{postnote}
    {\addcolon\space}
    {\addspace}}

\begin{document}
\cite{sigfridsson,brauner91,baehr1994,leiner1989,aksin}
\printbibliography
\end{document}

Most of this is fairly standard and can be found in Guidelines for customizing biblatex styles, biblatex: remove commas between last and first names in bibliography, Colon instead of “p.” in Biblatex authoryear-comp, Biblatex: No \postnotedelim for citations that aren't numerals, biblatex: parentheses around the volume number of an article

The odd requirements of your style were the indication of the entry type after the title as we as the "//" separator for "in", they are implemented via

\renewbibmacro*{title}{%
  \ifboolexpr{
    test {\iffieldundef{title}}
    and
    test {\iffieldundef{subtitle}}
  }
    {}
    {\printtext[title]{%
       \printfield[titlecase]{title}%
       \setunit{\subtitlepunct}%
       \printfield[titlecase]{subtitle}}%
     \ifentrytype{article}{\setunit{}\printtext{[A]}}{}
     \ifentrytype{book}{\setunit{}\printtext{[B]}}{}%
     \ifentrytype{inproceedings}{\setunit{}\printtext{[C]}}{}
     \newunit}%
  \printfield{titleaddon}}

\renewbibmacro*{in:}{\ifentrytype{article}{}{\printtext{//}}}

the latter of course follows the general pattern of Suppress “In:” biblatex.

moewe
  • 175,683
  • @moewe Do you see any use in collecting the custoizations of every question on github? It sometimes feels like a good idea, but then ... it is not a good idea. What do you think? – Johannes_B Mar 27 '16 at 15:46
  • 1
    @Johannes_B That pretty much describes my feelings about it ;-) If it were on github people might expect proper styles that are ready to use. Sometimes when I write answers though the code that comes out could be streamlined and improved quite a bit. Often questions only focus on particular aspects of one style (see here) so that I would feel uncomfortable releasing this into the wild with much of biblatex's behaviour not checked for compliance. Plus it might make people think that the github repository provides support for those styles and that opens up another can of worms – moewe Mar 27 '16 at 15:50
  • 1
    Can of worms That matches. By the way, i asked the Bibliotheksdirektorin about ISO 690 and DIN 1505. She admitted not to have a deeper knowledge, but asked: "Is das nich nur ganz allgemein gehalten? Da steht doch nichts spezifisches drin, oder?" – Johannes_B Mar 27 '16 at 15:57
  • @Johannes_B I don't know if that non-specific advice in ISO/DIN makes life easier as long as supervisors insist what they just conjured up/like is ISO 690. It certainly doesn't help with the Babylonian naming problem of everybody calling their style DIN/ISO-whathaveyou. – moewe Mar 27 '16 at 16:17
  • Yes, unfortunately that is the case. Every supervisor can define his/her own style and force a student to make it like that. Still, i think a student should ask if a generic biblatex style is close enough, which (i hope) will often enough be the case. – Johannes_B Mar 27 '16 at 16:20
  • @moewe Everything works fine, except the option setting giveninits=true in the package biblatex, when I run the code with giveninits=true, error occurs, it said package keyval error: giveninits undefined, how to circumvent this problem? – wayne Mar 28 '16 at 06:43
  • Problem solved: I replace the giveninits=true with firstinits=true, and replace \DeclareNameAlias{default}{family-given} with \DeclareNameAlias{author}{last-first}, and it works well. – wayne Mar 28 '16 at 08:34
  • 1
    @WangyanLi Yes my MWE assumes you are running the most recent version of biblatex, with versions < 3.3 you will have to use firstinits and last-first. Everything else should work fine, though. In a way this is the reverse of Biblatex 3.3 name formatting. – moewe Mar 28 '16 at 09:23
  • one more question: I just found that many title entries in my .bib files are capitalised, which lead a capitalised title output, the desired one is only the first letter of the title is capitalised (as shown in question). How can I come to this by adding one or few commands. – wayne Mar 28 '16 at 13:30
  • 1
    @WangyanLi Add \DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}. But see http://tex.stackexchange.com/q/86043/35864, http://tex.stackexchange.com/q/22980/35864 and http://tex.stackexchange.com/q/20335/35864 – moewe Mar 28 '16 at 14:37
  • @moewe Since I used to the natbib package instead of biblatex package, is there a way to adapt it in the natbib setting? – wayne Oct 05 '16 at 02:32
  • @WangyanLi This answer totally relies on biblatex. If you need a natbib style (a .bst style) you will have to go down a different route altogether. That would certainly warrant a new question. But it is unlikely someone will code the entire .bst for you. – moewe Oct 08 '16 at 16:15