> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/es/errores-de-latex/22-misplaced-noalign.md).

# \noalign fuera de lugar

Este error aparece cuando has usado **`\hline`** incorrectamente.

## Causas comunes

**Uso de \hline fuera de una tabla:**

El **`\hline`** comando solo puede usarse dentro de un **`tabular`** entorno. No puedes usarlo para incluir líneas horizontales en otros lugares de los documentos, como en páginas de título o encabezados de página. Un ejemplo de este error es:

```latex
%En el preámbulo
\title{Sobre la teoría molecular general del calor}
\author{A. Einstein}

% En el cuerpo de tu documento
\maketitle

\hline
```

Esto generará el error que se muestra a continuación

main.tex, línea 5

\noalign mal ubicado.

\hline ->\noalign {\ifnum 0=\`}\fi \hrule \\@height \arrayrulewidth \futurelet... l.10 \hline Espero ver \noalign solo después del \cr de una alineación. Continúe, e ignoraré este caso.

Cuando quieras incluir líneas horizontales fuera de un entorno tabular, debes usar **`\hrule`**.

**Uso incorrecto de \hline en una tabla:**

Al usar **`\hline`** en una tabla, cada instancia excepto la primera debe ir precedida de **`\\`**. A continuación se muestra un ejemplo de este error

```latex
\begin{tabular}{|l|l|} \hline
    Nombre: & Albert \\ \hline
    Segundo nombre: & Einstein \hline
\end{tabular}
```

El primer **`\hline`** comando aquí está bien, ya que la primera **`\hline`** en una tabla no necesita ir precedida de **`\\`**. El problema es nuestra última **`\hline`** que sí necesita ir precedida de **`\\`**. La forma correcta de escribir esta tabla es:

```latex
\begin{tabular}{|l|l|} \hline
    Nombre: & Albert \\ \hline
    Segundo nombre: & Einstein \\ \hline
\end{tabular}
```

![Table.PNG](/files/e95a367082ada02e5339e34ec049db80e82e37a0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/es/errores-de-latex/22-misplaced-noalign.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
