5

Would it cause problems to use only \parencites (with the s), even when citing just one reference?

And would it be possible to make a \newcommand like e.g.

\newcommand{\pc}{\parencites{#1}{#2}} 

which would then 'ask' for the citekey(s) plus pre- (#1) and post-notes (#2)?

EDIT: Some typos and formulations to make the massage more clear.

jbahn
  • 443
  • 1
    I don't quite understand the second part of your question, I must say. – moewe Jul 14 '18 at 12:24
  • @moewe: I have cleared some typos and hopefully the question is more clear now? – jbahn Jul 14 '18 at 14:06
  • Sorry, I still don't know what exactly you are getting at. Can't you just use \parencites? Or do you want the optional arguments to be mandatory? – moewe Jul 14 '18 at 14:08
  • Sorry for vague explanation. It's just a matter of convenience. I use a lot of citations and just figured that if I can trick the editor to consider \pc as if it was the \parencites command, it would be easier and faster. – jbahn Jul 14 '18 at 14:18
  • 1
    You can say \newcommand*{\pc}{\parencite}. But usually it is advised to use an editor with a nice autocomplete feature instead of defining many macros with short one- or two-letter names. BTW: In the future you may want to consider asking only one question per question. It seems to me that the two issues here are only tangentially related: https://tex.meta.stackexchange.com/q/7425/35864. PPS: If we are indeed talking about biblatex here, you may want to add the relevant tag. – moewe Jul 14 '18 at 14:45
  • One of the downsides to the unskilled - such as me - is the lack of overview. Thank you for pointing my attention to the problem with multiple questions in one post. I'll add the biblatex tag. – jbahn Jul 14 '18 at 18:26
  • Did my answer answer your question or is there something else you want me to address? – moewe Jul 18 '18 at 08:03
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – samcarter_is_at_topanswers.xyz Jul 18 '18 at 14:55

1 Answers1

5

The answer assumes that we are talking about biblatex since that is to my knowledge the only package that defines \parencites.

The syntax of the multicite commands \cites, \parencites, ... is fully compatible with that of the single-cite commands \cite, \parencite, ...

But the implementation of the two differs greatly. While the single-cite commands know that they can only be passed one mandatory argument, the multicite commands need to scan ahead for more possible arguments, since the number of (mandatory) arguments is not fixed.

In particular the biblatex documentation notes in §3.8.3 Qualified Citation Lists, p. 99,

Note that the multicite commands keep on scanning for arguments until they encounter a token that is not the start of an optional or mandatory argument. If a left brace or bracket follows a multicite command, you need to mask it by adding \relax or a control space (a backslash followed by a space) after the last valid argument. This will cause the scanner to stop.

That means

  1. The multicite commands have to do more work than the single-cite commands.
  2. In special situations the argument scanner of the multicite commands may need manual intervention to avoid misunderstandings.

Compare the following MWE

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}


\begin{document}
\cites[380]{sigfridsson}[12]{worman}\ [blub]

\cites[380]{sigfridsson}[12]{worman}\ {\itshape how old fashioned}

\cite[380]{sigfridsson} [blub]

\cite[380]{sigfridsson} {\itshape how old fashioned}

\printbibliography
\end{document}

Where the \ is necessary for \cites but nor for \cite.

So the single-cite commands do have their uses: They are slightly 'safer' and simpler in their implementation.

For what it is worth I usually use the single-cite commands and only go over to the multicite versions if I cite several sources with postnotes.

moewe
  • 175,683
  • Thanks. Your answer clarified some fundamental issues, but in order to solve my initial problem (alphabetic order of references), the only thing I can make out of it - perhaps due to my lack of knowledge - is to manually sort the references, whether within multi-cites commands or by use of single-cite commands. Both are feasible but I was hoping for latex to automatise that task. – jbahn Jul 18 '18 at 08:10
  • @jbahn I see, I though there might have been something missing, because you did not accept the answer... – moewe Jul 18 '18 at 08:13
  • sorry for the misunderstanding. Your answer was helpful (and I have marked it so), but my problem remains – jbahn Jul 18 '18 at 08:18
  • @jbahn Indeed, but the question asked only about the difference between \parencite and \parencites, which I think I answered. Your other question is about sorting: https://tex.stackexchange.com/q/441632/35864. This one here doesn't even mention it. I happen to believe that the fact that your initial problem (which may have prompted you to ask this question) is not yet solved does not mean that this question is not answered or solved. But you may very well think otherwise, I just wanted to know if I could improve this answer. – moewe Jul 18 '18 at 08:20
  • you point at a crucial issue here, which I can see has some general interest (I believe I saw a thread about this on meta). It takes quite some time to learn to pose the right questions, e.g. to what is actually the problem, and to pose them in the right way, e.g. one at the time. Thanks to comments from you and others I slowly learn, and I promise I will make efforts to become better at it. – jbahn Jul 18 '18 at 08:48
  • @jbahn Don't get me wrong. It is a very good thing that you split your questions into two: One about the general usefulness of \parencite vs \parencites and one about the sorting. I happen to think that the point of this question here is interesting in its own right, that's why I wrote an answer. I'm sorry that this question here did not really help you with what you were trying to achieve. But that should not discourage you to split questions into bite-sized chunks in the future. – moewe Jul 18 '18 at 08:52