Ir al contenido principal

LaTeX: redacción de documentos científicos

Guía general sobre el uso del lenguaje de creación de documentos científicos LaTeX y su aplicación con la herramienta Overleaf.

Alineación del texto

Los artículos o los libros, por ejemplo, tiene por defecto el texto alineado de forma justificada, pero se puede alinear el texto a la derecha, la izquierda o de forma centrada. Se puede configurar para todo el texto o una parte. Hay que aplicar alguno de los tres comandos antes o justo después del comienzo del ambiente document, es decir, justo antes o después de \begin{document}. Pero, en LaTex, puede resultar un poco confuso, a tenor del nombre del comando porque, puede parecer que funciona al revés de como se configuraría en un procesador de texto:

  • Alineación a la derecha: para que el texto que alineado al margen derecho, dejando el izquierdo con líneas escalonadas hay que añadir el comando  \reggedleft.  
  • Alineación a la izquierda: para que el texto que alineado al margen izquierdo, dejando el derecho con líneas escalonadas hay que añadir el comando  \reggedright.
  • Alineación centrada: para que el texto que alineado en el centro, dejando tanto el margen izquierdo como derecho con líneas escalonadas hay que añadir el comando  \centering.

 

Ejemplos:

\begin{document}
\raggedleft
...

ó

\raggedleft
\begin{document}
...

Overleaf: alineación a la dercha
Overleaf: alineación a la derecha.

 

\begin{document}
\raggedright
...

ó

\raggedright
\begin{document}
...

 Overleaf: alineación a la izquierda
Overleaf: alineación a la izquierda.

 

\begin{document}
\centering
...

ó

\centering
\begin{document}
...

Overleaf: alineación de forma centrada.
Overleaf: alineación de forma centrada.

 

Para aplicar las alineaciones a un párrafo o parte del texto, hay que meter dicho párrafo o parte entre 3 ambientes: flushleft and flushrightcenter. Funcionan como los tres comandos mencionados anteriormente: 

  • Alineación a la derecha: Hay que meter el texto entre \begin{flushleft} y \end{flushleft}
  • Alineación a la izquierda:  Hay que meter el texto entre \begin{flushright} y \end{flushright}
  • Alineación centrada: Hay que meter el texto entre \begin{center} y \end{center}

 

Ejemplos:

\begin{document}
...

\begin{flushleft}
La\TeX{} is a document preparation system and document markup 
language. \LaTeX{} uses the \TeX{} typesetting program for formatting 
its output, and is itself written in the \TeX{} macro language. 
\LaTeX{} is not the name of a particular (executable) typesetting program, but 
refers to the suite of commands (\TeX{} macros) which form the markup 
conventions used to typeset \LaTeX{} documents.
\end{flushleft}


\section*{A paragraph typeset flush right}

\begin{flushright}
La\TeX{} is a document preparation system and document markup 
language. \LaTeX{} uses the \TeX{} typesetting program for formatting 
its output, and is itself written in the \TeX{} macro language. 
\LaTeX{} is not the name of a particular (executable) typesetting program, but 
refers to the suite of commands (\TeX{} macros) which form the markup 
conventions used to typeset \LaTeX{} documents.
\end{flushright}

\begin{center}
\section*{A paragraph: center}
La\TeX{} is a document preparation system and document markup 
language. \LaTeX{} uses the \TeX{} typesetting program for formatting 
its output, and is itself written in the \TeX{} macro language. 
\LaTeX{} is not the name of a particular (executable) typesetting program, but 
refers to the suite of commands (\TeX{} macros) which form the markup 
conventions used to typeset \LaTeX{} documents.
\end{center}

....

\end{document}

 

Overleaf: tres párrafos alineados a la derecha, izquierda y de forma centrada.
Overleaf: tres párrafos alineados a la derecha, izquierda y de forma centrada.

 

Documentos:

 

Para saber más sobre la alineación del texto, léase:

Síguenos en:

Licencia Creative Commons
Biblioteca/CRAI de la Universidad Pablo de Olavide Licencia Creative Commons Atribución-NoComercial-CompartirIgual 4.0 Internacional.