Coder Social home page Coder Social logo

Comments (6)

josephwright avatar josephwright commented on September 28, 2024

I wonder what is 'expected' here: I'd say one 'declare' overwrites another, as there is no 'undeclare'.

from biblatex.

simifilm avatar simifilm commented on September 28, 2024

But it wouldn't make sense not to be able to define different exclusions. If they overwrite each other you're not able, for example, to exclude 'editor' for one document type and 'author' for another one.

from biblatex.

aboruvka avatar aboruvka commented on September 28, 2024

Based on the code, this is the intended behaviour - a declaration defines an entrytype-specific control sequence that later expands to a complete sortexclusion clause in the bcf (control) file. Multiple clauses such as

    <bcf:sortexclusion type="collection">
      <bcf:exclusion>author</bcf:exclusion>
      <bcf:exclusion>editor</bcf:exclusion>
      <bcf:exclusion>sortname</bcf:exclusion>
      <bcf:exclusion>translator</bcf:exclusion>
    </bcf:sortexclusion>
    <bcf:sortexclusion type="collection">
      <bcf:exclusion>maintitle</bcf:exclusion>
    </bcf:sortexclusion>

won't work as the last one overrides the first. So you'll have to track the excluded fields in \blx@sortexlude (sic) - the internal command called by \DeclareSortExclusion.

\def\blx@sortexlude#1#2{%
  \begingroup
  \ifblank{#1}
    {\global\csundef{blx@bcf@exclude@#2}}
    {\let\blx@tempa\@empty
     \forcsvlist\blx@sortexlude@i{#1}%
     \csxappto{blx@bcf@excludelist@#2}{\blx@tempa}%
     \csxdef{blx@bcf@exclude@#2}{%
       \blx@xml@sortexclude{#2}{\csuse{blx@bcf@excludelist@#2}}}}
  \endgroup}

I'm not convinced this change is needed. Can you clarify your last comment, Simon? I don't quite follow the motivation.

from biblatex.

simifilm avatar simifilm commented on September 28, 2024

The motivation is simple – different kind of exclusions.

Let's say I want 'maintitle' excluded for 'collection' and 'incollection', and 'author' and 'editor' for both 'movie' and collection'. How am I supposed to achieve this, if I can't define multiple exclusions? I need something like this to do that:

\DeclareSortExclusion{movie, collection}{author,editor}
\DeclareSortExclusion{incollection, collection}{maintitle}

from biblatex.

aboruvka avatar aboruvka commented on September 28, 2024

Why not use the following?

\DeclareSortExclusion{collection}{author,editor,maintitle}
\DeclareSortExclusion{movie}{author,editor}
\DeclareSortExclusion{inollection}{maintitle}

from biblatex.

simifilm avatar simifilm commented on September 28, 2024

Ah, so this does work. I didn't understand that you can have different exclusions, but not for the same document type.

from biblatex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.