Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation in tables/figures do not comply to specific APA style rule #248

Open
mgkurtz opened this issue Oct 29, 2024 · 0 comments
Open

Citation in tables/figures do not comply to specific APA style rule #248

mgkurtz opened this issue Oct 29, 2024 · 0 comments

Comments

@mgkurtz
Copy link

mgkurtz commented Oct 29, 2024

Section 8.17 of the APA style requires

In tables and figures, use an ampersand between names in both parenthetical and narrative citations.

(I guess this excludes captions, at least this seems sensible and the example copyright attribution of Table 7.14 of the APA style manual spells out “[…], and M. Schaller”, likewise the copyright attribution in Figure 7.3.)

To comply with this rule, I imagine a new \tablecite command and have \textcite use it automatically if inside a table or figure.

For \tablecite, I copy pasted and edited \parencite to come up with this:

\DeclareDelimFormat[tablecite]{finalnamedelim}
  {\ifnum\value{liststop}>2 \finalandcomma\fi\addspace\&\space}
\DeclareCiteCommand{\tablecite}
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}%
   \usebibmacro{cite:post}}
  {}
  {\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\tablecites}{\tablecite}
  {\setunit{\multicitedelim}}
\DeclareCiteCommand*{\tablecite}[\mkbibparens]
  {\usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{citeyear}%
   \usebibmacro{cite:post}}
  {}
  {\usebibmacro{postnote}}

Concerning recognition of tables and figures, setting a switch in a local scope should work:

\newif\ifintable
\AddToHook{env/table/begin}{\intabletrue}
\AddToHook{env/figure/begin}{\intabletrue}
\AddToHook{cmd/@makecaption/before}{\intablefalse}

I also asked on TeX Stack Exchange to get feedback whether this approach works in setups using various kinds of packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant