Ajustes de tabela LaTeX

Ajustes de tabela LaTeX

Estou digitando a seguinte tabela em 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}

Eu recebo a seguinte saída:

saída

  1. Observe a sobreposição à esquerda. Como eu posso removê-los?
  2. Como ajusto as fontes para serem centralizadas no meio das colunas, exceto na parte inferior?

Responder1

Adicione metade do espaçamento \extrarowheighte metade ao quebrar a linha.

Além disso, você pode usar tabularem vez de tabular*.

Para corrigir a sobreposição à esquerda, observe que você tem um espaço espúrio em

@{\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} 

Saída

insira a descrição da imagem aqui

Responder2

use um tabular simples ou 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} 

insira a descrição da imagem aqui

informação relacionada