Environment inside a longtable with LaTeX -


I I would like to create a new environment for printing headers and footers between sections of a table .

I did this:

  \ documentclass {article} \ usepackage {longtable} \ newenvironment {env} {heading end; Amp; \\} {\ hline \\} \ start {document} \ begin {longtable} {p {7cm} lrr} \ begin {env} content & amp; Amp; Amp; Amp; Amp; & Amp; D \ end {env} \ end {longtable} \ end {Document}  

But I am humiliated by the compiler. See for full output.

Does anyone see a problem?

Two problems here first of all, you " content and B & C and D D "requires a \\ at the end of the line Second, the environment table / do not work within the long time & mdash; This is the place where most of your error messages are coming, it may be possible to work, but it is beyond Texfu. This is the best I can come up with:

  \ documentclass {article} \ usepackage {longtable} \ newcommand {\ startenv} {heading \ tabularnewline} \ newcommand {\ stopenv} {\ Hline \ Tabularnewline} \ start {document} \ start {longtable} {p {7cm} lrr} \ startenv content & amp; Amp; Amp; Amp; & Amp; Amp; D \\ \ stopenv \ end {longtable}  

This is strictly necessary to use \ tabularnewline instead of \\ No, but it will be to avoid headaches if you ever mix with other environments which \\ for their own purposes.)


Comments