von joe360 » Mi 12. Feb 2025, 01:06
Hi Leute,
hatte jetzt ähnliches Problem, erstmal Danke an MoeWe.
Ich schreibe in der article class, Latex in overleafe.
Und nutze \usepackage[style=apa,backend=biber,sortcites,url=true,uniquename=false]{biblatex}.
Damit im Text keine eckige Klammer ist und im Lit.Verzeichnis die Klammer beim Shortauthor da ist, habe ich den Code (trial/error) angepasst. (Dash und Formatierung ebenfalls entfernt).
Code:
%% Code1 für LitVerzeichnis
\makeatletter
\DeclareNameWrapperFormat{shortauthor}{%
\ifbibliography % Prüft ob das Literaturverzeichnis kompiliert wird -->
{\mkbibparens{#1}} % --> Falls ja, setze runde Klammern um den shortauthor -->
{#1} % --> Falls nicht (d.h. im Text), setze den shortauthor im Text ohne Klammer, da sonst %%eine Eckige Klammer entsteht, wegen doppelklammer: 1(XY, 2020) / 2((XY),2020) --> %%([XY],2020) wir wollen im Text Nr. 1
}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\printnames{author}%
\setunit{\addspace}%
\printnames{shortauthor}%
\setunit{\printdelim{authortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\makeatother
%% Code2 für in Text
\makeatletter
\def\cbx@apa@ifnamesaved{\@firstoftwo}
\makeatother
Hi Leute,
hatte jetzt ähnliches Problem, erstmal Danke an MoeWe.
Ich schreibe in der article class, Latex in overleafe.
Und nutze \usepackage[style=apa,backend=biber,sortcites,url=true,uniquename=false]{biblatex}.
Damit im Text keine eckige Klammer ist und im Lit.Verzeichnis die Klammer beim Shortauthor da ist, habe ich den Code (trial/error) angepasst. (Dash und Formatierung ebenfalls entfernt).
Code:
%% Code1 für LitVerzeichnis
\makeatletter
\DeclareNameWrapperFormat{shortauthor}{%
\ifbibliography % Prüft ob das Literaturverzeichnis kompiliert wird -->
{\mkbibparens{#1}} % --> Falls ja, setze runde Klammern um den shortauthor -->
{#1} % --> Falls nicht (d.h. im Text), setze den shortauthor im Text ohne Klammer, da sonst %%eine Eckige Klammer entsteht, wegen doppelklammer: 1(XY, 2020) / 2((XY),2020) --> %%([XY],2020) wir wollen im Text Nr. 1
}
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\printnames{author}%
\setunit{\addspace}%
\printnames{shortauthor}%
\setunit{\printdelim{authortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{authorstrg}}
{\global\undef\bbx@lasthash}}
\makeatother
%% Code2 für in Text
\makeatletter
\def\cbx@apa@ifnamesaved{\@firstoftwo}
\makeatother