von MoeWe » Mo 25. Apr 2022, 21:20
Das bekommst Du hin, indem Du auch für diese Aufgabe die passenden
field formats nimmst, anstatt die Zeichensetzung direkt im Bibmakro vorzunehmen.
Im Vergleich zu meinem vorherigen Minimalbeispiel brauchen wir nur vier Zeilen mehr
\documentclass[a4paper,11pt,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,csquotes}
\usepackage[
style=verbose-trad3,
citepages=separate,
]{biblatex}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
\makeatletter
\DeclareNameWrapperFormat{shortauthor}{\mkbibparens{#1}}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{author}%
\setunit{\addspace}%
\printnames{shortauthor}%
\setunit{\printdelim{authortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\DeclareNameWrapperFormat{shorteditor}{\mkbibparens{#1}}
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\addspace}%
\printnames{shorteditor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}}
{\global\undef\bbx@lasthash}}
\makeatother
\begin{filecontents}{\jobname.bib}
@book{Institut2022,
editor = {{Institut mit einem sehr langen Namen}},
shorteditor = {Institut},
title = {Titel},
address = {Berlin},
year = {2022},
}
@book{Mustermann2022,
author = {Mustermann, Max},
shortauthor = {MM},
title = {Titel},
address = {Berlin},
year = {2022},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Ich zitiere etwas.\autocite[15]{Institut2022}
Hier zitiere ich etwas anderes.\autocite[234]{Mustermann2022}
Hier wuerde ich gerne dass \enquote{Institut 2022} zitiert wird.\autocite[15]{Institut2022}
Hier mal wieder etwas mit einem Shortauthor.\autocite[234]{Mustermann2022}
Im Literaturverzeichnis sollte dann \enquote{Shorteditor (editor)}
bzw. \enquote{Shortauthor (author)} angegeben werden.
\printbibliography
\end{document}
Das bekommst Du hin, indem Du auch für diese Aufgabe die passenden [i]field formats[/i] nimmst, anstatt die Zeichensetzung direkt im Bibmakro vorzunehmen.
Im Vergleich zu meinem vorherigen Minimalbeispiel brauchen wir nur vier Zeilen mehr
[code]
\documentclass[a4paper,11pt,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel,csquotes}
\usepackage[
style=verbose-trad3,
citepages=separate,
]{biblatex}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
\makeatletter
\DeclareNameWrapperFormat{shortauthor}{\mkbibparens{#1}}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{author}%
\setunit{\addspace}%
\printnames{shortauthor}%
\setunit{\printdelim{authortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\DeclareNameWrapperFormat{shorteditor}{\mkbibparens{#1}}
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\addspace}%
\printnames{shorteditor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}}
{\global\undef\bbx@lasthash}}
\makeatother
\begin{filecontents}{\jobname.bib}
@book{Institut2022,
editor = {{Institut mit einem sehr langen Namen}},
shorteditor = {Institut},
title = {Titel},
address = {Berlin},
year = {2022},
}
@book{Mustermann2022,
author = {Mustermann, Max},
shortauthor = {MM},
title = {Titel},
address = {Berlin},
year = {2022},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Ich zitiere etwas.\autocite[15]{Institut2022}
Hier zitiere ich etwas anderes.\autocite[234]{Mustermann2022}
Hier wuerde ich gerne dass \enquote{Institut 2022} zitiert wird.\autocite[15]{Institut2022}
Hier mal wieder etwas mit einem Shortauthor.\autocite[234]{Mustermann2022}
Im Literaturverzeichnis sollte dann \enquote{Shorteditor (editor)}
bzw. \enquote{Shortauthor (author)} angegeben werden.
\printbibliography
\end{document}
[/code]