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

Missing delimcontext cbx@textcite #432

Closed
moewew opened this issue Jun 1, 2016 · 7 comments
Closed

Missing delimcontext cbx@textcite #432

moewew opened this issue Jun 1, 2016 · 7 comments
Labels

Comments

@moewew
Copy link
Collaborator

moewew commented Jun 1, 2016

Via Unwanted comma between author and year using citet command on TeX.SX.

The two pass-structure of some \textcite implementations makes the delimiter context cbx@textcite necessary, it should behave exactly like textcite. Is there a way to alias the two? Otherwise we would need to add some lines to biblatex.def and warn the users about this special context in the docs.

@plk
Copy link
Owner

plk commented Jun 1, 2016

This is tricky. I don't like this using of \DeclareCiteCommand for internal commands like this. The best solution would be to stop doing this. It's not clear to me what \textcite/\cbx@textcite complication is actually doing - @josephwright - do you have any insight?

@moewew
Copy link
Collaborator Author

moewew commented Jun 2, 2016

As far as I can see this two-pass structure allows to collect some additional information about the citation list before actually processing it. In authoryear-icomp that comes down to calculating textcitetotal for \iffinalcitedelim. Maybe that could be solved differently.

Another solution instead of aliasing would be to inject a manual call to \delimcontext{textcite} into the pre-code hook of \cbx@textcite to override the cbx@textcite context with textcite. (Of course custom styles would then have to follow suit.)

@plk
Copy link
Owner

plk commented Jun 2, 2016

Ok, I think this would be messy to solve in that way. I added a \DeclareDelimcontextAlias command to allow for context aliasing. The relevant styles now use this to set the alias for this case. This is in 3.5 DEV.

@moewew
Copy link
Collaborator Author

moewew commented Jun 2, 2016

It works brilliantly, thank you very much.

Would it make sense to move the \DeclareDelimcontextAlias{cbx@textcite}{textcite} line to biblatex.def so other (custom) styles can benefit from it as well?

@plk
Copy link
Owner

plk commented Jun 2, 2016

That's what I did originally but I don't want to pre-judge whether such macro names would be used in custom styles for completely different reasons so I localised the alias to where it was needed. This also makes it more obvious that it's needed for people creating custom styles by copying existing ones.

@moewew
Copy link
Collaborator Author

moewew commented Jun 2, 2016

Fair enough, though I think it is quite safe to assume that if cbx@textcite is used it is in the context of a textcite and thus the textcite delimcontext should apply.

@plk
Copy link
Owner

plk commented Jun 2, 2016

I think so too but I've been caught out by this sort of thing before ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants