Recently I used LyX to prepare a list with 200+ guest names for a wedding (page 1 illustrated below). Actually, it was a table including invited family names, the number of persons of each invited family, the number of the table given to the family and an alternative table number.

Table of families invited in a wedding, alphabetically sorted (1st column)

The table was initially created in a spreadsheet and afterwards extracted as a csv file which was the basis for the final "guest list". The family names (1st column of the table) were already alphabetically sorted. Small caps were applied for family names, alternate table row-coloring (for a longtable within LyX), bold numbers referring to the tables and other font details.

In addition, I manually inserted capital letters, just before family names started with a "new" letter, to give the sense of alphabetically grouped names and ease tracing them when the moments come were 50~100 people altogether, waiting in the entrance of the event hall, expect to be guided to their table.

The question: is there a way to automatically insert single rows with capital letters as "breakpoints" (as shown in the attached page above) using a "normal", sorted, column of names? And how about automatically adding some custom command in each of the "letter"-rows, like for example \hiderowcolors{} and \showrowcolors{} in each following row? I imagine that something like this could be useful to create easier to read long "guests lists".


It's probably easier to get the spreadsheet to add the headings as it writes the csv file but anyway If you want Tex to do it, then something like this:

enter image description here





\ifcat a\noexpand#2%




Apple & 2\\
Artichoke &3\\


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.