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

Reverse the order of bib entries #38

Open
JinraeKim opened this issue Jul 22, 2021 · 0 comments
Open

Reverse the order of bib entries #38

JinraeKim opened this issue Jul 22, 2021 · 0 comments

Comments

@JinraeKim
Copy link

JinraeKim commented Jul 22, 2021

Related to #36.

What should I do to reverse the order of the OrderedDict of bib entries?

For example,

julia> bib = Bibliography.import_bibtex(joinpath("references", file * ".bib"))
OrderedCollections.OrderedDict{String, BibInternal.Entry} with 4 entries:
  "kimNeuralNetworkBasedPathReplanning2021"         => Entry(Access("10.1109/ACCESS.2021.3083734", "", "https://ieeexplore.ieee.org/document/9440908"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Lee", "", "Sangmin", ""), Name("
  "kimPartiallyConvexNeuralNetworks_in_preparation" => Entry(Access("", "", ""), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Kim", "", "Youdan", "")], "", Date("", "", "2099"), BibInternal.Name[], Eprint("", "", ""), "kimPartiallyConvexNeuralNetworks_in_preparat
  "kimFieldofViewConstrainedImpactAngle2021"        => Entry(Access("10.1177/0954410020942010", "", "http://journals.sagepub.com/doi/10.1177/0954410020942010"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Cho", "", "Namhoon", ""), Name("", "Kim", "", "Youdan", "
  "choWindCompensationFramework2020a"               => Entry(Access("10.1109/TAES.2019.2920219", "", "https://ieeexplore.ieee.org/document/8727399/"), BibInternal.Name[Name("", "Cho", "", "Namhoon", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Kim", "", "Jinrae", ""), Name(""

julia> sort_bibliography!(bib, :y)
OrderedCollections.OrderedDict{String, BibInternal.Entry} with 4 entries:
  "choWindCompensationFramework2020a"               => Entry(Access("10.1109/TAES.2019.2920219", "", "https://ieeexplore.ieee.org/document/8727399/"), BibInternal.Name[Name("", "Cho", "", "Namhoon", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Kim", "", "Jinrae", ""), Name(""
  "kimNeuralNetworkBasedPathReplanning2021"         => Entry(Access("10.1109/ACCESS.2021.3083734", "", "https://ieeexplore.ieee.org/document/9440908"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Lee", "", "Suwon", ""), Name("", "Lee", "", "Sangmin", ""), Name("
  "kimFieldofViewConstrainedImpactAngle2021"        => Entry(Access("10.1177/0954410020942010", "", "http://journals.sagepub.com/doi/10.1177/0954410020942010"), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Cho", "", "Namhoon", ""), Name("", "Kim", "", "Youdan", "
  "kimPartiallyConvexNeuralNetworks_in_preparation" => Entry(Access("", "", ""), BibInternal.Name[Name("", "Kim", "", "Jinrae", ""), Name("", "Kim", "", "Youdan", "")], "", Date("", "", "2099"), BibInternal.Name[], Eprint("", "", ""), "kimPartiallyConvexNeuralNetworks_in_preparat

But I wanna get the reverse-ordered result.

Even if there is a simple way of reversing the order of an OrderedDict, I think it would be much convenient if a keyword argument is provided for "reversing the order".

Current sorting rules look like:

const sorting_rules = Dict{Symbol, Vector{Symbol}}(
    :nty  => [:authors;:editors;:title;:date],
    :nyt  => [:authors;:editors;:date;:title],
    :y    => [:date]
);

so maybe we need something like

:nty
:n-ty  # reverse only t
:-y  # reverse y
...  # etc
@JinraeKim JinraeKim changed the title Reverse the order of bib Reverse the order of bib entries Jul 22, 2021
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

1 participant