2

I'm writing a document that cites emails, and I'm trying to use a .bib file to manage the emails that I cite.

How can I modify the cite commands \citet{Smith:2023aa} or \citep{Smith:2023aa}, or how can I create a custom cite command, to produce in-line citations that appear as "Smith (February 28, 2023)" or "(Smith, February 28, 2023)" in my document?

I am not picky about the specific formatting of the date shown in the document, so long as day, month, and year are shown in-line.

MWE:

\documentclass{article}

\begin{filecontents*}{\jobname.bib}
@misc{Smith:2020aa,
    title = {Subject: Minimum Working Example}
    author = {John Smith},
    date = {2020-02-28}
  }
\end{filecontents*}


\usepackage[
      style=apa,
      labeldate=comp, 
      dateabbrev= false,
      natbib,
      backend=biber,
    ]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

\citet{Smith:2020aa}

\printbibliography

\end{document}

Thanks for your advice on this!

1 Answer 1

1

Here I created \citewithdatep, that prints (Author, Month Day, Year), and \citewithdatet, that prints Author (Month Day, Year):

\documentclass{article}

\begin{filecontents*}{\jobname.bib}
@misc{Smith:2020aa,
    title = {Subject: Minimum Working Example},
    author = {John Smith},
    date = {2020-02-28}
  }
\end{filecontents*}

\usepackage[
    style=apa,
    labeldate=comp, 
    dateabbrev= false,
    natbib,
    backend=biber,
    ]{biblatex}

\DeclareCiteCommand{\citewithdatep}
  {\boolfalse{citetracker}% 
   \boolfalse{pagetracker}}
  {\mkbibparens{%
      \printnames{labelname}% 
      \addcomma\addspace%
      \printfield{month}%
      \addspace%
      \printfield{day}%
      \addcomma\addspace%
      \printfield{year}%
      }%
  }
  {\multicitedelim}
  {}

\DeclareCiteCommand{\citewithdatet}
  {\boolfalse{citetracker}% 
   \boolfalse{pagetracker}}
  {\printnames{labelname}% 
   \addspace%
   \mkbibparens{%
      \printfield{month}%
      \addspace%
      \printfield{day}%
      \addcomma\addspace%
      \printfield{year}%
      }%
  }
  {\multicitedelim}
  {}  
\addbibresource{\jobname.bib}

\begin{document}

This is an email citation in the format (Author, Month Day, Year):

\citewithdatep{Smith:2020aa}

This is an email citation in the format Author (Month Day, Year):

\citewithdatet{Smith:2020aa}

This is an ordinary citation
\citet{Smith:2020aa}

\printbibliography

\end{document}

enter image description here

2
  • Thank you, this is perfect!
    – RMM
    May 6, 2023 at 8:42
  • @RMM You're welcome, and thank you for accepting my answer.
    – CarLaTeX
    May 6, 2023 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .