%BibBreeze-authoryear.cbx %Orginally authoryear.cbx from BibLaTeX % Copyright (c) 2006-2011 Philipp Lehman. % 2012-2017 Philip Kime, Audrey Boruvka, Joseph Wright % 2018- Philip Kime, Moritz Wemheuer % % Permission is granted to copy, distribute and/or modify this % software under the terms of the LaTeX Project Public License % (LPPL), version 1.3c. % % This software is provided 'as is', without warranty of any kind, % either expressed or implied, including, but not limited to, the % implied warranties of merchantability and fitness for a % particular purpose. %Modified by [Amir Mohammad Tahsiri], 2025 %Contact: https://github.com/mamadgit/BibBreeze %Modifications: Adjusted authoryear style to correctly support APA (7th edition) in-text citations (lines 23 and 34-55). % This work consists of the files BibBreeze.tex, BibBreeze.bbx, BibBreeze-authoryear.cbx, BibBreeze.dbx, BibBreeze.bib, BibBreeze.def, Instructions-Descriptions.md, README.md and the derived file LICENSE.txt. \ProvidesFile{BibBreeze-authoryear.cbx}[version 1.0] [\abx@cbxid] \ExecuteBibliographyOptions{labeldateparts,uniquename,uniquelist,autocite=inline} \renewcommand*{\iffinalcitedelim}{\iflastcitekey} \newbool{cbx:parens} \renewcommand*{\nameyeardelim}{,\space} % Adds ", " between authors and year \DeclareNameFormat{labelname}{% \ifnumcomp{\value{listtotal}}{>}{2} % More than 2 authors {\ifnumcomp{\value{listcount}}{=}{1} % Only print first author {\namepartfamily% \ifgiveninits {\namepartgiveni} {}% \space et al.}% {}} % Stop after first author {\ifnumcomp{\value{listtotal}}{=}{2} % Exactly 2 authors {\namepartfamily% \ifgiveninits {\namepartgiveni} {}% \ifnumcomp{\value{listcount}}{=}{1} % Add "&" before second author {\space\&\space} {}}% {\namepartfamily% Single author case \ifgiveninits {\namepartgiveni} {}}}% \ifmorenames{\relax}{\relax}} \newbibmacro*{cite}{% \iffieldundef{shorthand} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\usebibmacro{cite:label}% \setunit{\printdelim{nonameyeardelim}}} {\printnames{labelname}% \setunit{\printdelim{nameyeardelim}}}% \usebibmacro{cite:labeldate+extradate}} {\usebibmacro{cite:shorthand}}} \newbibmacro*{textcite}{% \ifnameundef{labelname} {\iffieldundef{shorthand} {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% \printdelim{nonameyeardelim}\bibopenparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:labeldate+extradate}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% \printdelim{nameyeardelim}\bibopenparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{citeyear}}} \newbibmacro*{citeyear}{% \iffieldundef{shorthand} {\iffieldundef{labelyear} {\usebibmacro{cite:label}} {\usebibmacro{cite:labeldate+extradate}}} {\usebibmacro{cite:shorthand}}} \newbibmacro*{cite:shorthand}{% \printtext[bibhyperref]{\printfield{shorthand}}} \newbibmacro*{cite:label}{% \iffieldundef{label} {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}} {\printtext[bibhyperref]{\printfield{label}}}} \newbibmacro*{cite:labeldate+extradate}{% \iffieldundef{labelyear} {} {\printtext[bibhyperref]{\printlabeldateextra}}} \newbibmacro{cite:labelyear+extrayear}{% \blx@warning{bibmacro 'cite:labelyear+extrayear' is deprecated.\MessageBreak Please use 'cite:labeldate+extradate'.\MessageBreak Using 'cite:labeldate+extradate' instead}% \usebibmacro{cite:labeldate+extradate}} \newbibmacro*{textcite:postnote}{% \iffieldundef{postnote} {\ifbool{cbx:parens} {\bibcloseparen} {}} {\ifbool{cbx:parens} {\setunit{\printdelim{postnotedelim}}} {\setunit{\printdelim{extpostnotedelim}\bibopenparen}}% \printfield{postnote}\bibcloseparen}} \DeclareCiteCommand{\cite} {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand*{\cite} {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{citeyear}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\parencite}[\mkbibparens] {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand*{\parencite}[\mkbibparens] {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{citeyear}} {\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\mkbibparens\mkbibfootnote] {\usebibmacro{prenote}} {\usebibmacro{citeindex}% \usebibmacro{cite}} {\multicitedelim} {\usebibmacro{postnote}} \DeclareCiteCommand{\textcite} {\boolfalse{cbx:parens}} {\usebibmacro{citeindex}% \iffirstcitekey {\setcounter{textcitetotal}{1}} {\stepcounter{textcitetotal}% \textcitedelim}% \usebibmacro{textcite}} {\ifbool{cbx:parens} {\bibcloseparen\global\boolfalse{cbx:parens}} {}} {\usebibmacro{textcite:postnote}} \DeclareMultiCiteCommand{\textcites}{\textcite}{} \endinput