Comments (4)
@ge-ne Any chance you could have a look into this older issue as well. Is this more complicated than I imagine?
from bibtool.
sort.format = { %s($type) %s(year) %s(month) {%N(author) # %N(editor)} }
Whenever a format specifier fails -- because a field is not found or other reasons -- then backtracking takes place and an alternative is sought.
In the example this happens for the fields year and month which are not present in the new types.Thus backtracking occurs until the whole format fails. Finally the default key is used as final alternative. For those entries the key determines the sorting order. This can be seen when using the format to generate new keys.
A construction like {%s(year)#}
and {%s(month)#}
solve this problem.
The same behaviour can show up when neither author nor editor are present. The solution applies he same trick.
from bibtool.
Thanks for the explanation and solution. Very much appreciated.
I have read section A.7 in the documentation again. I think a few places could be improved. For example, the sentence
If everything fails the sort key is empty.
should be
If everything fails, the sort key is empty and the default sort key is used which is the reference key.
This is already mentioned at the beginning of this section:
The sort key is by default the reference key.
Also I would add something like
Whenever a format specifier fails -- because a field is not found or other reasons -- then backtracking takes place and an alternative is sought. Backtracking occurs until the whole format fails and the default sort key is used which is the reference key.
For example, when you want to sort chronologically by year and month as the first criteria and as secondary criteria by author or editor name, you should write the expression assort.format = { {%s(year) # } {%s(month) # } {%N(author) # %N(editor) # } }
This avoids that the whole sort format fails if any of year and month or both author and editor are not present.
For debugging purposes, I tried to see the sort key with
% Sort records
sort = on
sort.macros = {off}
sort.format = { %s($type) {%s(year)#} {%s(month)#} {%N(author) # %N(editor) #} }
add.field {sort="%s($sortkey)"}
However, the new field 'sort' is empty? Did I miss something?
Finally, I want to take here the opportunity to thank you for all your recent comments, commits and in general for bibtool. Many open source projects are abondaned after period of time but often I encounter issues which I would hope could be addressed.
from bibtool.
However, the new field 'sort' is empty? Did I miss something?
The field rewriting (add.field) is performed before key creation. This is necessary to make sure that fields referenced in sort format can be provided before they are used. Thus the sort key is empty when you add it...
from bibtool.
Related Issues (20)
- Problems with sorting by year HOT 2
- 2.68 release is missing in GitHub releases HOT 1
- Unique.field does not work yet in v2.68 HOT 1
- Semantic Check: Unique field considers field = {value} different to field = "value"
- Feature Request: Extend unique field check to allow combination of fields HOT 2
- bug: input filenames containing a dot are not parsed correctly HOT 3
- feature: input BibLaTeX output BibTeX HOT 2
- `make test` works, but `make check` fails HOT 2
- Single newlines in annotate field discarded during printing HOT 7
- Conditional fields deletion
- Feature request: symbol.type = original
- Feature request: print.align = minimal HOT 5
- extraction using "-x" and aux-file stuck HOT 6
- entry type @manuscript HOT 2
- How to convert biblatex bib file to bibtex bib file HOT 4
- tests fail on darwin-arm64 (Apple Silicon) HOT 1
- BibTool ERROR (line 98 in ./vueandpandoc-v1.0.1.bib): Unknown entry type HOT 2
- file not found, always HOT 7
- Bug in `month.rsc` when dealing with `month = may` HOT 2
- Feature Request: Add `$TEXMFHOME/bibtool/.bibtoolrsc` to default resource paths HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bibtool.