General\hline errors

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
evlabiba
Posts: 8
Joined: Sat Nov 15, 2008 6:17 pm

\hline errors

Post by evlabiba »

Hello
Why do I get a "Misplaced \noalign" error message when I use \hline outside the tabular environment?

Code: Select all

\begin{document}
  \hline
  Hello, \TeX{}-perts!
  \hline
\end{document}
I'm a MikTeX 2.7 user.

Thx.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

\hline errors

Post by localghost »

evlabiba wrote:[...] Why do I get a "Misplaced \noalign" error message when I use \hline outside the tabular environment? [...]
It is simply not allowed to use this command outside a tabular environment. Replace \hline with \hrule and it will work.


Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply