3

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.

1
  • The syntax should be something like \begin{longtable}[l]{|r|>{\raggedright}m{0.8\textwidth}|c|} \caption{Test table}\\hline(...contents...)\end{longtable}. Commented Apr 11, 2013 at 19:14

1 Answer 1

2

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}
1
  • Thanks for your answer egreg. I guess this is a prime example why using straight latex would be better.
    – kyranjamie
    Commented Apr 15, 2013 at 20:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .