This is also quite easy to do. I'm assuming that the doi
and url
fields trump the publisher
and location
field, so the way to implement this is to only print these fields if the doi
and url
fields are undefined. So we add the following:
\renewbibmacro*{location+publisher}{%
\iffieldundef{doi}{
\iffieldundef{url}{
\printlist{location}%
\setunit*{\addcolon\space}%
\printlist{publisher}%
\newunit}{}}{}
}
I must say that I find this an odd rule on the APA's part: publisher and location are usually only printed with books, and in my opinion the publisher is an important piece of information that has very little to do with "source" information, and more to do with e.g. providing information about the reliability of the source. If a book is published by a major university press that fact tells me a lot compared to if the publisher is "Joe's Spiralbound Book Barn". Somehow just having a doi
doesn't help with that.
Here's a sample document with three bib entries with different amounts of source information included.
\documentclass[endnotes]{apa6e}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\title{A title}
\author{An Author}
\shorttitle{A title}
\authornote{}
\abstract{An abstract}
\begin{filecontents}{\jobname.bib}
@book{Chomsky1981,
Address = {Dordrecht},
Author = {Noam Chomsky},
Booktitle = {Lectures on Government and Binding},
Publisher = {Foris Publications},
Title = {Lectures on Government and Binding},
Url = {http://url.url.url},
Year = {1981}}
@book{Chomsky1986,
Address = {Cambridge, MA},
Author = {Chomsky, Noam},
Booktitle = {Barriers},
Doi = {http://doi.doi.doi},
Publisher = {{MIT} Press},
Title = {Barriers},
Url = {http://url.url.url},
Year = {1986}}
@book{Chomsky1982,
Address = {Cambridge, MA},
Author = {Noam Chomsky},
Booktitle = {Some Concepts and Consequences of the Theory of Government and Binding},
Publisher = {{MIT} Press},
Title = {Some Concepts and Consequences of the Theory of Government and Binding},
Year = {1982}}
\end{filecontents}
\addbibresource{\jobname.bib}
\renewbibmacro*{location+publisher}{%
\iffieldundef{doi}{
\iffieldundef{url}{
\printlist{location}%
\setunit*{\addcolon\space}%
\printlist{publisher}%
\newunit}{}}{}
}
\begin{document}
\begin{itemize}
\item An entry with Publisher and URL: \cite{chomsky1981}
\item An entry with only Publisher. \cite{chomsky1982}
\item An entry with Publisher, DOI and URL: \cite{chomsky1986}
\end{itemize}
\urlstyle{rm}
\printbibliography
\end{document}
For the original question, the modification required is:
\renewbibmacro*{title}{%
\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}%
\setunit{\addspace}%
\printfield{titleaddon}%
\iffieldequalstr{entrytype}{book}%
{\setunit{\addspace}\usebibmacro{bookaddinfo}}%
{}%
\ifthenelse{%
\ifnameundef{author}\AND%
\(\ifnameundef{editor}\AND\NOT\boolean{bbx:editorinauthpos}\)\AND%
\ifnameundef{producer}\AND%
\ifnameundef{director}\AND%
\ifnameundef{writer}}
{\newunit\newblock
\usebibmacro{labelyear+extrayear}}
{}}}
\DeclareFieldFormat{origyear}{%
\mkbibparenss{\bibcpstring{origyear}~\thefield{origyear}%
\iffieldundef{origtitle}
{}%
{\addcolon\addspace\printfield{origtitle}}}%
}
\newbibmacro*{origyear}{%
\ifthenelse{
\NOT\iffieldundef{labelyear}
\AND\NOT\iffieldsequal{labelyear}{origyear}
\OR
\NOT\iffieldsequal{title}{origtitle}}
{\printfield{origyear}}
{}%
}
\DefineBibliographyStrings{german}{%
origyear = {Original erschienen}
}
This can be inserted in the preamble of your document.
For the extended version one has either to introduce new fields (this can be done,by modifying the data model, or by using the BibLaTeX facilities for related
).
EDIT 1 and EDIT 2
To accommodate the case where the author of the original publication is different the first step is to modify the data model, this can be done with:
\begin{filecontents}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=list, datatype=name,skipout=false]{origauthor}
\DeclareDatamodelEntryfields{origauthor}
\end{filecontents}
This generates a file called biblatex-dm.cfg
in the current directory with the instruction about how to extend BibLaTeX data model.
Notice that BibLaTeX provides a titleaddon
field and this could be used to the extra information for the title ("Die Liebe" in the OP).
Eventually, one could add a field titletranslation
for the selfmade translation, i.e., one can include the following two lines in the datamodel file.
\DeclareDatamodelField[type=field, datatype=literal,skipout=false]{titletranslation}
\DeclareDatamodelEntryfields{titletranslation}
Another possibility is to use an "unused" field, for example, reprinttitle
. In what follow I'm going to use this option.
The next step is to modify the appropriate bibmacro
s. In this case, title
and origyear
for the formatting of the title (and related information about the original publication)
\renewbibmacro*{title}{%
\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}}
{}
{\printtext[title]{%
\printfield[apacase]{title}%
\setunit{\subtitlepunct}%
\printfield[apacase]{subtitle}}%
\setunit{\addspace}%
\printfield{titleaddon}%
\setunit{\addspace}%
\printfield{reprinttitle}%
\iffieldequalstr{entrytype}{book}%
{\setunit{\addspace}\usebibmacro{bookaddinfo}}%
{}%
\ifthenelse{%
\ifnameundef{author}\AND%
\(\ifnameundef{editor}\AND\NOT\boolean{bbx:editorinauthpos}\)\AND%
\ifnameundef{producer}\AND%
\ifnameundef{director}\AND%
\ifnameundef{writer}}
{\newunit\newblock
\usebibmacro{labelyear+extrayear}}
{}}}
For originyear
the first thing to do is to define the format. To this we check that originauthor
is defined, and we set the punctuation accordingly:
\DeclareFieldFormat{origyear}{%
\mkbibparens{\bibcpstring{origyear}~\thefield{origyear}%
\ifnameundef{origauthor}
{}
{\addspace\bibstring{as}\addspace\printnames[FirstLast]{origauthor}}%
\iffieldundef{origtitle}
{}%
{\ifnameundef{origauthor}
{\setunit{\addcolon\addspace}}
{\setunit{\addcomma\addspace}}%
\printfield{origtitle}}}%
}
Then we have to consider the cases when we have to output the information about the original publication (here the condition is that either the year, or the title, or the author(s) is different).
\renewbibmacro*{origyear}{%
\ifthenelse{
\NOT\iffieldsequal{labelyear}{origdateyear}
\OR
\NOT\iffieldsequal{title}{origtitle}
\OR
\NOT\ifnamesequal{author}{origauthor}
}
{\printfield{origyear}}
{}%
}
Caveat A problem with the above solution is that not all bib entry types include instructions to format the information about the original publication using the above method. A more robust technique would be to use the facilities provided by BibLaTeX to handle related publications.
The last step is to use the appropriate value for the localisation strings origyear
and as
.
\NewBibliographyString{origyear,as}
\DefineBibliographyStrings{ngerman}{%
origyear = {Original erschienen},
as = {als}
}
\DefineBibliographyStrings{american}{%
as = {as}
}
Finally, to change the rendering of names, we have to modify the formatting instructions for apaauthor
\DeclareNameFormat{FirstLast}{%
\ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}}
{\addcomma\addspace\ldots}
{\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
{}
{\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}}
\ifmorenames{\andothersdelim\bibstring{andothers}}{}}
Best Answer
OPTION #1: using a modified
.bst
fileFirst of all, from the command line, run
to know where the file
apacite.bst
is. Its path should beTEXMF/bibtex/bst/apacite/
.Now copy
apacite.bst
in the directory where your.tex
file is, and rename it tomyapacite.bst
.Then open
myapacite.bst
in your editor, search for the linesand replace them with
Then search for the lines
and replace them with
Save the file.
Now in your document, replace
with
and you're done.
MWE
Output:
Note that you have
in your MWE, but it should be
unless your
.bib
file is namedsources.bib.bib
....OPTION #2: using
biblatex-apa
Using
biblatex
with theapa
style, thetype
field isn't printed by default.Here's your MWE modified for using
biblatex
:Output: