\documentclass{article}
Plantillas de LaTeX listas para producción para artículos de revista y de conferencia. Cubre article estándar, IEEEtran y REVTeX4-2, con figuras, tablas, ecuaciones y bibliografía preconfiguradas.
\section{Cómo elegir una clase de documento}
La clase de documento determina el diseño de su artículo, el formato de citas y los requisitos de envío. Elíjala según la revista o conferencia de destino.
| Característica | article | IEEEtran | REVTeX4-2 |
|---|---|---|---|
| Clase de documento | \documentclass{article} | \documentclass[journal]{IEEEtran} | \documentclass[aps,prl]{revtex4-2} |
| Diseño de columnas | Una columna | Dos columnas | Dos columnas |
| Tamaño de fuente | 10–12pt | 10pt (fijo) | 10pt (fijo) |
| Entorno abstract | \begin{abstract} | \begin{abstract} | \begin{abstract} |
| Estilo de citas | Cualquiera (biblatex) | \cite → [1] | \cite → [1] or author–year |
| Ideal para | Preprints, arXiv, revistas generales | IEEE Transactions, ICASSP, CVPR | Physical Review, Applied Physics |
\section{Estructura del artículo}
Cada sección de un artículo de investigación tiene sus propios modismos de LaTeX. Esto es lo que importa en cada una.
Wrap in \begin{abstract}…\end{abstract}. Keep to 150–250 words. Avoid citations and equations — most journals process abstracts separately for their databases.
Use \section{Introduction}. State the problem, summarise prior work with \cite, and enumerate your contributions with enumerate. Keep subsections shallow in short papers.
Present equations using equation and align environments from amsmath. Use \label and \cref for cross-references. Define notation in a paragraph before equations.
Use booktabs for publication-quality rules: \toprule, \midrule, \bottomrule. Never use vertical lines. Place tables with [H] (float package) or [t] for top-of-page.
Include with \includegraphics and caption. Use subcaption for panels (a), (b), (c). Export vector graphics as PDF for lossless scaling. Name files descriptively.
Use biblatex with \printbibliography or the journal's required BST file with \bibliography. Export references from Zotero or Google Scholar as BibTeX.
\section{Figuras y tablas}
Copie estos patrones para figuras individuales, paneles de subfiguras y tablas booktabs.
% Single figure
\begin{figure}[t]
\centering
\includegraphics[width=0.9\linewidth]{figures/architecture.pdf}
\caption{Overview of the proposed model architecture. The encoder
processes input tokens through hierarchical attention blocks
(\cref{sec:method}).}
\label{fig:architecture}
\end{figure}
% Two-panel subfigures
\begin{figure}[t]
\centering
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\linewidth]{figures/train_loss.pdf}
\caption{Training loss curve.}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.48\linewidth}
\includegraphics[width=\linewidth]{figures/eval_rouge.pdf}
\caption{ROUGE-1 on validation set.}
\end{subfigure}
\caption{Training dynamics over 50k steps.}
\label{fig:training}
\end{figure}\begin{table}[H]
\centering
\caption{Comparison of methods on the CNN/DailyMail test set.}
\label{tab:main-results}
\begin{tabular}{l S[table-format=2.1] S[table-format=2.1] S[table-format=2.1]}
\toprule
{Method} & {R-1} & {R-2} & {R-L} \\
\midrule
Lead-3 & 40.4 & 17.7 & 36.7 \\
Longformer & 44.2 & 21.3 & 41.0 \\
Full Attention & 45.1 & 21.9 & 41.8 \\
\midrule
\textbf{Ours} & \textbf{47.4} & \textbf{23.1} & \textbf{43.5} \\
\bottomrule
\end{tabular}
\end{table}\include{preamble}
Un artículo completo que compila, con matemáticas, tabla y bibliografía. Funciona de inmediato con FormaTeX mediante el pipeline pdfLaTeX + Biber.
\documentclass[12pt]{article}
% Encoding & fonts
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
% Page layout
\usepackage[margin=2.5cm]{geometry}
% Mathematics
\usepackage{amsmath, amssymb, amsthm}
\usepackage{mathtools}
% Figures & tables
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
\usepackage[labelfont=bf, font=small]{caption}
\usepackage{subcaption}
\usepackage{float}
% References & citations
\usepackage[style=numeric-comp, sorting=none, backend=biber]{biblatex}
\addbibresource{references.bib}
% Hyperlinks
\usepackage[hidelinks, colorlinks=false]{hyperref}
\usepackage{cleveref}
% Algorithms
\usepackage[ruled, vlined]{algorithm2e}
% Utilities
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{lipsum} % remove in production
% -------------------------------------------------------
% Document metadata
% -------------------------------------------------------
\title{%
A Sub-Quadratic Attention Mechanism for\\
Long-Document Summarisation
}
\author{%
Jane Researcher$^{1}$\thanks{Corresponding author: [email protected]} \and
John Co-Author$^{2}$
}
\date{%
$^{1}$Department of Computer Science, University of Example\\
$^{2}$AI Research Lab, Tech Institute\\[6pt]
\today
}
\begin{document}
\maketitle
\begin{abstract}
We present an efficient attention mechanism that reduces the computational
complexity of transformer self-attention from $\mathcal{O}(n^2)$ to
$\mathcal{O}(n \log n)$, enabling processing of documents with up to
64{,}000 tokens on a single GPU. Experiments on the CNN/DailyMail and
arXiv summarisation benchmarks show a ROUGE-1 improvement of 2.3 points
over the full-attention baseline with 40\% lower memory consumption.
\end{abstract}
\textbf{Keywords:} natural language processing, attention mechanism,
transformers, document summarisation
\section{Introduction}
Long-document understanding remains a core challenge in NLP.
The quadratic memory complexity of standard self-attention
($\mathcal{O}(n^2 d)$ for sequence length $n$ and dimension $d$)
limits practical sequence lengths to 2{,}048–4{,}096 tokens on
commodity hardware~\cite{vaswani2017}.
\subsection{Contributions}
\begin{enumerate}
\item A hierarchical attention scheme operating at sentence and paragraph levels.
\item An open-source implementation evaluated on three public benchmarks.
\item A theoretical analysis proving the $\mathcal{O}(n \log n)$ bound.
\end{enumerate}
\section{Related Work}
Sparse attention patterns were introduced by~\cite{child2019} and extended
by Longformer~\cite{beltagy2020} with sliding-window plus global tokens.
Linear attention approximations~\cite{katharopoulos2020} achieve $\mathcal{O}(n)$
complexity but sacrifice expressiveness on local patterns.
\section{Methodology}
\subsection{Hierarchical Attention}
Let $\mathbf{X} \in \mathbb{R}^{n \times d}$ be the token embeddings.
We partition $\mathbf{X}$ into $k$ sentence blocks and compute:
\begin{equation}
\mathbf{H}_i = \text{Attention}\bigl(\mathbf{Q}_i,\, \mathbf{K}_i,\, \mathbf{V}_i\bigr),
\quad i = 1, \ldots, k
\label{eq:local-attn}
\end{equation}
where each block attends only within its sentence boundary for local features,
followed by a cross-block pooling step for global context.
\subsection{Complexity Analysis}
For $k$ blocks each of size $m = n/k$:
\begin{equation}
\mathcal{C} = k \cdot \mathcal{O}(m^2) + \mathcal{O}(k^2)
= \mathcal{O}\!\left(\frac{n^2}{k}\right) + \mathcal{O}(k^2)
\end{equation}
Setting $k = n^{2/3}$ minimises total complexity to $\mathcal{O}(n^{4/3})$,
and with $k = \sqrt{n}$ we achieve $\mathcal{O}(n \log n)$ in expectation.
\section{Experiments}
\subsection{Datasets and Metrics}
We evaluate on CNN/DailyMail~\cite{see2017} and arXiv~\cite{cohan2018}.
Summaries are scored with ROUGE-1, ROUGE-2, and ROUGE-L.
\begin{table}[H]
\centering
\caption{ROUGE scores on CNN/DailyMail test set.}
\label{tab:results}
\begin{tabular}{lccc}
\toprule
Model & R-1 & R-2 & R-L \\
\midrule
Lead-3 baseline & 40.4 & 17.7 & 36.7 \\
Longformer & 44.2 & 21.3 & 41.0 \\
Full Attention & 45.1 & 21.9 & 41.8 \\
\textbf{Ours} & \textbf{47.4} & \textbf{23.1} & \textbf{43.5} \\
\bottomrule
\end{tabular}
\end{table}
\section{Conclusion}
We demonstrated that hierarchical attention matches or exceeds full-attention
performance at substantially lower computational cost. Future work will
explore integration with retrieval-augmented generation pipelines.
\printbibliography
\end{document}El artículo de investigación completo, con resumen, matemáticas, tabla y bibliografía, está precargado y se compila en segundos. Sin instalación ni configuración.
\section{Plantillas relacionadas}
\section{FAQ}
¿Debo usar article, IEEEtran o REVTeX para mi artículo?
Use article para preprints de arXiv y revistas que no exijan una clase concreta. Use IEEEtran para cualquier foro del IEEE (Transactions, Letters o conferencias como CVPR). Use revtex4-2 para las revistas de la American Physical Society (Physical Review, PRL). Consulte siempre primero las pautas para autores de la revista.
¿Cómo doy formato a las ecuaciones en un diseño de dos columnas?
En documentos de dos columnas (IEEEtran, revtex), las ecuaciones anchas pueden romper las columnas. Use los entornos figure* o table* con asterisco para contenido de ancho completo, o el entorno strip en revtex. En las ecuaciones en línea, microtype gestiona el espaciado automáticamente.
¿Cuál es la mejor forma de gestionar las referencias de un artículo?
Use biblatex con el estilo numeric-comp para un formato de citas limpio del tipo [1, 2, 3]. Exporte su biblioteca de Zotero o Mendeley como .bib. Para los envíos al IEEE, use IEEEtran.bst con el flujo de trabajo clásico de BibTeX, ya que la plantilla LaTeX de la revista suele incluirlo.
¿Cómo creo tablas con calidad de publicación en LaTeX?
Use the booktabs package and replace all \hline calls with \toprule, \midrule, and \bottomrule. Remove all vertical lines. Add column alignment via the siunitx S column type to align numbers at the decimal point.
¿Qué motor debo usar: pdfLaTeX, XeLaTeX o LuaLaTeX?
pdfLaTeX es el más rápido y lo exigen la mayoría de las revistas. XeLaTeX es el mejor cuando necesita fuentes OpenType personalizadas. LuaLaTeX ofrece la mayor flexibilidad (incluido el scripting con Lua), pero es el más lento al compilar. FormaTeX admite los tres; consulte /engines para ver una comparación completa.
¿Cómo envío a arXiv?
arXiv requiere subir el código fuente sin subcarpetas: su archivo .tex, todos los archivos .bib/.bbl y todos los archivos de figuras en el mismo directorio. Ejecute primero en local pdflatex → biber → pdflatex × 2 para generar el .bbl y luego suba el .tex + .bbl + las figuras. FormaTeX produce PDF conformes automáticamente.
Abra la plantilla en FormaTeX, escriba su artículo y compílelo a PDF al instante, sin instalar TeX Live ni configurar nada localmente.