Text FormattingAlphabetizing Transcriptions

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
lagodion
Posts: 1
Joined: Thu Jul 28, 2011 6:40 pm

Alphabetizing Transcriptions

Post by lagodion »

Hi, I am attempting to alphabetize a list of Akkadian vocabulary (in transcription) employing the semtrans package.
I am using the method of alphabetizing a list from http://www.latex-community.org/forum/vi ... =45&t=8919 which works excellently, except when I wish to have the letter h with a breve underneath. I run into problems if it is not the first element: for example,

Code: Select all

\sortitem{\U{h}alaqum}{to escape}

works absolutely fine, but

Code: Select all

\sortitem{ma\U{h}\=a\d{s}um}{to strike}

does not.

Is there any way around this? Or ought I employ another means of alphabetizing? Or is there another way of producing the same letter \U{h} that will work? Apologies if I am asking a stupid question or missing something very obvious. Example follows below.

Code: Select all

\documentclass{article}
\usepackage{datatool}
\usepackage{semtrans}
\usepackage{graphicx}


\newcommand{\sortitem}[2]{%
  \DTLnewrow{list}%
  \DTLnewdbentry{list}{label}{#1}%
  \DTLnewdbentry{list}{description}{#2}%
}

\newenvironment{sortedlist}%
{%
  \DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}%
}%
{%
  \DTLsort{label}{list}%
  \begin{description}%
    \DTLforeach*{list}{\theLabel=label,\theDesc=description}{%
      \item[\theLabel] \theDesc
    }%
  \end{description}% 
}

\begin{document}

\begin{sortedlist}

\sortitem{\U{h}alaqum}{to escape}
\sortitem{ma\U{h}\=a\d{s}um}{to strike}

\end{sortedlist}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Alphabetizing Transcriptions

Post by nlct »

There's a problem with expansion, so it might be easiest to make a robust command to do the h with a breve under it. For example:

Code: Select all

\DeclareRobustCommand{\hbreve}{\U{h}}
Then use this command instead:

Code: Select all

\sortitem{ma\hbreve\=a\d{s}um}{to strike}
Regards
Nicola Talbot
Post Reply