22
votes
Accepted
How can I sort a list numerically?
This approach automatically orders the items by year or any other number, by using an external list on an .csv file.
\documentclass{article}
\usepackage{filecontents} % To create an external .csv file
...
21
votes
Accepted
Sort bibliography in order of appearance
You cannot mix BibTeX and biblatex.
In your code remove \bibliographystyle{unsrt} (which is BibTeX language) and load biblatex with sorting=none
\usepackage[backend=biber,style=numeric,sorting=none]{...
15
votes
Accepted
Biblatex handling of Dutch "van" prefix
With a current biblatex version I recommend the slightly longer, but conceptually cleaner solution presented in Prefixes in author names in references and bibliography. The answer here still remains ...
15
votes
Accepted
Sort Numbers After Their Values
Easy with xparse and expl3:
\documentclass{article}
\usepackage{xparse,expl3}
\ExplSyntaxOn
\NewDocumentCommand{\sortnumberlist}{m}
{
\clist_set:Nn \l_svend_numberlist_clist { #1 }
\clist_sort:...
15
votes
Sorting a comma-separated list with LaTeX?
How about Lua?
\def\sortlist#1{%
\directlua{%
local t = { #1 }
table.sort(t)
tex.sprint(table.concat(t,", "))
}%
}
\sortlist{"World", "Hello"}
\bye
Addendum: One of the really ...
14
votes
LaTeX/BibTex not arranging citations by order of appearance
In Document»Settings»Bibliography choose the Default (numerical) bibliography style. And then go to Latex preamble section and write this code:
\bibliographystyle{unsrtnat}
\usepackage[numbers,sort&...
14
votes
Accepted
Biblatex: how to automatically sort citation by year (sortcites=ynt) when references are sorted by name (sorting=nyt)
Give the desired citation sort order at loading time. Then give the desired order for the bibliography in the new refcontext (\begin{refcontext}[sorting=<sorting>]...\end{refcontext}) for \...
13
votes
Accepted
Sorting a comma-separated list with LaTeX?
This seems to work, with no packages. EDITED to solve the upper/lower-case problem.
EDIT: Resolved problem when a comparison ran out of letters prior to resolving the order, for example, wash, ...
12
votes
Accepted
Lexicographic ordering in expl3
At present there are no built-in methods for such textual comparisons (there are generic sorting wrappers but one has to supply the comparison code). The reason for this is that sorting is complex: ...
12
votes
How can I sort a list numerically?
You could make use of the glossaries package as shown in the following example:
\documentclass{article}
\usepackage[automake, nonumberlist]{glossaries}
\newglossaryentry{1912}{name={1912}, ...
11
votes
Accepted
biblatex: cite without affecting sorting order
Here's a solution, and although it requires some manual intervention it is much less hacky than your external script solution. Furthermore, as I show at the end, we can automate it quite easily.
The ...
11
votes
Accepted
The same bibliography with different sorting
What about using \newrefcontext before each \printbibliography (apart the first which is under the context of the default sorting option of biblatex).
\documentclass{article}
\usepackage[utf8]{...
11
votes
Accepted
Regex replacement for biblatex/biber to eliminate the warning "month not integer..."
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite]{
\step[fieldsource=month, match=\regexp{\A(j|J)an(uary)?\Z}, replace=1]
\step[fieldsource=month, match=\regexp{\A(f|F)eb(...
10
votes
Cleveref isn't sorting nested lists properly
Turns out @Karalga's explanation of the cause of this bug points in the right direction, but doesn't get to the bottom of the problem. Sorting of nested list labels was broken for two completely ...
10
votes
Expandable (quick) sort array macro?
A short demo using l3sort:
\documentclass{article}
\usepackage{expl3,l3sort,xparse}
\ExplSyntaxOn
\cs_set:Npn \quicksort_fp:nnTF #1#2
{ \fp_compare:nNnTF {#2} > {#1} }
\...
10
votes
Sorting a comma-separated list with LaTeX?
You can safely compare strings consisting of ASCII characters; words with accented characters will not work.
\documentclass{article}
\usepackage{expl3,l3sort,xparse}
\ExplSyntaxOn
\...
10
votes
Accepted
Order table by row alphabeticaly
A proof of concept, using an idea from https://tex.stackexchange.com/a/356777/4427
\documentclass{article}
\usepackage{geometry}
\usepackage{longtable}
\usepackage{xparse}
\ExplSyntaxOn
\...
10
votes
How can I sort a list numerically?
If you prefer the solution to be as close to your syntax as possible:
\documentclass{article}
\usepackage{expl3}
\usepackage{xparse}
\usepackage{enumitem}
\usepackage{xcolor}
\begin{document}
\...
9
votes
How to sort entries in a .bib file with biber
For anyone using a more recent version of biber, the element names have changed slightly. As of biber 2.11, sorting is now sortingtemplate name="tool". This config file works for me:
<config>
...
9
votes
Accepted
Using Bibtool to sort a bib file by types and keys alphabetically
Following the example on page 60 of the BibTool manual, the type can be specified with %s($type).
Example:
@misc{def,
note = {misc entry 1}
}
@article{xyz,
author = {John Doe},
title = {...
8
votes
Accepted
How to sort entries in a .bib file with biber
Actually with biber 2.3, which is what you are using, it should work with a suitable <sorting> specification in your biber.conf. There was a bug in 2.4, fixed in the 2.5 dev version currently on ...
8
votes
Accepted
Put Chinese-language entries before English-language entries in the bibliography
You could use the \noopsort device to place the Chinese-language entries ahead of the remaining entries. The macro \noopsort takes 1 argument and is defined as follows:
\newcommand{\noopsort}[1]{}
...
8
votes
Using Bibtool to sort a bib file by types and keys alphabetically
If you are using Biber you can use the following sort.conf
<?xml version="1.0" encoding="UTF-8"?>
<config>
<output_align>true</output_align>
<output_fieldcase>lower&...
7
votes
Sort thebibliography by citation order
I'd already created 150 references in a document using thebibliography, and was faced with the task of sorting them in order of first appearance in the text (a very common requirement in scientific ...
7
votes
Index in Swedish sorting order ( ...YZÅÄÖ...) with xindy and LaTeX
In his answer michal.h21 has identified the problem and found the problem in the way, UTF-8 characters are written, if \usepackage[utf8]{inputenc} is used:
\IeC{<LICR>}% LICR = LaTeX Internal ...
7
votes
How to change a .bst for references sorted in order of appearance
The zip file has only splncs03.bst which uses alphabetical order. However, Springer also provides splncs.bst that uses order of appearance. You can download it at
ftp://ftp.springer.de/pub/tex/latex/...
7
votes
Accepted
Order by first author only (not all names) than by year or Sort by a partial entry in biblatex
How I commented in your question I see two possibilities for sorting the bibliographies entries:
The first: Using only the Last Name of the First Author
How you are using biber, you are able to use ...
7
votes
Accepted
Cleveref isn't sorting nested lists properly
Usually, counters in latex reference their parent counter when being initialised: \newcounter{NameOfTheNewCounter}[NameOfTheOtherCounter]. This way, the \label command can access all the parents in ...
7
votes
Accepted
wrong sorting in index (ligatures) \/
makeindex can only sort alphabetic entries, so if you need to add markup to the typeset form (\/ here) then you need to supply a separate sort key, so the entries need to be something like:
\index{...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sorting × 559biblatex × 174
bibliographies × 118
bibtex × 107
indexing × 57
natbib × 45
biber × 39
citing × 29
glossaries × 27
cross-referencing × 16
lists × 16
nomenclature × 14
tables × 13
macros × 12
apa-style × 12
acronyms × 11
subdividing × 11
xindy × 11
itemize × 9
datatool × 9
makeindex × 9
enumerate × 8
imakeidx × 8
table-of-contents × 7
alphabet × 7