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

Command \smartcite does not take autopunct feature into account #749

Closed
jchampavere opened this issue May 24, 2018 · 8 comments
Closed

Command \smartcite does not take autopunct feature into account #749

jchampavere opened this issue May 24, 2018 · 8 comments

Comments

@jchampavere
Copy link

jchampavere commented May 24, 2018

Using authortitle style with, e.g., My reference is awesome\smartcite{myref}! produces “My reference is awesome²!” instead of “My reference is awesome!²”, i.e., the footnote call is located at the same place that the \smartcite call, unlike other *cite commands.

@moewew
Copy link
Collaborator

moewew commented May 24, 2018

As far as I know only \autocite moves the citation (and \textcite in some verbose styles), all other commands do not move the punctuation around. If you see a different behaviour I would be really interested in an MWE.

This is known and we have a ticket open for discussion #733.

@jchampavere
Copy link
Author

The documentation (see section 3.8) suggests that all *cite commands are affected by this feature :

If the autopunct package option from § 3.1.2.1 is enabled, they will scan ahead
for any punctuation immediately following their last argument. This is useful to
avoid spurious punctuation marks after citations. This feature is configured with
\DeclareAutoPunctuation, see § 4.7.5 for details.

Here, I understand that “they” refers to all the following commands. But I'm not English-speeking native.

@moewew
Copy link
Collaborator

moewew commented May 24, 2018

As far as I can see this only applies to generally scanning ahead for spurious punctuation (which indeed works for all commands), but it does not specifically refer to moving around the punctuation marks, which only happens for \autocite. I quickly skimmed the documentation and could not find a mention of punctuation marks being moved around that did not specifically refer to \autocite.
In particular, in the description of \autocite on p. 100 we find (emphasis mine)

In contrast to other citation commands, the \autocite command does not only
scan ahead for punctuation marks following its last argument to avoid double
punctuation marks, it actually moves them around if required.

Anyway, I can see that it would be useful to have other citation commands move the punctuation, that's why I started the discussion in #733 in the first place. But this requires changes to lower-level bits of the code and we need to ensure that we don't break older documents or change their behaviour significantly, which makes the implementation more tricky. Since no one responded on the other issue I did not investigate further, but I think it would be quite a complicated operation.

@moewew
Copy link
Collaborator

moewew commented May 24, 2018

Is there any specific reason why you can't use \autocite and need to use \smartcite in the meantime?

@jchampavere
Copy link
Author

jchampavere commented May 24, 2018

There is no specific reason. In fact, I do not expect that a footnote call (a citation, here) moves after the punctuation mark, in general, because this should not be the case in French as far I know. So, the best option for me would be to set autopunct to false, I suppose.

But I still can not figure out what is a "spurious punctuation mark after citation". An example of such problem would be very useful.

@moewew
Copy link
Collaborator

moewew commented May 24, 2018

It is probably safer to just set up \autocite not to move the citation with

\DeclareAutoCiteCommand{footnote}[r]{\smartcite}{\smartcites}

instead of disabling the entire autopunct feature.

A spurious punctuation mark situation would appear if the citation as typeset with \cite ends with a punctuation mark and you have a literal punctuation mark directly behind it. Such situations are rare, but they can happen. Consider

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

\usepackage[style=authortitle-terse, backend=biber, autopunct=true]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \cite{aksin}.

Lorem \cite{aksin},

\printbibliography
\end{document}

which produces
with autocite=true

Lorem Aksın et al.
Lorem Aksın et al.,

and with autocite=false

Lorem Aksın et al..
Lorem Aksın et al.,

The undesired double . is suppressed, while ., is retained since the dot represents an abbreviation dot that may remain before a comma. Which combinations are admissible and which need to be suppressed can be modified with \DeclarePunctuationPairs.

@moewew
Copy link
Collaborator

moewew commented May 28, 2018

Is there anything left to discuss here? I'm closing this as a duplicate of #733 for now. Everyone is very much welcome to share their thoughts about moving punctuation there. If you feel we need to tie up some loose ends in the discussion here (documentation improvements?), don't hesitate to comment here.

@moewew
Copy link
Collaborator

moewew commented May 28, 2018

Duplicate of #733

@moewew moewew marked this as a duplicate of #733 May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants