My scenario is to pass in a ratio (in fractional form as opposed to decimal form) to each table column definition.

The following code cannot be compiled.





A & B \tabularnewline\hline
A & B \tabularnewline\hline

  • 1
    Josephs solution works for me (after adding \end{longtable} to the code).
    – Caramdir
    Dec 28 '10 at 11:10
  • It seems to me that your #1\linewidth-2\tabcolsep-2\arrayrulewidth doesn't work. I'm not sure what's happening, but I get a "-2" in the table. Dec 28 '10 at 12:59
  • @Hendrik, you need calc.sty.
    – xport
    Dec 28 '10 at 13:03
  • Then why didn't you include \usepackage{calc} in your code above? I'd suggest you remove the whole piece starting from "Joseph's solution does not work"; his code does work. You just forgot \end{longtable} as the error message says and as Caramdir already noted. Dec 28 '10 at 13:18
  • @Hendrik, I did not read well. Yes. It works :-) We need copy to clipboard button.
    – xport
    Dec 28 '10 at 13:21

You cannot use \pgfmathsetratio here, as the arguments to the m box needs to expand to a number. Assuming you can use the e-TeX extensions then you can use an alternative definition:

  • thanks for the solution. It works after correcting my own code.
    – xport
    Dec 28 '10 at 13:29

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.