From Wiki
< Command
Revision as of 05:10, 24 January 2023 by Elandi (talk | contribs) (Removed some words. This reflects the idea better. There is no need for the list to be in a single line, it can become a paragraph using \crlf as separator.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search



The command \commalistsentence is used to present a comma separated list of values (like an author list, for example), with the option of changing the separator of the items and have a distinct separator for the last item of the list.



A comma separated list of items. Use {} to group items that contain commas, spaces or other special characters.
text a,b,c,d,e,{f, g, h},i,j
An array with two (2) items, describing the separator for each item, and the separator between the last element and the one preceding it. This item is optional.
text [{ \& },{ and }] % result: a & b & c & d & e & f, g, h & i and j


This is an useful command for creating lists where you want to output the last item in a different way than the rest, for example, on a list of authors, or publishers.


Some simple lists





\commalistsentence[a,b,c][{ \& },{ and }]



A list of authors

  {John Smith, Ph.~D.},
  {Michel Witggenstein, M.~Sc.},
  {Zoraya Montoya-Velásquez, M.~Sc.},
  {Satoshi Ota, Ph.~D.},
  {Oba Odumo, M.~Sc.},
  {Ivan Ilich, Ph.~D}%
\commalistsentence[\Authors][{;\space},{\space\letterampersand\space}]: authors.



See also

Help from ConTeXt-Mailinglist/Forum

All issues with: