1

I am using using XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/W32TeX). I need to have a prosodic map for a verse showing heavy and light syllables, like that shown on page 2 of this link. The example in the link uses macron and breve for heavy and light syllables, I use numbers 2 and 1 instead. I use longtable since the poem is quite long and the prosodic map will run into several pages.

The following does not compile

\documentclass[twoside]{book}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering}m{#1}}
\usepackage[top=2.25cm,left=1.25cm,bottom=1.5cm,right=1.25cm,paperwidth=120mm,paperheight=200mm]{geometry}
\begin{document}
\fontsize{9}{11.5}\selectfont
\begin{center}
\begin{longtable}{|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}|@{}C{6mm}@{}}
1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 2 & 2 \\
tu & ma & ma & ma & pri & ya & bha & ra & ta & hi & sa & ma & bha & i \\
\end{longtable}
\end{center}
\end{document}

I get the error

Extra alignment tab has been changed to \cr.
  • This looks like there is at least one & in your table. Count the numbers of column specifiers and the & and either add one column or remove the overhanging & ;'-) – user31729 Apr 21 '15 at 5:08
  • There are fourteen columns and exactly 13 &s in each line, which is what is expected. So the error is not that trivial.What is surprising is, if I comment any of the table rows, the file compiles successfully. I also tried this in Linux on pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4) and get the same result. – user22209 Apr 21 '15 at 5:52
1

You have to add \arrabackslash in

\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}

so that the meaning of \\ is not messed up. Further, for such repeated columns, you may use

{|*{14}{@{}C{6mm}@{}|}}

making code more readable.

\documentclass[twoside]{book}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage[top=2.25cm,left=1.25cm,bottom=1.5cm,right=1.25cm,paperwidth=120mm,paperheight=200mm]{geometry}
\begin{document}
\fontsize{9}{11.5}\selectfont
\begin{center}
\begin{longtable}{|*{14}{@{}C{6mm}@{}|}}
1  & 1  & 1  & 1  & 1   & 1  & 1   & 1  & 1  & 1  & 1  & 1  & 2   & 2 \\
tu & ma & ma & ma & pri & ya & bha & ra & ta & hi & sa & ma & bha & i
\end{longtable}
\end{center}
\end{document}

enter image description here

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.