8

Consider:

\documentclass[oneside,12pt]{article}
\usepackage{tabulary}
\usepackage{booktabs}
\begin{document}
\begin{table}
    \center
    \begin{tabulary}{22cm}{L C}
        \toprule
        \bfseries{111} & \bfseries{222}  \\
        \midrule
        \textit{row1}  & a   \\
        \bottomrule
        \multicolumn{2}{L}{\textit{iii}}  \\
    \end{tabulary}
    \caption
      [abc]
      {def}
  \label{tab:my}
\end{table}
\end{document}

This is my MWE.

I got three errors:

1) ! Missing number, treated as zero.
2) ! Illegal unit of measure (pt inserted).
3) ! Undefined control sequence. <argument> \TY@F3

And all errors are for the \end{tabulary} line. I have no clue how to figure out what's wrong here, how to "debug" this. How do I find the errors?

fuuman
  • 183

1 Answers1

6

If you use

 \multicolumn{2}{l}{\textit{iii}} 

with a standard l not L in the multicolumn then it works.

In this case there isn't really any sane way to debug it (other than reading the package source), you just need to complain to the package author that (a) it probably shouldn't be an error to use L there and (b) if it is an error the error reporting could be better.

Meanwhile \center isn't intended to be used as a command, use \centering, \bfseries does not take an argument so \bfseries{111} could better be written \bfseries 111 and article does not have options ba, m or palatino

David Carlisle
  • 757,742
  • Please also mention \bfseries with parameters... – TeXnician Sep 10 '17 at 11:51
  • @TeXnician oh must say I didn't even notice that (or look at the typeset output) I was rather concentrating on TF@3 :-) – David Carlisle Sep 10 '17 at 11:52
  • Often, I cannot even understand what the Latex error messages means. That makes it really hard to figure out what's happening. I am just praying everytime I compile. But thank you, it works. But what the point with TF3? What does this says to you? – fuuman Sep 10 '17 at 11:55
  • @fuuman since it's my code I know what it means (it is trying to find the specification of the third column in a two-column table...) but it isn't supposed to be exposed in an end-user error message. As for why it's looking for column 3 I'm not sure, if you had asked 20 years ago I would have known more quickly... – David Carlisle Sep 10 '17 at 11:59
  • Oh, wow. I see, you are a real expert. I was playing in the sand 20 years ago xD Thanks for your help, appreciate it! – fuuman Sep 10 '17 at 12:08