0

The traditional reference format can be set by the following command

\documentclass[12pt,openright]{book}
\usepackage[backend = bibtex8, defernumbers = true,  sorting=none, style = numeric]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{bib1.bib}
@ARTICLE{dunbar2006distributed,
author = {Dunbar, William B and Dunbar, William B and Murray, Richard M},
title = {Distributed receding horizon control for multi-vehicle formation
stabilization},
journal = {Automatica},
 year = {2006},
 volume = {42},
pages = {549--558},
number = {4},
publisher = {Elsevier},
}
\end{filecontents}

\addbibresource{bib1.bib}
\renewbibmacro*{name:last-first}[4]{%
\setcounter{liststop}{10}%                             % 列出所有的作者
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
 \usebibmacro{name:hook}{#3#1}%
 \ifblank{#3}{}{%
   \ifcapital
     {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
 {\mkbibnameprefix{#3}\isdot}%
   \ifpunctmark{'}{}{\bibnamedelimc}}%
 \mkbibnamelast{#1}\isdot
 \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
 \ifblank{#2}{}{\addcomma\bibnamedelimd\mkbibnamefirst{#2}\isdot}}
{\usebibmacro{name:delim}{#1}%
 \usebibmacro{name:hook}{#1}%
 \mkbibnamelast{#1}\isdot
 \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
 %     \ifblank{#2#3}{}{\addcomma}%
 \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}%
 \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}
}}

\DeclareNameFormat{default}{%
\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}%
\usebibmacro{name:andothers}%
}
\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibinithyphendelim}{}
\begin{document}
some text \cite{dunbar2006distributed}.
\printbibliography
\end{document}

and the corresponding output shown as: enter image description here Here is the desired output: enter image description here

How can I modify the command to change the '.,' into ',' between authors and eliminate the '.' between surname and first name? Thanks!

  • 2
    Welcome! Please provide us with a minimal working example which we can copy, paste and compile to see the problem. What you describe is not the default behaviour so presumably something in your code is changing it. That might be included in the fragment you've posted, but it is hard to tell when we can't test it to see. – cfr Jan 21 '16 at 03:40
  • \isdot turns a full-stop/period into an abbreviation dot. So the . is still printed just the same but the spacing is likely to be different. – cfr Jan 21 '16 at 03:45
  • would you make it clear, i cannot get what you mean, thank you – mazhengg Jan 21 '16 at 03:50
  • 3
    I don't think you need to dig so deep. Please consider something like using biber and \renewrobustcmd*{\bibinitperiod}{} \renewrobustcmd*{\bibinitdelim}{\addnbspace} (for a non-breaking space between initials). You might need to renew \bibnamedelimi as well. Of course, without a minimal example (or see here), it's often quite hard to give useful advice. – jon Jan 21 '16 at 05:10
  • 4
  • Please do not open a new question to provide an MWE. Just add the MWE to this question here. – moewe Jan 22 '16 at 07:24
  • ok, i edit the question and the MWE is provided. – mazhengg Jan 22 '16 at 07:37
  • 1
    Thanks, I have voted to close the other question, as it is now superfluous. You should consider switching from BibTeX8 to Biber, then you have a more fine-grained control over the delimiters between names (you can then do what jon suggested above). (See How to use Biber and related questions.) – moewe Jan 22 '16 at 08:04
  • is there any other way to solve this question? case the template is compiling with bibtex8. Switching from bibtex8 to biber will cost much more time to modify the other part of thesis. – mazhengg Jan 22 '16 at 08:22
  • 2
    You should really try an use Biber, in your document that will not need more than a change from backend=bibtex8 to backend=biber. If you have a fairly recent system it should not be too hard to install Biber (if necessary), update your system and tell your editor to use Biber. – moewe Jan 22 '16 at 17:58

1 Answers1

2

If you use the Biber backend, things should be as easy as

\renewrobustcmd*{\bibinitperiod}{}
\renewrobustcmd*{\bibinitdelim}{\addnbspace}

as jon points out in the comments, or can be read in Remove periods after author initials, but leave spaces.


If you for the live of you cannot bear to use Biber and want to stick to your BibTeX(-like) backend you will have to hack biblatex.bst.

This approach is really not recommended. You have been warned.

Find biblatex.bst on your system make a copy and move it to your working directory (i.e. the one where your document lives). Open the file and go to FUNCTION {output:write:name:first} (ll. 1136-1151), in the

  ctrl.terseinits
    { "{f{}}" format.name$ }
    { "{f.}"  format.name$
      duplicate$ tempstrga "." * =
        { duplicate$ text.length$ #1 - text.prefix$ }
        'skip$
      if$
    }
  if$

block change { "{f{}}" format.name$ } to { "{f{~}}" format.name$ } so that it reads

  ctrl.terseinits
    { "{f{~}}" format.name$ }
    { "{f.}"  format.name$
      duplicate$ tempstrga "." * =
        { duplicate$ text.length$ #1 - text.prefix$ }
        'skip$
      if$
    }
  if$

Then using terseinits=true, firstinits=true should do what you want

moewe
  • 175,683
  • Thank you so much! I thought i compile with biber yesterday, actually i just change the 'bibtex8' to 'biber' in the *.tex, my editor use bibtex as before, then the output cannot show the bibliography. That make me doubt that this way need more change to work. In a word, thanks, and thanks to tell your editor to use Biber. – mazhengg Jan 23 '16 at 01:34