
eu encontreiessa questão, mas isso parece se aplicar especificamente ao centro com base no decimal, e minha tabela não contém dados numéricos. Estou tentando fazer a tabela Cayley para os quaternions, e um exemplo prático mínimo da aparência da minha tabela é:
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{l|llllllll}
$*$&$1$&$-1$&$i$&$-i$&$j$&$-j$&$k$&$-k$\\\hline
$1$&$1$&$-1$&$i$&$-i$&$j$&$-j$&$k$&$-k$\\
$-1$&$-1$&$1$&$-i$&$i$&$-j$&$j$&$-k$&$k$\\
$i$&$i$&$-i$&$-1$&$1$&$k$&$-k$&$-j$&$j$\\
$-i$&$-i$&$i$&$1$&$-1$&$-k$&$k$&$j$&$-j$\\
$j$&$j$&$-j$&$-k$&$k$&$-1$&$1$&$i$&$-i$\\
$-j$&$-j$&$j$&$k$&$-k$&$1$&$-1$&$-i$&$i$\\
$k$&$k$&$-k$&$-j$&$j$&$-i$&$i$&$1$&$-1$\\
$-k$&$-k$&$k$&$j$&$-j$&$i$&$-i$&$-1$&$1$\\
\end{tabular}
\end{center}
\end{table}
\end{document}
que produz a seguinte saída.
Qual identificaçãocomopara a tabela ficar assim:
Tenho certeza de que já existe uma pergunta semelhante neste site, mas não consegui encontrar nada que se aplicasse a valores de células não numéricos.
Responder1
Tenho quase 100% de certeza de que existem soluções melhores, mas você poderia usar \phantom{-}
:
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{l|llllllll}
$*$ & $\phantom{-}1$ & $-1$ & $\phantom{-}i$ & $-i$ & $\phantom{-}j$ & $-j$ & $\phantom{-}k$ & $-k$ \\\hline
$\phantom{-}1$ & $\phantom{-}1$ & $-1$ & $\phantom{-}i$ & $-i$ & $\phantom{-}j$ & $-j$ & $\phantom{-}k$ & $-k$ \\
$-1$ & $-1$ & $\phantom{-}1$ & $-i$ & $\phantom{-}i$ & $-j$ & $\phantom{-}j$ & $-k$ & $\phantom{-}k$ \\
$\phantom{-}i$ & $\phantom{-}i$ & $-i$ & $-1$ & $\phantom{-}1$ & $\phantom{-}k$ & $-k$ & $-j$ & $\phantom{-}j$ \\
$-i$ & $-i$ & $\phantom{-}i$ & $\phantom{-}1$ & $-1$ & $-k$ & $\phantom{-}k$ & $\phantom{-}j$ & $-j$ \\
$\phantom{-}j$ & $\phantom{-}j$ & $-j$ & $-k$ & $\phantom{-}k$ & $-1$ & $\phantom{-}1$ & $\phantom{-}i$ & $-i$ \\
$-j$ & $-j$ & $\phantom{-}j$ & $\phantom{-}k$ & $-k$ & $\phantom{-}1$ & $-1$ & $-i$ & $\phantom{-}i$ \\
$\phantom{-}k$ & $\phantom{-}k$ & $-k$ & $-j$ & $\phantom{-}j$ & $-i$ & $\phantom{-}i$ & $\phantom{-}1$ & $-1$ \\
$-k$ & $-k$ & $\phantom{-}k$ & $\phantom{-}j$ & $-j$ & $\phantom{-}i$ & $-i$ & $-1$ & $\phantom{-}1$ \\
\end{tabular}
\end{center}
\end{table}
\end{document}
Ou, neste caso, apenas alinhar as colunas à direita pode servir (embora não produza exatamente a mesma saída):
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\begin{document}
\begin{table}[h]
\begin{center}
\begin{tabular}{r|rrrrrrrr}
$*$ & $1$ & $-1$ & $i$ & $-i$ & $j$ & $-j$ & $k$ & $-k$ \\\hline
$1$ & $1$ & $-1$ & $i$ & $-i$ & $j$ & $-j$ & $k$ & $-k$ \\
$-1$ & $-1$ & $1$ & $-i$ & $i$ & $-j$ & $j$ & $-k$ & $k$ \\
$i$ & $i$ & $-i$ & $-1$ & $1$ & $k$ & $-k$ & $-j$ & $j$ \\
$-i$ & $-i$ & $i$ & $1$ & $-1$ & $-k$ & $k$ & $j$ & $-j$ \\
$j$ & $j$ & $-j$ & $-k$ & $k$ & $-1$ & $1$ & $i$ & $-i$ \\
$-j$ & $-j$ & $j$ & $k$ & $-k$ & $1$ & $-1$ & $-i$ & $i$ \\
$k$ & $k$ & $-k$ & $-j$ & $j$ & $-i$ & $i$ & $1$ & $-1$ \\
$-k$ & $-k$ & $k$ & $j$ & $-j$ & $i$ & $-i$ & $-1$ & $1$ \\
\end{tabular}
\end{center}
\end{table}
\end{document}
Também,Modo matemático em tabular sem precisar usar $...$ em qualquer lugarpode ser interessante. Tudo de bom!