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

Move punctuation for cite commands other than autocite #733

Closed
moewew opened this issue Mar 27, 2018 · 2 comments
Closed

Move punctuation for cite commands other than autocite #733

moewew opened this issue Mar 27, 2018 · 2 comments

Comments

@moewew
Copy link
Collaborator

moewew commented Mar 27, 2018

This came up over at moewew/biblatex-ext#1 and made me wonder.

I always thought, only \autocite had the ability to move around punctuation marks. The feature can be enabled if the option autopunct is set to true by using the optional position argument for \DeclareAutoCiteCommand.

As it turns out, however, \textcite as defined by the verbose styles also moves punctuation around. I could not find any official word about this in the documentation. Unlike \autocite the feature can not be disabled easily with just one or two lines of code here, it is necessary to redefine \textcite in its entirety (about 20 lines of code). While I can definitely see that moving the punctuation mark is a nice feature, it strikes me as a bit unfortunate that the modifications necessary to disable that behaviour are so awkward and not particularly user friendly.

On the other hand it has always struck me as odd that there was no simple way to let other citation commands (in particular \footcite, \footfullcite, ...) move around punctuation marks.

So I was wondering whether or not it would be a good idea to enable moving of punctuation marks for all citation commands and offer a simpler interface to enable or disable that feature.
The code changes necessary to allow for the moving don't seem particularly challenging, although a few things should be sorted out and thorough testing would be needed. At the moment I believe the exact implementation of a useful interface would be more challenging.

I'd be interested in everybody's thoughts about the merit of this proposal as well as any input about issues that could arise with this and ideas for implementations.

@moewew moewew added this to To Do in biblatex 3.12 Mar 30, 2018
moewew added a commit to moewew/biblatex that referenced this issue Jun 12, 2018
First attempt at a interface to allow other citation commands to move the
punctuation after them.
The implementation was a bit tricky, so \DeclareCitePunctuationPosition has
to be called after \DeclareCiteCommand.
@moewew
Copy link
Collaborator Author

moewew commented Jun 12, 2018

A first attempt with a few drawbacks is at dev...moewew:citepunctmove.

The nature of the many nested commands that make up one citation commands made it hard to implement a more direct approach. \DeclareCitePunctuationPosition essentially redefines one of the internal cite constituents. This means that it must be issued after \DeclareCiteCommand and that we had to remember the wrapper command from an earlier \DeclareCiteCommand. Not very elegant, but it seems to work.

@moewew moewew moved this from To Do to In Progress in biblatex 3.12 Jun 20, 2018
moewew added a commit to moewew/biblatex that referenced this issue Oct 13, 2018
First attempt at a interface to allow other citation commands to move the
punctuation after them.
The implementation was a bit tricky, so \DeclareCitePunctuationPosition has
to be called after \DeclareCiteCommand.
@moewew moewew moved this from In Progress to Done in biblatex 3.12 Oct 14, 2018
@moewew moewew moved this from Done to In Progress in biblatex 3.12 Oct 14, 2018
moewew added a commit to moewew/biblatex that referenced this issue Oct 15, 2018
Similar to \DeclareAutoCiteCommand's optional position argument.
@moewew
Copy link
Collaborator Author

moewew commented Oct 16, 2018

A more sophisticated attempt is at dev...moewew:cpm2. Comments are appreciated. I will prepare a pull request tomorrow.

Usage example

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

\usepackage[style=authoryear, backend=biber, autocite=footnote]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareCitePunctuationPosition{\footcite}{f}

\begin{document}
Lorem \autocite{sigfridsson}.

Ipsum \footcite{sigfridsson}.

Dolor\footnote{Sit \footcite{sigfridsson}.}.
\end{document}

moewew added a commit to moewew/biblatex that referenced this issue Oct 17, 2018
Similar to \DeclareAutoCiteCommand's optional position argument.
moewew added a commit that referenced this issue Oct 17, 2018
Implement \DeclareCitePunctuationPosition (#733)
@moewew moewew moved this from In Progress to Done in biblatex 3.12 Oct 17, 2018
@moewew moewew added this to the v3.12 milestone Oct 21, 2018
@moewew moewew closed this as completed Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
biblatex 3.12
  
Done
Development

No branches or pull requests

1 participant