Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem mit \hline (Misplaced \noalign)

564 views
Skip to first unread message

Matthias Pospiech

unread,
Dec 4, 2007, 4:07:19 AM12/4/07
to
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

unread,
Dec 4, 2007, 4:18:52 AM12/4/07
to
Matthias Pospiech schrieb:
...

> {%
> \minipage[t]{0.5\textwidth}%
> \table[H]%

"\table" weg. Wozu soll das gut sein?

...Rolf

Matthias Pospiech

unread,
Dec 4, 2007, 4:43:03 AM12/4/07
to
Rolf Niepraschk schrieb:
Es ist zwar richtig dass ich das hier wirklich nicht brauche. Aber mit
meinem Problem hat das nichts zu tun.

Matthias

Markus Kohm

unread,
Dec 4, 2007, 5:04:30 AM12/4/07
to
Matthias Pospiech wrote:

> \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\Details@saved@endtabular\endtabular
\def\endtabular{\hline\Details@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

unread,
Dec 4, 2007, 5:04:41 AM12/4/07
to
Matthias Pospiech schrieb:

> 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

unread,
Dec 4, 2007, 5:07:56 AM12/4/07
to

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

0 new messages