ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Enable interaction on custom apa cite variant
@ 2023-08-19 13:44 Jethro Djan
  0 siblings, 0 replies; only message in thread
From: Jethro Djan @ 2023-08-19 13:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1802 bytes --]

Hi,

I would like a variant of cite per the APA specification that removes the
bracket when quoted in mathematical definitions, theorems, etc. I could of
course do it manually for reach using right= and left= but I didn't want to
do it every time. I have come up with this MWE:

\startbuffer[ref]
@book{burago2022course,
  title={A course in metric geometry},
  author={Burago, Dmitri and Burago, Yuri and Ivanov, Sergei},
  volume={33},
  year={2022},
  publisher={American Mathematical Society}
}
\stopbuffer

\setupinteraction[state=start, color=blue]
\setupcolors[state=start]

\usebtxdataset[ref.buffer]

\usebtxdefinitions[apa]
\definebtx
    [apa:cite:theorem]
    [apa:cite]
\startsetups btx:apa:cite:theorem
    \btxflushauthorname{author}
    \btxcomma
    \btxflush{year}
    \fastsetup{btx:cite:righttext}
\stopsetups

\setupenumeration[
  before={\blank[medium]},
  after={\blank[medium]},
  alternative=serried,
  right=,
  headcommand=\groupedcommand{}{.},
  distance=0.5em,
  width=fit,
  headstyle=bold,
  titlestyle=bold,
  way=bytext,
  conversion=numbers,
  prefix=chapter,
  list=all,
  title=yes,
  indentnext=no,
]

\defineenumeration[definition][
  text=Defintion,
  style=normal,
  number=no,
]

\starttext

\startdefinition{\cite[righttext={{ p.\nbsp 1}},
alternative=theorem][burago2022course]}

This is something

\stopdefinition

\startsubject[title={References}]
    \placelistofpublications
\startsubject

\stoptext

The problem with this is that the citation is not interactive like it would
be if I used apa:cite:authoryear and just removed the parentheses in the
options. How do I get it to highlight blue and be interactive like the
default behaviour when you turn on interaction? Also this is probably
overkill so if there is a better way to achieve this...

Jethro

[-- Attachment #1.2: Type: text/html, Size: 2160 bytes --]

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-19 13:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-19 13:44 [NTG-context] Enable interaction on custom apa cite variant Jethro Djan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).