Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using LyX to create some tables, but the numbering is complete borked.

In the LyX window, the table numbers are accurate. However, when I render to a PDF, they are evens only: 2, 4, 6 etc. (I'm sure I don't need to explain what even numbers are, but you get the point).

enter image description here

Delving into the source code generated:

\selectlanguage{english}%
~\foreignlanguage{british}{}
\begin{table}[H]
\begin{raggedright}
\begin{longtable}[l]{|r|>{\raggedright}m{0.8\textwidth}|c|}
\hline 
\selectlanguage{british}%
No.\selectlanguage{english}%
 & \selectlanguage{british}%
Requirement\selectlanguage{english}%
 & \selectlanguage{british}%
Priority\selectlanguage{english}%
\tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
\end{longtable}
\par\end{raggedright}

\selectlanguage{british}%
\caption{Test table}
\selectlanguage{english}%
\end{table}

This is a test table, hence no data. But, I did notice \begin{table} and \begin{longtable}.

Would I be correct in assuming this is the cause of the problem? If so, does any know how I can go about removing it?

N.b. I've been into the table settings and the long table checkbox is ticked but greyed out, so that's not much use.

share|improve this question
    
The syntax should be something like \begin{longtable}[l]{|r|>{\raggedright}m{0.8\textwidth}|c|} \caption{Test table}\\hline(...contents...)\end{longtable}. –  Gonzalo Medina Apr 11 '13 at 19:14
add comment

1 Answer

up vote 2 down vote accepted

The generated code is full of redundant (or even wrong) things. I don't understand why continuously switching between english and british, for instance: a document should use one English variety, either AmE or BrE.

Using longtable inside a table environment is completely useless. Just a tabular will do. And this is the cause of the wrong numbering, by the way.

The raggedright environment doesn't exist and using the environment form is bound to problems.

\begin{table}
\raggedright
\begin{tabular}[l]{|r|>{\raggedright}m{0.8\textwidth}|c|}
\hline 
No. & Requirement & Priority \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
 &  & \tabularnewline
\hline 
\end{tabular}

\caption{Test table}
\end{table}
share|improve this answer
    
Thanks for your answer egreg. I guess this is a prime example why using straight latex would be better. –  kyranjamie Apr 15 '13 at 20:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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