
Estoy escribiendo la siguiente tabla en LaTeX:
\begin{center}
\setlength\extrarowheight{5pt}
%\renewcommand{\arraystretch}{1.2}
\begin{tabular*}{3.4in}{@{\extracolsep{\fill} } | c | c | c | c | c | c | c | }
\hline
\small\textit{g(t+0)} & \small\textit{g(t+1)} & \small\textit{g(t+2)} & \small\textit{f(t+3)} & \small\textit{f(t+4)} & \small\textit{g(t+5)} & \small{...} \\
\hline
\end{tabular*}
\end{center}
Obtengo el siguiente resultado:
- Tenga en cuenta la superposición a la izquierda. ¿Cómo puedo eliminarlos?
- ¿Cómo ajusto las fuentes para que se centren en el medio de las columnas que no sean en la parte inferior?
Respuesta1
Agregue la mitad del espacio \extrarowheight
y la mitad cuando rompa la fila.
Además, puedes utilizartabular
en lugar de tabular*
.
Para arreglar la superposición en la izquierda, tenga en cuenta que tiene un espacio falso en
@{\extracolsep{\fill} }
MWE
\documentclass{article}
\usepackage{array}
\begin{document}
\begin{center}
\setlength\extrarowheight{2.5pt}
%\renewcommand{\arraystretch}{1.2}
\begin{tabular}{@{\extracolsep{\fill}} | c | c | c | c | c | c | c | }
\hline
\small\textit{g(t+0)} & \small\textit{g(t+1)} & \small\textit{g(t+2)} & \small\textit{f(t+3)} & \small\textit{f(t+4)} & \small\textit{g(t+5)} & \small{...}\\[2.5pt]
\hline
\end{tabular}
\end{center}
\end{document}
Producción
Respuesta2
use un tabular simple o tabularx:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
foo
{\small\itshape
\begin{tabular}{|*7{c|}} \hline
\rule[-2ex]{0pt}{6ex} g(t+0) & g(t+1) & g(t+2) & f(t+3) & f(t+4) & g(t+5) & \ldots\\\hline
\end{tabular}}
{\small\itshape
\begin{tabularx}{3.8in}{|*6{X |}c|} \hline
\rule[-2ex]{0pt}{6ex} g(t+0) & g(t+1) & g(t+2) & f(t+3) & f(t+4) & g(t+5) & \ldots\\\hline
\end{tabularx}}
bar
\end{document}