表格列定义中的 \angle 符号

表格列定义中的 \angle 符号

我有一张满是相量的表,我试图将其写如下:

\documentclass[a4paper,journal]{article}
\usepackage[cmex10]{amsmath}
\begin{document}
\begin{table}[h!]
    \caption{Bus Voltages}
    \label{tab:appdx-busvoltages}
    \begin{center}
        \begin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}
        \hline

        \hline
        \textbf{Bus} & \multicolumn{2}{c}{\textbf{$V$ (p.u.)}} \\
        \hline
            b1 & 1.0 & 0.00 & * \\
            b2 & 0.8983 & -7.12& \\
            b3 & 0.9136 & -5.80 &\\
            b4 & 0.8841 & -9.01 &\\
        \hline

        \hline
        \end{tabular}
    \end{center}
    * \textbf{b1} is the `slack bus', and has such has a fixed voltage.
\end{table}
\end{document}

它可以工作,因为它会产生以下输出:

输出

但我也收到一堆错误:

paper1.tex:111: Illegal parameter number in definition of \reserved@a. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@fortmp. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@nextchar. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Illegal parameter number in definition of \@preamble. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:111: Only one # is allowed per tab. [...gin{tabular}{c|r@{$\angle$}r@{$^\circ$}l}]
paper1.tex:117: Missing # inserted in alignment preamble. [         b1 & 1.0 &]
paper1.tex:117: Missing $ inserted. [           b1 & 1.0 &]
paper1.tex:117: Missing $ inserted. [           b1 & 1.0 &]
paper1.tex:117: Missing $ inserted. [           b1 & 1.0 &]
paper1.tex:117: Missing $ inserted. [           b1 & 1.0 &]
paper1.tex:118: Missing # inserted in alignment preamble. [         b2 & 0.8983 &]
paper1.tex:118: Missing $ inserted. [           b2 & 0.8983 &]
paper1.tex:118: Missing $ inserted. [           b2 & 0.8983 &]
paper1.tex:118: Missing $ inserted. [           b2 & 0.8983 &]
paper1.tex:118: Missing $ inserted. [           b2 & 0.8983 &]
paper1.tex:119: Missing # inserted in alignment preamble. [         b3 & 0.9136 &]
paper1.tex:119: Missing $ inserted. [           b3 & 0.9136 &]
paper1.tex:119: Missing $ inserted. [           b3 & 0.9136 &]
paper1.tex:119: Missing $ inserted. [           b3 & 0.9136 &]
paper1.tex:119: Missing $ inserted. [           b3 & 0.9136 &]
paper1.tex:120: Missing # inserted in alignment preamble. [         b4 & 0.8841 &]
paper1.tex:120: Missing $ inserted. [           b4 & 0.8841 &]
paper1.tex:120: Missing $ inserted. [           b4 & 0.8841 &]
paper1.tex:120: Missing $ inserted. [           b4 & 0.8841 &]
paper1.tex:120: Missing $ inserted. [           b4 & 0.8841 &]

@{$\angle$}如果我从列定义中删除\begin{tabular}{...,错误就会消失。知道为什么会发生这种情况吗/我如何才能实现相同的格式而不会引发这些错误?

答案1

如果我加载array包裹。

\documentclass{article}
\usepackage{array}

\begin{document}

\begin{table}[h!]
    \caption{Bus Voltages}
    \label{tab:appdx-busvoltages}
    \centering
        \begin{tabular}{c|r@{$\angle$}l@{$^\circ$}l}
        \hline

        \hline
        \textbf{Bus} & \multicolumn{3}{c}{\textbf{$V$ (p.u.)}} \\
        \hline
            b1 & 1.0 &  & * \\
            b2 & 0.8983 && \\
            b3 & 0.9136 & &\\
            b4 &  & &\\
        \hline

        \hline
        \end{tabular}

    * \textbf{b1} is the `slack bus', and has such has a fixed voltage.
\end{table}

\end{document}

另外,看看我应该对图形和表格使用 center 还是 centering ?

相关内容