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

entrysetcount for children with multiple parents #815

Closed
moewew opened this issue Oct 7, 2018 · 4 comments
Closed

entrysetcount for children with multiple parents #815

moewew opened this issue Oct 7, 2018 · 4 comments
Labels
Milestone

Comments

@moewew
Copy link
Collaborator

moewew commented Oct 7, 2018

See https://tex.stackexchange.com/q/454219/35864

Consider the following MWE where two sets use the same entries but in a different order

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

\usepackage[style=numeric,
    mcite=true,
    subentry,
    backend=biber,
    ]{biblatex}

\usepackage{hyperref}

\addbibresource{biblatex-examples.bib}

\begin{document}        
  This is some nice text I want to cite as a set\mcite{set1,*sigfridsson,*worman}.
  \cite{sigfridsson} and \cite{worman}

  Another set cite\mcite{set2,*worman,*sigfridsson}.
  \cite{sigfridsson} and \cite{worman}

  \printbibliography
\end{document}

which produces

[1] (a) Emma Sigfridsson and Ulf Ryde. “Comparison of methods for deriving atomic charges from the electrostatic potential and moments”. In: Journal of Computational Chemistry 19.4 (1998), pp. 377–395. doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P; (a) Nancy Worman. The Cast of Character. Style in Greek Literature. Austin: University of Texas Press, 2002.
[2] (a) Nancy Worman. The Cast of Character. Style in Greek Literature. Austin: University of Texas Press, 2002; (b) Emma Sigfridsson and Ulf Ryde. “Comparison of methods for deriving atomic charges from the electrostatic potential and moments”. In: Journal of Computational Chemistry 19.4 (1998), pp. 377–395. doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.

That is because entrysetcount is decided by the last parent-child relationship that was processed in the .bbl.

@moewew moewew added the bug label Oct 7, 2018
@moewew moewew added this to To Do in biblatex 3.12 Oct 7, 2018
@moewew
Copy link
Collaborator Author

moewew commented Oct 7, 2018

One easy solution would be to calculate the entrysetcount on the fly when we are within \blx@entryset.

\def\blx@entryset#1{%
  \blx@ifdata{#1}
    {\blx@entrysetcounter\@ne
     \begingroup
     \blx@imc@clearlist{pageref}%
     \blx@getdata{#1}%
     \edef\abx@field@entrysetcount{\the\blx@entrysetcounter}%
     \blx@setoptions@type\abx@field@entrytype
     \blx@setoptions@entry
     \blx@execute
     \blx@beglangbib
     \blx@begunit
     \blx@anchor
     \blx@entryset@precode
     \blx@driver{\blx@imc@thefield{entrytype}}%
     \blx@entryset@postcode
     \blx@endunit
     \blx@endlangbib
     \endgroup}
    {}%
  \let\do\blx@entryset@i}

\def\blx@entryset@i#1{%
  \blx@ifdata{#1}
    {\advance\blx@entrysetcounter\@ne
     \begingroup
     \blx@resetdata
     \blx@getdata{#1}%
     \edef\abx@field@entrysetcount{\the\blx@entrysetcounter}%
     \blx@setoptions@type\abx@field@entrytype
     \blx@setoptions@entry
     \addtocounter{instcount}\@ne
     \blx@execute
     \blx@beglangbib
     \blx@begunit
     \blx@anchor
     \blx@entryset@precode
     \blx@driver{\blx@imc@thefield{entrytype}}%
     \blx@entryset@postcode
     \blx@endunit
     \blx@endlangbib
     \endgroup}
    {\blx@nounit}}

In other situations we would still have to rely on .bbl-generated data.

@plk
Copy link
Owner

plk commented Oct 7, 2018

Hmm, ok - if you want to prepare a merge, I can run the tests.

@moewew
Copy link
Collaborator Author

moewew commented Oct 8, 2018

I'll think about this some more to see if there is something more elegant that could be done, but if I find nothing I will prepare a PR.

moewew added a commit to moewew/biblatex that referenced this issue Oct 12, 2018
This fixes the output in the bibliography, but the output in the
document is still based on the last set that used the entry.
@moewew
Copy link
Collaborator Author

moewew commented Oct 12, 2018

Suggested fix is at #822

@moewew moewew moved this from To Do to In Progress in biblatex 3.12 Oct 12, 2018
moewew added a commit that referenced this issue Oct 14, 2018
Fix entrysetcount for entries in multiple sets (#815)
@moewew moewew moved this from In Progress to Done in biblatex 3.12 Oct 14, 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
Labels
Projects
No open projects
biblatex 3.12
  
Done
Development

No branches or pull requests

2 participants