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

Sort entries in a query #345

Open
michelucci opened this issue Aug 14, 2022 · 2 comments
Open

Sort entries in a query #345

michelucci opened this issue Aug 14, 2022 · 2 comments

Comments

@michelucci
Copy link

Hi,

I have a bibtex file with all the references. I want to select some of them with a query, something like

{% bibliography --query @*[topic=mltheory]* %}

I added the topic entry in the bib entries. The selection works, but the order is not correct. In the configuration file I have

scholar:

  last_name: #Michelucci
  first_name: #[Umberto, U.]

  style: apa
  locale: en

  source: /_bibliography/
  bibliography: papers.bib
  bibliography_template: bib #bib
  # Note: if you have latex math in your bibtex, the latex filter
  # preprocessing may conflict with MathJAX if the latter is enabled.
  # See https://github.com/alshedivat/al-folio/issues/357.
  bibtex_filters: [latex, smallcaps, superscript]

  replace_strings: true
  join_strings: true
  #group_by: year
  sorty_by: year, month
  order: descending, descending

  details_dir: bibliography
  details_layout: bibtex.html
  details_link: Details

  query: "@*"

But somehow the query returns a list not order by year. Anyone has any idea why?

Thank you in advance, especially for such a cool tool!

Umberto

@inukshuk
Copy link
Owner

Not sure, but if you copied the configuration above verbatim from your file then there's a typo in sorty_by_year.

@george-gca
Copy link

george-gca commented Dec 26, 2023

This is currently an issue for me. For example, when I do this giving the papers.bib:

{% bibliography -f {{ site.scholar.bibliography }} --group_by none --query @*[selected=true]* %}

it correctly selects only the entries that have selected={true} in it.

image

But when I do

{% bibliography -f {{ site.scholar.bibliography }} --group_by none --sort_by year,month --order descending --query @*[selected=true]* %}

it fails to filter the entries, returning all of them.

image

Also the order is right besides the last one, that is actually the newest one. I tested this in this template.

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

No branches or pull requests

3 participants