Beamer: テーブルの問題

Beamer: テーブルの問題

ビーマーでテーブルを作成しようとすると問題が発生します。以下は私のコードです:

\section{ANÁLISE DE PERFOMANCE DE PORTFÓLIO}
\begin{frame} 
\frametitle{Comportamento dos Mercados}

\hspace{7mm}Quanto maior a volatilidade, maiores ganhos podem ser auferidos agentes especulati-vos, pois, ativos com risco garantem um prêmio.\vspace{0.3cm}

\hspace{7mm}Utilizando a hipótese do random walk e o teste do ADF é possível verificar se um mercado, na hipótese fraca, é eficiente. \vspace{0.3cm}


\begin{tabular}{c | c}
Estatísticas & Valores
\hline \hline
Tau (Observed value) & -2,073
Tau (Critical value) & -0,863
p-value (one-tailed) & 0,563
alpha & 0,05
\end{tabular}


\end{frame}

「位置がずれています \noalign. \hline ->\noalign {\ifnum 0=`}\fi \hrule \@height \arrayrulewidth \futurelet... l.257 \end{frame}」

このメッセージが表示されます。コードの何が問題なのでしょうか?

答え1

表の行が正しく終了していません:

\documentclass[]{beamer}

\begin{document}
\begin{frame}
\begin{tabular}{c | c}
Estatísticas & Valores\\
\hline \hline
Tau (Observed value) & -2,073\\
Tau (Critical value) & -0,863\\
p-value (one-tailed) & 0,563\\
alpha & 0,05 % no \\ in the last row
\end{tabular}
\end{frame}
\end{document}

\\各行の末尾に配置する必要があります。

結果は次のようになります:

ここに画像の説明を入力してください

表を視覚的に強化することができます。絶対に必要な場合を除き、縦線は使用しないでください。また、 パッケージを使用してbooktabs、コマンド\toprule\midrule、を使用することも\bottomruleできます。もう 1 つの強化策はsiunitx、数字 (表でも) を表示するための非常に便利なツールを提供する パッケージです。

\documentclass[]{beamer}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
\begin{frame}
\begin{tabular}{l S[table-format=-1.3]}
    \toprule
    Estatísticas & {Valores}\\% enclose cells which are not numbers with {...}
    \midrule
    Tau (Observed value) & -2,073\\
    Tau (Critical value) & -0,863\\
    p-value (one-tailed) & 0,563\\
    alpha & 0,05\\ % \\ in the last row because of the \bottomrule
    \bottomrule
\end{tabular}
\end{frame}
\end{document}

結果は次のようになります:

ここに画像の説明を入力してください

関連情報