Gitbook章目目录不按字母顺序排列

ms6*_*609 13 html r bibliography knitr bookdown

我正在使用bookdown从R markdown文件(即.Rmd)创建HTML gitbook ,默认选项是split_bib = TRUE在每章末尾生成参考书目,以及本书末尾的完整参考书目.

书末书目按字母顺序排列,但章末书目却没有.(这是一个例子).

如何按字母顺序排列所有参考列表?

Yvo*_*row 3

\r\n
\r\n
$(function(){\r\n    var elems = $(\'#refs\').children(\'div\').remove();\r\n    elems.sort(function (a, b) {\r\n        return b.id > a.id ? -1 : 1;\r\n    });\r\n    $(\'#refs\').append(elems);\r\n});
Run Code Online (Sandbox Code Playgroud)\r\n
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>\r\n<div id="refs" class="references">\r\n  <div id="ref-Goloboff2016">\r\n    <p>Goloboff, P. A., and S. A. Catalano. 2016: TNT version 1.5, including a full implementation of phylogenetic morphometrics. Cladistics 32:221\xe2\x80\x93238.</p>\r\n  </div>\r\n  <div id="ref-Goloboff1999">\r\n    <p>Goloboff, P. 1999: Analyzing large data sets in reasonable times: solutions for composite optima. Cladistics 15:415\xe2\x80\x93428.</p>\r\n  </div>\r\n  <div id="ref-Nixon1999">\r\n    <p>Nixon, K. C. 1999: The Parsimony Ratchet, a new method for rapid parsimony analysis. Cladistics 15:407\xe2\x80\x93414.</p>\r\n  </div>\r\n  <div id="ref-Goloboff1997">\r\n    <p>Goloboff, P. A. 1997: Self-weighted optimization: tree searches and character state reconstructions under implied transformation costs. Cladistics 13:225\xe2\x80\x93245.</p>\r\n  </div>\r\n</div>
Run Code Online (Sandbox Code Playgroud)\r\n
\r\n
\r\n

\n\n

id我的解决方案按 中的divs排序#refs。您没有指定是否要按姓氏升序和年份降序排序,这将需要更复杂的东西。

\n