Hot answers tagged

41

If you need the bibliography sorted in order of appearance, use \bibliographystyle{unsrt} because the plain bib style sorts alphabetically by author. As an aside: your bib entries are wrong. Authors should be separated by and rather than commas: @article{ GatorTechSmartHouse, Author = {S. Helal and W. Mann and H. El-Zabadani and J. King and Y. ...


31

Taking some code from How to sort an alphanumeric list, a mild change to your interface works for sorting via the datatool package: \documentclass{article} \usepackage{datatool}% http://ctan.org/pkg/datatool \newcommand{\sortitem}[1]{% \DTLnewrow{list}% Create a new entry \DTLnewdbentry{list}{description}{#1}% Add entry as description } \newenvironment{...


29

An alternative is to define a bibfilter for the multiple entry types \defbibfilter{papers}{ type=article or type=inproceedings } and then \printbibliography[filter=papers]


26

This problem crops up all the time when you have citations in your captions, or probably less commonly in document division titles. By default, LaTeX uses the citations in the List of Figures, List of Tables, or Table of Contents as the "first" citation, since it occurs before the main body text. Options to fix this include: Adding the notoccite package to ...


19

you need to give these entries a sort field. you've actually chosen the easiest approach, sorting them in with the alphabetic entries. egreg has provided good examples for the first two: \index{k@$k$} and \index{c@$\mathcal{C}$} my suggestion for the * is \index{a sterisk@$\ast$} including a space after the a to make sure it sorts at the beginning. i'...


19

sorting=none does what you want. Only if you use \nocite{*} and therefore there is no citation order in the document does biber use the .bib order.


18

You can use the etaremune package; this requires redefining thebibliography to use it. I assume you are using the unsrt bibliography style. \begin{filecontents*}{\jobname.bib} @article{a, author={x y}, title={a}, journal={j}, year=2000, } @article{b, author={x y}, title={b}, journal={j}, year=2000, } @article{c, author={x y}, title={c}, journal={...


16

Sorting of the bibliography requires that you have an external database of entries rather than a hand built list. In your case your external file mybib.bib could be: @Article{art, author = {Art, John}, title = {John's Article}, journal = {J. Jour.}, year = 2006, volume = 7, pages = {12-45} } @Book{fart, author = {Fart, Peter}...


16

Adding sortlocale = nn_NO (nn for Norwegian nynorsk, nb for Norwegian bokmål) as a package option will ensure that Aa is treated as Å, and that Å is alphabetized last. Cf. the University of Oslo’s Local guide to biblatex. \documentclass{article} \usepackage{polyglossia} \setdefaultlanguage{nynorsk} \usepackage[style = authoryear, language = nynorsk, ...


15

As Egreg said, makeindex, which is used with imakeidx to produce index by default, doesn't support unicode. There is support for vietnamese in xindy, the other index processor. Unfortunately, there is some problem with pdflatex, Vietnamese language and xindy, because index entries are written as TeX sequences, not utf-8 codes, and xindy is unable to sort ...


15

Easy with xparse and expl3: \documentclass{article} \usepackage{xparse,expl3} \ExplSyntaxOn \NewDocumentCommand{\sortnumberlist}{m} { \clist_set:Nn \l_svend_numberlist_clist { #1 } \clist_sort:Nn \l_svend_numberlist_clist { \fp_compare:nTF { ##1 > ##2 } { \sort_return_swapped: } { \sort_return_same: } } \...


15

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 useful advantages of this approach is that it is fully expandable, meaning that after \edef\x{\sortlist{"World", "Hello"}} the macro \x will contain the sorted ...


14

It isn't really clear how these rules should be combined. Based on reference lists recently published in this journal it appears that any two-author paper should precede a three-or-more-author work having the same first author, regardless of chronology. A similar precedent holds for one-author and two-author works. You can achieve all this by copying the ...


13

Having different sorting within the text and the bibliography is currently possible with the development versions of biblatex and biber. (UPDATE: By now biblatey 2.x and corresponding biber are released and incuded in both MiKTeX and Texlive 2012.) The sorting scheme for citations has to be defined in the preamble. The sorting scheme for the bibliography is ...


13

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&compress]{natbib} This worked for me, it should work for you too.


13

The l3sort package does that (but currently with a merge sort, I hope you don't mind the speed-up), as long as the clist has at most 20000 items or so (I can't remember the exact limit). \documentclass{article} \usepackage{expl3, xparse} \ExplSyntaxOn \clist_new:N \l_my_clist \NewDocumentCommand{\sorted}{m} { \clist_set:Nn \l_my_clist {#1} \...


13

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]{biblat‌​ex} You will probably not need \DeclareLanguageMapping{british}{british-apa}, which is only necessary if you use the biblatex-apa style.


12

This functionality has been added to biblatex 2.0/biber 1.0. Simply define a custom sort scheme as follows: \DeclareSortingScheme{noneyear}{ \sort{\citeorder} \sort{\field{year}} } and use the noneyear scheme as the argument to either the global sorting option or the sorting option to the \printbibliography command. See biblatex 2.0 manual section 4.5.3. ...


12

Update the l3kernel and l3experimental packages. Here is some code that defines a sortbibliography environment, which (1) captures everything until \end{sortbibliography} (using the environ package, which you probably already have), (2) splits what it found (\BODY) into individual items (at every \bibitem), (3) removes whatever was before the first \bibitem (...


12

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 functional (if a bit hacky). In order to get the sorting in the bibliography right, we have to set useprefix=false at loading-time. E.g. \usepackage[style=...


12

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, washer. See ADDENDUM for handling (after a fashion) diacritics. \documentclass{article} \def\listterminator{;} \makeatletter \newcommand\alphabubblesort[1]{\def\...


12

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: rules are language-specific and need a lot of Unicode data. For simple sorting in English one can use the fact that the character codes for letters are '...


11

Natbib offers the \Citet command for languages where you usually use the lower case version, but not at the beginnig of a sentence. This command will make the van, von, di etc. upper case. Nothing stops you from using \Citet every where. This can be combined with your \noopsort solution: \documentclass{article} \usepackage[authoryear]{natbib} \usepackage{...


11

You can use the sort key to change the sort order. Also you should better put groups around the accents (see the paragraph before section 4.1. in the docu): \newacronym[sort=OEFFE]{oegd}{{\"O}GD}{{\"o}ffentlicher Gesundheitsdienst} You can also try to use xindy instead of makeindex.


11

The problem is that with inputenc and utf8 option, index files are written in a way that xindy cannot process. This sample: \documentclass[11pt]{article} \usepackage[T1]{fontenc} \usepackage[swedish]{babel} \usepackage[utf8]{inputenc} \usepackage{makeidx} \makeindex \begin{document} This kind of index in text: \index{Säker plats|textbf}Säker plats foo\...


11

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]{inputenc} \usepackage[sorting=none]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} \cite{herrmann}\cite{shore}\cite{aksin} \printbibliography[...


11

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 \printbibliography. \documentclass{article} \usepackage[backend=biber, style=authoryear-comp, sorting=ynt, % sortcites=true, % not needed here because it is ...


10

If you are using makeindex you can specify both the sorting string and the typeset version for the document. By default @ is the separator although it can be changed in the index style. \index{p-vector@$\mathcal{P}$-vector}


10

If you don't mind using gnuplot as the backend to PGFPlots, you can use the smooth unique option you mentioned. That's actually quite a good way to do it, because gnuplot is much faster at sorting than PGFPlotstable. \documentclass{standalone} \usepackage{pgfplots} \usepackage{filecontents} \begin{filecontents}{testdata.dat} x y 1 11 2 14 4 26 3 ...


Only top voted, non community-wiki answers of a minimum length are eligible