1

I have made a long table, somehow it showed an error in the line where has a very short content (ShoL & shoulder left\).

I have checked similar questions from this forum. I can´t use tabularx under longtable environment, is that true? If yes, where should I put \begin{tabularx}? I have tried to put \begin{tabularx} after \begin{longtable} before \caption, with \usepackage:tabularx in preamble of course, but it turned out just more errors.

I have also tried the solution with \begin{sloppypar} \end{sloppypar}, also didn´t work.

The current error msg is:

! Undefined control sequence.
<argument> ...ibnameprefix {of}\isdot \ifprefchar
{} {} {\ifuseprefix {\bibn...
l.168

The control sequence at the end of the top line
of your error message was never `\def`'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Overfull `\hbox` (81.02432pt too wide) in paragraph at lines 168--168

    \T1/lmr/m/n/12 (-20) [Ac-cessed on Septem-ber 20, 2016], Avail-able on : http:/
/www.sunyem.com/simulation/overview/.

My script is under, in order to present a short script, I have delete many lines from the table, so now it´s not that long :

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{array, booktabs, caption}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{longtable}
\setlength{\tabcolsep}{10pt}
\renewcommand{\arraystretch}{1.5}

\begin{document}
\begin{longtable}{ll}
\caption{List}
\label{tab:Ch2VCOB}\\
\hline
\multicolumn{2}{l}{Components:} 
\endfirsthead

\multicolumn{2}{c}%
{{\tablename\ \thetable{} continued from previous page}} \\
\hline \multicolumn{1}{l}{}  
\endhead

\hline \hline
\endlastfoot
\multicolumn{1}{l}{Joints <joi>} 
\tabularnewline
Free    &       free - joint beween inertial and midhip\\
Navl    &       navel - joint between lower and middle\\& trunk\\
Subs    &       substernal - joint between middle and upper \\
        &       trunk\\
Cerv    &       cervicular - joint between neck and upper \\&trunk\\
Atls    &       atlas - joint between head and neck\\
ShoR    &       shoulder right\\
ElbR    &       elbow right\\
WriR    &       wrist right\\
ShoL    &       shoulder left\\
ElbL    &       elbow left\\
WriL    &       wrist left\\
HipR    &       hip right\\
KneR    &       knee right\\
AnkR    &       ankle right\\
HipL    &       hip left\\
KneL    &       knee left\\
AnkL    &       ankle left\\
\end{longtable}
\end{document}

Thank you in advance

David Carlisle
  • 757,742
Vivian
  • 379
  • 1
    The example code compiles with no error and no overfull. – egreg Nov 22 '16 at 10:24
  • Use the package ltxtable if you want to combine longtable with tabularx. – Arash Esbati Nov 22 '16 at 10:30
  • Or ltablex: tabularx environment, with the same syntax as longtable (\endhead, endfoot and the like). – Bernard Nov 22 '16 at 10:41
  • 1
    the error message you show is unrelated to the code you have posted. – David Carlisle Nov 22 '16 at 10:42
  • what does the error msg suppose to mean? It´s sth with overfull\hbox in the table, but actually not the line where it indicated in the error msg, is that so? @DavidCarlisle – Vivian Nov 22 '16 at 11:19
  • 1
    The error message is unrelated to overfull boxes or tables: it is simply that you have used a command \ifprefchar that has not been defined. The line number is probably the line number of the generated bibliography file, impossible to tell from the segment you have posted (and unrelated to the code you posted) – David Carlisle Nov 22 '16 at 13:19
  • How can I solve this problem? I can´t find \ifprefchar or \ifuseprefix in my script at all.. @DavidCarlisle In the begining I thought it´s because I don´t have Jabref (for managing my bibliography) in the computer, but after I installed it, it still has the same error. – Vivian Nov 24 '16 at 18:55
  • No one can help you with the undefined command unless you show some related code (why did you show the table? the problem is somewhere in your bibliography) all we can say is that some code you have not shown is using some command that you have not defined. – David Carlisle Nov 24 '16 at 19:10
  • I thought the error is from the table, can you check my new question? Thanks http://tex.stackexchange.com/questions/340804/undefined-control-sequence-problem-with-printbibliography @DavidCarlisle – Vivian Nov 24 '16 at 19:15
  • 1
    @Vivian the new question again posts code that is unrelated to the error. Look it is really easy for you to check that the example you make generates the error before you post the question. It's not possible for anyone to tell you what is wrong with code they can not see, so it has to be you that does it. – David Carlisle Nov 24 '16 at 19:22

1 Answers1

2

Try

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{caption}
\usepackage{multicol}
\usepackage{array, booktabs, multirow, longtable}
\usepackage{ltablex} %  <-- added (as suggested by Bernard in his comment)
\keepXColumns
\setlength{\tabcolsep}{10pt}
\renewcommand{\arraystretch}{1.5}

\usepackage{lipsum} % <-- added for dummy text

\begin{document}

\begin{tabularx}{\textwidth}{lX} %  <-- changed from \begin{longtable}
    \caption{List}
\label{tab:Ch2VCOB}\\
    \toprule
\multicolumn{2}{l}{Components:}
\endfirsthead

\caption{continued from previous page} \\
    \toprule
\endhead

\bottomrule
    \endlastfoot
\multicolumn{1}{l}{Joints <joi>}
\tabularnewline
Free    &       free - joint beween inertial and midhip\\
Navl    &       navel - joint between lower and middle trunk\\
Subs    &       substernal - joint between middle and upper trunk\\
Cerv    &       cervicular - joint between neck and upper trunk\\
Atls    &       atlas - joint between head and neck\\
ShoR    &       shoulder right\\
    test    &   \lipsum[1]  \\  % added for test if long table works
ElbR    &       elbow right\\
WriR    &       wrist right\\
ShoL    &       shoulder left\\
ElbL    &       elbow left\\
WriL    &       wrist left\\
HipR    &       hip right\\
KneR    &       knee right\\
AnkR    &       ankle right\\
HipL    &       hip left\\
KneL    &       knee left\\
AnkL    &       ankle left\\
\end{tabularx}  %  <-- changed
\end{document}

enter image description here

For final table form you need to compile table twice.

Edit: Many people prefer ltxtable instead of ltablex because the later turns all tabularx tables environment to longtable. For use of ltablex see David Carlisle answer here.

Zarko
  • 296,517
  • I took the liberty and edited your answer: ltablex was suggested by Bernard, I suggested ltxtable. I don't recommend ltablex since it turns all tabularx to longtables, but that's only my taste. – Arash Esbati Nov 22 '16 at 10:51
  • Thank you for correction. Many people recommend to use {ltxtable}. I will add this to my answer. – Zarko Nov 22 '16 at 11:11
  • Hi Zarko, thanks for your answer, but it comes out errors when I run your script . "This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: test1.aux I found no \citation commands---while reading file test1.aux I found no \bibdata command---while reading file test1.aux I found no \bibstyle command---while reading file test1.aux ". Do you have an idea why the errors come? @Zarko – Vivian Nov 22 '16 at 11:11
  • 1
    @Vivian, sorry, but this is different problem for new question. Your MWE as well proposed solution don't generates any error. In your MWE is nothing about bibliography, so nor in mine answer. SO, I can't said anything about this. – Zarko Nov 22 '16 at 11:22
  • @ArashEsbati Could you give an example how I can use ltxtable? I didn´t find a proper one. I tried to create a table with ´tabularx´ and saved it as mylongtable.tex, and used ´\LTXtable{\textwidth}{mylongtable}´ to load it, but it comed an error ´! TeX capacity exceeded, sorry [text input levels=50].´ and ´! ==> Fatal error occurred, no output PDF file produced!´. How can I use ´tabularx´for longtable? If I put ´\begin{longtable}´ after ´\begin{tabularx{\textwidth}{lX}}´, these 2 errors still appear – Vivian Nov 22 '16 at 11:39
  • I have tried your solution "ltablex" with my complete table data, the same error remains, just the indication is now in another row "! Undefined control sequence. ...ibnameprefix {of}\isdot \ifprefchar......" – Vivian Nov 22 '16 at 11:57
  • @Bernard I have tried the "ltablex" with my complete table data, but the same error remains, but now the error indicated in another row. "! Undefined control sequence. ...ibnameprefix {of}\isdot \ifprefchar {} {} {\ifuseprefix {\bibn... l.173....." – Vivian Nov 22 '16 at 11:59
  • 1
    @Vivian, your error is not seems to be linked to ltablex. You should have something in table content which cause this error. Strip down your real table to row(s), which cause it and than ask new question regarding this cause. – Zarko Nov 22 '16 at 12:12
  • The example from the link is what I need! I do need some extra symbols to make the longtable with tabularx style :) Which I didn´t find a proper example before. Thanks a lot! @Zarko – Vivian Nov 22 '16 at 12:51
  • 1
    @Vivian: The code doesn't contain any citations so the messages of bibtex are correct. Don't run bibtex with such a minimal example if you don't want to get them. Or ignore the messages. – Ulrike Fischer Nov 22 '16 at 13:15