{"id":352,"date":"2013-06-03T11:55:09","date_gmt":"2013-06-03T16:55:09","guid":{"rendered":"http:\/\/www.melaniehayn.com\/blog\/?p=352"},"modified":"2013-06-03T12:33:19","modified_gmt":"2013-06-03T17:33:19","slug":"citation-language-sorting-problem-solved-for-now","status":"publish","type":"post","link":"https:\/\/www.melaniehayn.com\/blog\/citation-language-sorting-problem-solved-for-now\/","title":{"rendered":"Citation language sorting problem: solved!"},"content":{"rendered":"<p>I&#8217;ve been having a lot of difficulty with the various citation management software packages based on the CSL language, as none has a built-in style that aligns with how we&#8217;ve always formatted our citations, particularly the sort order. <\/p>\n<p>From my understanding, what we want for citations by the same first author:<br \/>\n&#8211; single author pubs in chronological order (oldest first)<br \/>\n&#8211; multi-author pubs in chronological order (oldest first)<\/p>\n<p><p>This morning I finally did the research to come up with a solution that appears to work!<\/p>\n<p>This should sort all papers by their first author. Then within that, it sorts between single-author and multi-author papers. Within each of those categories it searches by year<\/p>\n<p><\/p>\n<h4>Method 1: via a direct CSL code editor<\/h4>\n<p style=\"padding-left: 30px;\">In the macro section, add the following macro:<\/p>\n<p style=\"padding-left: 60px;\">&lt;macro name=&#8221;Author-count&#8221;&gt;<\/p>\n<p style=\"padding-left: 70px;\">&lt;names variable=&#8221;author&#8221;&gt;<\/p>\n<p style=\"padding-left: 80px;\">&lt;name form=&#8221;count&#8221; et-al-min=&#8221;3&#8243; et-al-use-first=&#8221;2&#8243;\/&gt;<\/p>\n<p style=\"padding-left: 70px;\">&lt;\/names&gt;<\/p>\n<p style=\"padding-left: 60px;\">&lt;\/macro&gt;<\/p>\n<p style=\"padding-left: 30px;\">Then, in the &lt;bibliography&gt; section, specify your sort as:<\/p>\n<p style=\"padding-left:60px;\">&lt;sort&gt;<\/p>\n<p style=\"padding-left:70px;\">&lt;key macro=&#8221;author-short&#8221; names-min=&#8221;2&#8243; names-use-first=&#8221;1&#8243;\/&gt;<\/p>\n<p style=\"padding-left:70px;\">&lt;key macro=&#8221;Author-count&#8221;\/&gt;<\/p>\n<p style=\"padding-left:70px;\">&lt;key macro=&#8221;year&#8221;\/&gt;<\/p>\n<p style=\"padding-left:60px;\">&lt;\/sort&gt;<\/p>\n<p><\/p>\n<h4>Method 2: via csl.mendeley.com\/visualEditor\/<\/h4>\n<p style=\"padding-left: 30px;\">1) add a new macro<\/p>\n<p style=\"padding-left: 60px;\">&#8211; named author-count<\/p>\n<p style=\"padding-left: 60px;\">&#8211; add an element for names<\/p>\n<p style=\"padding-left: 60px;\">&#8211; add an element to names for variable &#8216;name&#8217;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; under &#8220;form&#8221; select &#8220;count&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; under &#8220;et-al-min&#8221; select &#8220;3&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; under &#8220;et-al-use-first&#8221; select &#8220;2&#8221;<\/p>\n<p style=\"padding-left: 30px;\">2) under sort, first use a macro for &#8220;author-short&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; specify &#8220;names-min&#8221; as &#8220;2&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; specify &#8220;et-al-use-first as &#8220;1&#8221;<\/p>\n<p style=\"padding-left: 30px;\">3) under sort, then add a macro for &#8220;author-count&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; leave all options blank (default)<\/p>\n<p style=\"padding-left: 30px;\">4) under sort, add a 3rd macro for &#8220;year&#8221;<\/p>\n<p style=\"padding-left: 60px;\">&#8211; leave all options blank (default)<br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been having a lot of difficulty with the various citation management software packages based on the CSL language, as none has a built-in style that aligns with how we&#8217;ve always formatted our citations, particularly the sort order. From my understanding, what we want for citations by the same first author: &#8211; single author pubs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/posts\/352"}],"collection":[{"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/comments?post=352"}],"version-history":[{"count":10,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/posts\/352\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/posts\/352\/revisions\/362"}],"wp:attachment":[{"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/media?parent=352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/categories?post=352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melaniehayn.com\/blog\/wp-json\/wp\/v2\/tags?post=352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}