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

Bibliography elements do not respect alphabetical order #661

Closed
GegznaV opened this issue Dec 11, 2018 · 4 comments
Closed

Bibliography elements do not respect alphabetical order #661

GegznaV opened this issue Dec 11, 2018 · 4 comments
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@GegznaV
Copy link

GegznaV commented Dec 11, 2018

Bibliography elements in Bookdown (GitBook format) do not respect alphabetical order.

To reproduce the problem:

  1. Open minimal bookdown example in RStudio.
  2. Download apa.csl file and save it in project's folder.
  3. In YAML header of index.Rmd, replace biblio-style: apalike with csl: "apa.csl"
  4. At the end of index.Rmd, add citations in this order:
1. [@xie2015]
2. [@R-rmarkdown]
3. [@R-knitr]
4. [@R-base]
5. [@R-bookdown]
  1. Build a GitBook.

The result shows, that references are in the order as they were mentioned in the text:
image

If I use the same sources of information in Word with Mendeley plugin for citations and the same apa.csl style, I get what I expect:

image

In lines 714-717 of apa.csl it is written, that the bibliography list elements should be sorted by author's name:

    <sort>
      <key macro="author" names-min="8" names-use-first="6"/>
      <key macro="issued-sort"/>
    </sort>

How could this issue be solved?

Session information:

> devtools::session_info('bookdown')
- Session info -------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       Europe/Helsinki             
 date     2018-12-11                  

- Packages -----------------------------------------------------------------------------
 package   * version date       lib source                            
 base64enc   0.1-3   2015-07-28 [1] CRAN (R 3.5.0)                    
 bookdown    0.8.2   2018-12-11 [1] Github (rstudio/bookdown@7a0364b) 
 digest      0.6.18  2018-10-10 [1] CRAN (R 3.5.1)                    
 evaluate    0.12    2018-10-09 [1] CRAN (R 3.5.1)                    
 glue        1.3.0   2018-07-17 [1] CRAN (R 3.5.1)                    
 highr       0.7     2018-06-09 [1] CRAN (R 3.5.0)                    
 htmltools   0.3.6   2017-04-28 [1] CRAN (R 3.5.0)                    
 jsonlite    1.6     2018-12-07 [1] CRAN (R 3.5.1)                    
 knitr       1.21.1  2018-12-11 [1] Github (yihui/knitr@741413b)      
 magrittr    1.5     2014-11-22 [1] CRAN (R 3.5.0)                    
 markdown    0.9     2018-12-07 [1] CRAN (R 3.5.1)                    
 mime        0.6     2018-10-05 [1] CRAN (R 3.5.1)                    
 Rcpp        1.0.0   2018-11-07 [1] CRAN (R 3.5.1)                    
 rmarkdown   1.11.2  2018-12-11 [1] Github (rstudio/rmarkdown@692114e)
 stringi     1.2.4   2018-07-20 [1] CRAN (R 3.5.1)                    
 stringr     1.3.1   2018-05-10 [1] CRAN (R 3.5.0)                    
 tinytex     0.9     2018-10-23 [1] CRAN (R 3.5.1)                    
 xfun        0.4     2018-10-23 [1] CRAN (R 3.5.1)                    
 yaml        2.2.0   2018-07-25 [1] CRAN (R 3.5.1)                    


> rmarkdown::pandoc_version()
[1] ‘2.5’


> system('pdflatex --version')
MiKTeX-pdfTeX 2.9.6211 (1.40.17) (MiKTeX 2.9.6210 64-bit)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2016 Han The Thanh
TeX is a trademark of the American Mathematical Society.
using bzip2 version 1.0.6, 6-Sept-2010
compiled with curl version 7.52.1; using libcurl/7.52.1 WinSSL
compiled with expat version 2.2; using expat_2.2.0
compiled with jpeg version 9.2
compiled with liblzma version 50020022; using 50020022
compiled with libpng version 1.6.28; using 1.6.28
compiled with libressl version LibreSSL 2.4.4; using LibreSSL 2.4.4
compiled with MiKTeX Application Framework version 1.6211; using 1.6211
compiled with MiKTeX Core version 1.6216; using 1.6233
compiled with MiKTeX Archive Extractor version 1.6211; using 1.6211
compiled with MiKTeX Package Manager version 1.6218; using 1.6229
compiled with poppler version 0.50.0
compiled with uriparser version 0.8.4
compiled with zlib version 1.2.10; using 1.2.10

@GegznaV
Copy link
Author

GegznaV commented Dec 11, 2018

UPDATE The references in index.html are in the wrong order, but in references.html in correct one:

image

@yihui
Copy link
Member

yihui commented Dec 11, 2018

That is by design at the moment. I guess it could be changed, but I don't have time for this task, and it doesn't seem to be a high-priority issue...

@GegznaV
Copy link
Author

GegznaV commented Dec 12, 2018

The project with the described issue:
bookdown-issue-661--citations.zip

crsh added a commit to crsh/bookdown that referenced this issue Jan 30, 2019
@yihui yihui added this to the v0.10 milestone Jan 30, 2019
@yihui yihui added the bug an unexpected problem or unintended behavior label Jan 30, 2019
@yihui yihui closed this as completed in 44af2c0 Jan 30, 2019
@github-actions
Copy link

github-actions bot commented Nov 6, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants