0

Referring to my previous question I now try to solve the problem with the missing editor for a proceeding or inproceeding entry. So if I write the command \noeditor into the field editor one should get the result s.ed. without the additional , ed. for the proceeding enty and without the Ed. by. for the inproceeding entry.

I've manage to find the editor+otherstring bibmacro in the *.bbx file. However, I'm not sure if I need to edit this bibmacro or if there is an easier way allowing me to switch the bib style without editing the bibmacro of each style?

MWE:

\documentclass{article}
\usepackage[backend=biber,style=alphabetic, autocite=footnote]{biblatex}


\begin{filecontents*}{bibliography.bib}
% Example for no editor
@Proceedings{10,
    title                       = {Proceedings of the 1st International Conference on sth},
    year                        = {2010},
    publisher               = {A Publisher},
    editor                  =   {\noeditor},
    venue                       = {London, England},
    eventdate               = {2010-01-01/2010-01-03},
    eventtitle          = {1st International Conference on sth}
}
@Inproceedings{XY10,
 crossref                   = {10},
 author                     = {LastName, FirstName and Lastname2, FirstName2},
 title                      = {Some nice title},
 pages                      = {10--20},
 bookpagination     = {page}
}
\end{filecontents*}


\addbibresource{bibliography.bib}
\nocite{*} 

\begin{document}
\null
\vfill

\printbibliography
\end{document}
user2653422
  • 2,333
  • Mhhh, in your MWE I obviously get the error that \noeditor is undefined. If I take all the code in cfr's answer (that is the redefinitions of editor and editor+others as well) and add your example entries above to the test database entries there, there is no superfluous comma. Everything seems fine. So maybe I'm missing something? Anyway, I only noticed that after I had conjured up my competing approach you find in the answer below. – moewe Dec 13 '15 at 16:46

1 Answers1

1

You can try the following which will always write "S.ed." if you are missing the editor field (and useeditor is turned on: compare and contrast britannica and 10 in the MWE below).

Just like cfr we have

\NewBibliographyString{noeditor}
\DefineBibliographyStrings{english}{%
  noeditor      =   {s\adddot ed\adddot},
}

But then

\renewbibmacro*{editor+others}{%
  \ifuseeditor
    {\ifnameundef{editor}
      {\bibstring{noeditor}}
      {\printnames{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{editor+othersstrg}%
       \clearname{editor}}}
    {}}

\renewbibmacro*{editor}{%
  \ifuseeditor
    {\ifnameundef{editor}
      {\bibstring{noeditor}}
      {\printnames{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{editorstrg}%
       \clearname{editor}}}
    {}}

print noeditor when there is no editor.

MWE

\documentclass{article}
\usepackage[backend=biber,style=alphabetic, autocite=footnote]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
% Example for no editor
@Proceedings{10,
  title      = {Proceedings of the 1st International Conference on sth},
  year       = {2010},
  publisher  = {A Publisher},
  venue      = {London, England},
  eventdate  = {2010-01-01/2010-01-03},
  eventtitle = {1st International Conference on sth},
}
@Inproceedings{XY10,
  crossref  = {10},
  author    = {LastName, FirstName and Lastname2, FirstName2},
  title     = {Some nice title},
  pages     = {10--20},
}
@collection{britannica,
  editor       = {Preece, Warren E.},
  title        = {The {New Encyclop{\ae}dia Britannica}},
  date         = 2003,
  edition      = 15,
  volumes      = 32,
  publisher    = {Encyclop{\ae}dia Britannica},
  location     = {Chicago, Ill.},
  options      = {useeditor=false},
  label        = {EB},
}
\end{filecontents*}


\addbibresource{\jobname.bib}
\nocite{*} 

\NewBibliographyString{noeditor}
\DefineBibliographyStrings{english}{%
  noeditor      =   {s\adddot ed\adddot},
}


\renewbibmacro*{editor+others}{%
  \ifuseeditor
    {\ifnameundef{editor}
      {\bibstring{noeditor}}
      {\printnames{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{editor+othersstrg}%
       \clearname{editor}}}
    {}}

\renewbibmacro*{editor}{%
  \ifuseeditor
    {\ifnameundef{editor}
      {\bibstring{noeditor}}
      {\printnames{editor}%
       \setunit{\addcomma\space}%
       \usebibmacro{editorstrg}%
       \clearname{editor}}}
    {}}


\begin{document}
\printbibliography
\end{document}

example bibliography

moewe
  • 175,683
  • Thank you. I get warnings from biblatex that the Bibliography string 'noeditor' is undefined. I've entered everything like you did in your example. Have I missed sth.? – user2653422 Dec 13 '15 at 17:43
  • @user2653422 The MWE I posted does not have this problem on my machine, I can assure you. Did you really copy and paste that? Do you maybe have an outdated version of biblatex? Do you get any other warnings or errors? Are you perchance writing in another language than English? – moewe Dec 13 '15 at 18:12
  • Ok if I only use your MWE it works. I've copied your MWE into my workspace where I have lots of other files. So I think I need to figure out where the clash is. – user2653422 Dec 13 '15 at 18:32
  • @user2653422 Mhhh, without seeing the code you tried it is of course just guesswork, but you might be missing the \NewBibliographyString{noeditor} \DefineBibliographyStrings{english}{% noeditor = {s\adddot ed\adddot}, } bit. Note that if you don't write in English, but in, say, Spanish you need \DefineBibliographyStrings{spanish}. If the problem persist, try to narrow it down by producing an MWE of the non-working solution. – moewe Dec 14 '15 at 07:19
  • @user2653422 Ah, yes, you will have to define the necessary BibliographyStrings for all the languages you use in your document. – moewe Dec 15 '15 at 07:25
  • One more thing. Is it possible to prevent biblatex from automatic capitalizing the s of the s.ed.? I've tried putting { and } around the s, but this is ignored. – user2653422 Dec 17 '15 at 21:31
  • 1
    @user2653422 Try putting an empty group {} in front of the s: noeditor = {{}s\adddot ed\adddot}. – moewe Dec 18 '15 at 07:43