WinEdt Macro Library  | LaTEX previous macro  | next macro


This macro is part of the bibMacros package but can be used without it.


Sorts a bibliography database.

Sort Bibliography dialogWhen using WinEdt 5.5 with its new (internal) MUI, you'll see the advanced dialog on the right; for previous WinEdt versions you need the external MUI Plug-In, which will show a similar dialog.

You can specify two sort criteria. Besides the obvious year, crossref, etc., you can also put something like author|editor in there which means "author OR editor" (using WinEdt's Regular Expressions). Furthermore, there are two special keys:

  • KEY is the cite key (i.e. the key you \cite).
  • TYPE means the type of entry (e.g. "BOOK", "ARTICLE", etc.).

You can set the sorting order for each criterion.

Additionally, all cross-referenced entries can be moved to the end of the file, which is required by BibTeX.

If the bibliography is to be sorted by author or editor, you can set the maximum number of names relevant for sorting.

Finally, you may also select part of a bibliography file, and sort this part only. Thus, you could even sort by more than two criteria. This option is only shown if something is actually selected.

The macro is able to parse names so that sorting is by last name, and -- if you are using it as a part of the bibMacros package -- can expand @STRINGs before sorting.


Put the macro in %b\Macros\LaTeX\, and assign a shortcut to it if you want.

Or download the bibMacros package which includes all BibTEX related macros (and some more).


LaTeX/bibSort.edt (version for WinEdt 5.5)

LaTeX/bibSort54.edt (version for WinEdt 5.4 or previous, which also requires the MUI plug-in)

Macro contributed by Robert <>.

WinEdt Macro Library  | LaTEX previous macro  | next macro