Discussion:
Problem mit \hline (Misplaced \noalign)
(zu alt für eine Antwort)
Matthias Pospiech
2007-12-04 09:07:19 UTC
Permalink
In folgendem Code

%-----------------------------
\documentclass{article}
\usepackage{array}
\usepackage{tabularx}
\usepackage{color}
\usepackage{float}
\newenvironment{Details}%
{%
\minipage[t]{0.5\textwidth}%
\table[H]%
\centering%
\tabularx{1.0\linewidth}{|p{0.5\linewidth}X|}%
\hline
}%
{%
\hline\endtabularx
\endtable
\minipage%
}%

\begin{document}
\mbox{}
\begin{Details}
Laser & TiSA, 100\,fs, 25\,MHz, 5nJ \tabularnewline
\end{Details}
\end{document}
%-----------------------------

tritt der folgende Fehler auf:
%-----------------------------
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \let \hskip \vskip \let \vrule \hrule
\let...
l.64 \end{Details}

I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
%-----------------------------

Lösung?

Matthias
Rolf Niepraschk
2007-12-04 09:18:52 UTC
Permalink
Matthias Pospiech schrieb:
...
Post by Matthias Pospiech
{%
\minipage[t]{0.5\textwidth}%
\table[H]%
"\table" weg. Wozu soll das gut sein?

...Rolf
Matthias Pospiech
2007-12-04 09:43:03 UTC
Permalink
Post by Rolf Niepraschk
...
Post by Matthias Pospiech
{%
\minipage[t]{0.5\textwidth}%
\table[H]%
"\table" weg. Wozu soll das gut sein?
Es ist zwar richtig dass ich das hier wirklich nicht brauche. Aber mit
meinem Problem hat das nichts zu tun.

Matthias
Markus Kohm
2007-12-04 10:04:30 UTC
Permalink
Post by Matthias Pospiech
\hline\endtabularx
tabularx-Anleitung nicht gelesen?

The scanner now looks for the end of the current environment (foo in this
example.) There are some restrictions on this usage, the principal one
being that \endtabularx is the first token of the `end code' of the
environment.

Du musst also das \hline in den `begin code' verschieben, beispielsweise per
(ungetestet!):

\let\***@saved@endtabular\endtabular
\def\endtabular{\hline\***@saved@endtabular}%

Gruß
Markus
--
Gruppenhinweise (auch Minimalbeispiel) --> http://www.latex-einfuehrung.de
Fragen zu LaTeX? --> http://www.dante.de/faq/de-tex-faq/
Fragen zu KOMA-Script? --> Anleitung z. B. auf CTAN (--> FAQ);
--> http://www.komascript.de
Herbert Voss
2007-12-04 10:04:41 UTC
Permalink
Post by Matthias Pospiech
Lösung?
\documentclass{article}
\usepackage{calc}
\newsavebox\TBox
\newenvironment{Details}{%
\centering
\begin{lrbox}{\TBox}
\tabular{|p{0.25\linewidth}p{0.25\linewidth-4\tabcolsep}|}\hline
}{%
\hline\endtabular
\end{lrbox}\usebox\TBox\par}%

\begin{document}

\begin{Details}
Laser & TiSA, 100\,fs, 25\,MHz, 5nJ \tabularnewline
\end{Details}

\medskip
\centering
\rule{0.5\linewidth}{1pt}
\end{document}


Herbert
--
http://PSTricks.tug.org
http://www.dante.de/CTAN/info/math/voss/
Rolf Niepraschk
2007-12-04 10:07:56 UTC
Permalink
Probier es so oder ähnlich:

\documentclass[draft]{article}
\usepackage{array}
\usepackage{tabularx,framed,calc}
\usepackage{color}
\newenvironment{Details}%
{%
\noindent\framed
\tabularx{\linewidth-2\fboxsep-2\fboxrule}{XX}%
}%
{\endtabularx\endframed}%

\begin{document}
\mbox{}
\begin{Details}
Laser & TiSA, 100\,fs, 25\,MHz, 5nJ \tabularnewline
\end{Details}
\end{document}
%-----------------------------

...Rolf

Loading...