von Martin86 » Do 8. Mai 2014, 11:29
Danke für den Hinweis. Ich habe mal ein Minimalbeispiel zusammengeschrieben.
Dabei werden die neue bbx und die neue cbx auf der Grundlage des alphabetic stils erstellt.
Ich möchte die beiden Dateien jetzt so manipulieren, dass die oben angebene Form realisiert wird.
Für die Shorthands im Text ist dies ja schon fast der Fall. Lediglich bei vier oder mehr Autoren sollen nur drei Autoren angeben werden. Anstelle von [Eri+14] soll also [ESM14] erscheinen, wobei im Literaturverzeichnis dennoch alle Autoren aufgeführt werden.
Ich hoffe das ist einigermaßen verständlich.
% das Papierformat zuerst
\documentclass[a4paper, 11pt]{article}
% deutsche Silbentrennung
\usepackage[ngerman]{babel}
% wegen deutschen Umlauten
\usepackage[ansinew]{inputenc}
% Erstellen der neuen bbx
\begin{filecontents}{FCB.bbx}
\ProvidesPackage{FCB}[2014/05/08 Beispiel]
\ProcessOptions\relax
\ProvidesFile{FCB.bbx}
[\abx@bbxid]
\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelalpha,sorting=anyt}
\DeclareNameAlias{author}{default}
\DeclareNameAlias{editor}{default}
\DeclareNameAlias{translator}{default}
\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext[labelalphawidth]{%
\printfield{prefixnumber}%
\printfield{labelalpha}%
\printfield{extraalpha}}}
{\setlength{\labelwidth}{\labelalphawidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{##1\hss}}
{\endlist}
{\item}
\defbibenvironment{shorthands}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{##1\hss}}}
{\endlist}
{\item}
\endinput
\end{filecontents}
% Erstellen der neuen cbx
\begin{filecontents}{FCB.cbx}
\ProvidesPackage{FCB}[2014/05/08 Beispiel]
\ProcessOptions\relax
\ProvidesFile{FCB.cbx}
[\abx@cbxid]
\ExecuteBibliographyOptions{labelalpha,autocite=inline}
\newbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelalpha}%
\printfield{extraalpha}}}
\newbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\multicitedelim}
{\cbx@tempa
\ifnameundef{labelname}
{}
{\printnames{labelname}\space}%
\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite}%
\savefield{namehash}{\cbx@lasthash}%
\gdef\cbx@tempa{\bibclosebracket\multicitedelim}}
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\parencite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\textcite}
{\let\cbx@tempa=\empty
\undef\cbx@lasthash}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\usebibmacro{postnote}%
\bibclosebracket}
\DeclareMultiCiteCommand{\cites}[\mkbibbrackets]{\cite}{\multicitedelim}
\DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}{\multicitedelim}
\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbrackets\mkbibfootnote]{\smartcite}{\multicitedelim}
\endinput
\end{filecontents}
\begin{filecontents}{Literatur.bib}
@book{Eric.2014,
author = {{Eric Kantonar}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Sven.2014,
author = {{Eric Kantonar} and {Sven Mueller}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Max.2014,
author = {{Eric Kantonar} and {Sven Mueller} and {Max Schumacher}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Sami.2014,
author = {{Eric Kantonar} and {Sven Mueller} and {Max Schumacher} and {Sami Khedira}},
year = {2014},
title = {Fussball},
address = {Kueln},
publisher = {FCB}
}
\end{filecontents}
% fuer Zitate
\usepackage[backend = bibtex8,
citestyle = FCB, % authoryear, verbose, alphabetic
bibstyle = FCB] % authoryear, verbose, alphabetic
{biblatex}
\bibliography{Literatur}
\begin{document}
Nur ein Autor \cite{Eric.2014} \newline
Zwei Autoren \cite{Sven.2014} \newline
Drei Autoren \cite{Max.2014} \newline
Vier Autoren \cite{Sami.2014} \newline
% Literaturliste anzeigen
\printbibliography
\end{document}
Danke für den Hinweis. Ich habe mal ein Minimalbeispiel zusammengeschrieben.
Dabei werden die neue bbx und die neue cbx auf der Grundlage des alphabetic stils erstellt.
Ich möchte die beiden Dateien jetzt so manipulieren, dass die oben angebene Form realisiert wird.
Für die Shorthands im Text ist dies ja schon fast der Fall. Lediglich bei vier oder mehr Autoren sollen nur drei Autoren angeben werden. Anstelle von [Eri+14] soll also [ESM14] erscheinen, wobei im Literaturverzeichnis dennoch alle Autoren aufgeführt werden.
Ich hoffe das ist einigermaßen verständlich.
[code]
% das Papierformat zuerst
\documentclass[a4paper, 11pt]{article}
% deutsche Silbentrennung
\usepackage[ngerman]{babel}
% wegen deutschen Umlauten
\usepackage[ansinew]{inputenc}
% Erstellen der neuen bbx
\begin{filecontents}{FCB.bbx}
\ProvidesPackage{FCB}[2014/05/08 Beispiel]
\ProcessOptions\relax
\ProvidesFile{FCB.bbx}
[\abx@bbxid]
\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelalpha,sorting=anyt}
\DeclareNameAlias{author}{default}
\DeclareNameAlias{editor}{default}
\DeclareNameAlias{translator}{default}
\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{#1}}
\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}}
\defbibenvironment{bibliography}
{\list
{\printtext[labelalphawidth]{%
\printfield{prefixnumber}%
\printfield{labelalpha}%
\printfield{extraalpha}}}
{\setlength{\labelwidth}{\labelalphawidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{##1\hss}}
{\endlist}
{\item}
\defbibenvironment{shorthands}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{##1\hss}}}
{\endlist}
{\item}
\endinput
\end{filecontents}
% Erstellen der neuen cbx
\begin{filecontents}{FCB.cbx}
\ProvidesPackage{FCB}[2014/05/08 Beispiel]
\ProcessOptions\relax
\ProvidesFile{FCB.cbx}
[\abx@cbxid]
\ExecuteBibliographyOptions{labelalpha,autocite=inline}
\newbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelalpha}%
\printfield{extraalpha}}}
\newbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\multicitedelim}
{\cbx@tempa
\ifnameundef{labelname}
{}
{\printnames{labelname}\space}%
\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite}%
\savefield{namehash}{\cbx@lasthash}%
\gdef\cbx@tempa{\bibclosebracket\multicitedelim}}
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\parencite}[\mkbibbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\textcite}
{\let\cbx@tempa=\empty
\undef\cbx@lasthash}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\usebibmacro{postnote}%
\bibclosebracket}
\DeclareMultiCiteCommand{\cites}[\mkbibbrackets]{\cite}{\multicitedelim}
\DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}{\multicitedelim}
\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbrackets\mkbibfootnote]{\smartcite}{\multicitedelim}
\endinput
\end{filecontents}
\begin{filecontents}{Literatur.bib}
@book{Eric.2014,
author = {{Eric Kantonar}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Sven.2014,
author = {{Eric Kantonar} and {Sven Mueller}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Max.2014,
author = {{Eric Kantonar} and {Sven Mueller} and {Max Schumacher}},
year = {2014},
title = {Fussball},
address = {Koeln},
publisher = {FCB}
@book{Sami.2014,
author = {{Eric Kantonar} and {Sven Mueller} and {Max Schumacher} and {Sami Khedira}},
year = {2014},
title = {Fussball},
address = {Kueln},
publisher = {FCB}
}
\end{filecontents}
% fuer Zitate
\usepackage[backend = bibtex8,
citestyle = FCB, % authoryear, verbose, alphabetic
bibstyle = FCB] % authoryear, verbose, alphabetic
{biblatex}
\bibliography{Literatur}
\begin{document}
Nur ein Autor \cite{Eric.2014} \newline
Zwei Autoren \cite{Sven.2014} \newline
Drei Autoren \cite{Max.2014} \newline
Vier Autoren \cite{Sami.2014} \newline
% Literaturliste anzeigen
\printbibliography
\end{document}
[/code]