8

I am currently porting a large document to use biblatex-apa. Everything is finally getting into place, but I've now realized that to get correct APA citations I should use \parencite instead of \cite.

I really don't want to replace the citations throughout the entire document, especially when every other day they will change the reference manager backend.

Is there an easy way to simply reinterpret \cite with \parencite everywhere in the document?

glopes
  • 355
  • 3
    You could \let\cite\parencite, but I'm not too fond of that. Why don't you just search and replace \cite and \parencite in your editor? That should be a thing of 30 secs tops in most modern editors. And it can easily be undone by the opposite replacement. – moewe Sep 29 '16 at 12:29
  • \let\cite\parencite is great. Honestly, the reason is this is a version controlled document that will be parsed and reinterpreted by multiple backends (i.e. both biber and bibtex) on a regular basis. There is a big desire in this case to have a single cite command. The document is quite big. – glopes Sep 29 '16 at 12:33
  • Mhhh, OK, maybe then the \autocite thing is more relevant than I thought. – moewe Sep 29 '16 at 12:42
  • 2
    Just curious, what does the backend have to do with the choice of \cite or \parencite? – Torbjørn T. Sep 29 '16 at 12:42
  • @TorbjørnT. My question exactly ;-) why should it? Unfortunately a citation with biblatex-apa does not place the required parenthesis surrounding the citation, for some reason. I have searched quite extensively and the best suggestion I got was to use \parencite. – glopes Sep 29 '16 at 12:48
  • So why not find&replace all \cite to \parencite? And what does that have to do with bibtex vs. biber? Do you get the correct citations with one, but not the other? – Torbjørn T. Sep 29 '16 at 12:52
  • \cite produces correct citations using apacite+bibtex. \parencite is required to produce the same citation format with biblatex-apa+biber. If the solution is going to be find and replace anyway, I still prefer the redefinition answer, since at least it gets written somewhere in the preamble file and doesn't exist only in a human user's head. You could batch script, but then again isn't that exactly the same as simply redefining the command in the preamble? Seems like a lot of pain for no gain. – glopes Sep 29 '16 at 13:24
  • Ah, I thought you were just changing the backend of biblatex (it can be used with bibtex as well), not replacing biblatex altogether. – Torbjørn T. Sep 29 '16 at 13:42
  • This is probably because biblatex has slightly more rigid system when it comes to naming the cite commands. \cite normally does not have brackets (even if the style guide requires this for 'normal' citations), \parencite always has (some kind) of brackets. BibTeX styles might not be that rigid here. – moewe Sep 29 '16 at 14:11

1 Answers1

8

You could

\let\cite\parencite

but I'm not too fond of that, in fact I cringe every time I have to see this. Normally \letting around commands willy-nilly might have (unforeseeable, bad) consequences, but it is quite unlikely that you break things if you use biblatex.

With biblatex there is the high-level command \autocite that you can use. Then you can easily configure biblatex to use normal \cite, brackets with \parencite or footnotes with \footcite for \autocite. (Mildly related: Universal \cite commands or defining new cite commands)

In most modern editors it will take 30 seconds tops to do a 'search and replace' for \cite vs. \parencite. That can of course easily be undone by the opposite replacement.

moewe
  • 175,683
  • There was a similar question on comp.text.tex years ago with virtually the same answer (minus the 'I don't like this' part): https://groups.google.com/d/msg/comp.text.tex/efmAcnGQ1CU/0JC7z62r1BMJ – moewe Sep 29 '16 at 12:41