表格和 SI \unit 命令 \uA 给出了一个奇怪的 t

表格和 SI \unit 命令 \uA 给出了一个奇怪的 t

我刚刚偶然发现了这个使用 的奇怪问题siunitx。我正在做报告(IEEE 风格中是强制性的),似乎 micro 前缀在环境中给了我这个奇怪的 t tabular。我在序言中指定了我希望\per选项是什么样子,作为分割线。

在 W10 上通过 texstudio 和 XeLaTeX

\begin{table}[h]
    \renewcommand{\arraystretch}{1.3}
    \caption{the caption}
    \label{tab:ref-of-my-table}
    \centering
    \begin{tabular}{ll*{1}{S}l}
        \toprule
        {A} &   {B} & {Value} & {Unit}\\
        \midrule
        AA  &   & 0.46  & \unit{\volt} \\
        BB  &   & 0.6 & \unit{\volt} \\
        EE  &   & 115 & \unit{\uA \per  \volt \squared} \\
        GG  &   & 40  & \unit{\micro \ampere \per  \volt \squared} \\
        Slew rate   &   &   & \\
        Voltage swing IN    &   &   &    \\
        Voltage swing OUT   &   &   &    \\
        \bottomrule
    \end{tabular}
\end{table}

输出为

在此处输入图片描述

文件和序言

\documentclass[conference,a4paper,10pt,twocolumn,twoside]{IEEEtran}
%\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\interdisplaylinepenalty=2500       % IEEE 2 col break multiline equations
\usepackage{algorithmic}
\usepackage[italian]{babel}
    \usepackage{subcaption} % 
    \usepackage{float}
    \usepackage{subfloat}
    \usepackage{placeins}   % 
\usepackage{graphicx}
\graphicspath{./images}
\usepackage{stfloats}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usetikzlibrary{matrix,calc}
\usepackage{siunitx}
    \sisetup{
        inter-unit-product =\ensuremath{{}\cdot{}},
        display-per-mode = fraction ,
        inline-per-mode = symbol,       %% Division is "/"
        table-number-alignment = center,
        table-figures-integer = 1,
        table-figures-decimal = 2,
    }
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\usepackage{pifont}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\begin{document}

%% Some IEEE set up, title, author, abstract
%% Usual template stuff for IEEEtran type of document

\section{my first section}

%% Some paragraphs about my report

%% The table in question
\begin{table}[h]
    \renewcommand{\arraystretch}{1.3}
    \caption{the caption}
    \label{tab:ref-of-my-table}
    \centering
    \begin{tabular}{ll*{1}{S}l}
        \toprule
        {A} &   {B} & {Value} & {Unit}\\
        \midrule
        AA  &   & 0.46  & \unit{\volt} \\
        BB  &   & 0.6 & \unit{\volt} \\
        EE  &   & 115 & \unit{\uA \per  \volt \squared} \\
        GG  &   & 40  & \unit{\micro \ampere \per  \volt \squared} \\
        Slew rate   &   &   & \\
        Voltage swing IN    &   &   &    \\
        Voltage swing OUT   &   &   &    \\
        \bottomrule
    \end{tabular}
\end{table}

%% bib file still need to be imported

\end{document}

答案1

使用 XeLaTeX,你应该不是使用fontenctextcomp

如果要符合 IEEEtran 的标准 Times 字体,可以加载newtx

也是subcaption不是兼容IEEEtran,因此您不应加载它。该subfloat包不会以与相同的方式执行“子浮点数” subcaption。如果您确实需要子浮点数,请执行

\usepackage[caption=false]{subfig}

caption加载(或)的结果subcaption是标题将不符合样式IEEEtran

更正内容如下:

\documentclass[conference,a4paper,10pt,twocolumn,twoside]{IEEEtran}
%\IEEEoverridecommandlockouts
% The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out.
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage[italian]{babel}
%\usepackage{subcaption} % not compatible with IEEEtran
%\usepackage{float} % useless
%\usepackage{subfloat} % do you really need it?
%\usepackage{placeins} % useless in two-column format
\usepackage{graphicx}
\graphicspath{./images}
\usepackage{stfloats}
\usepackage{tikz}
\usepackage[european]{circuitikz}
\usetikzlibrary{matrix,calc}
\usepackage{siunitx}
%\usepackage{textcomp}
%\usepackage[T1]{fontenc}
%\usepackage{pifont}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs

\usepackage{newtx}

\sisetup{
  inter-unit-product =\ensuremath{{}\cdot{}},
  display-per-mode = fraction ,
  inline-per-mode = symbol,       %% Division is "/"
  table-number-alignment = center,
  table-figures-integer = 1,
  table-figures-decimal = 2,
}

\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\interdisplaylinepenalty=2500       % IEEE 2 col break multiline equations

\begin{document}

%% Some IEEE set up, title, author, abstract
%% Usual template stuff for IEEEtran type of document

\section{my first section}

%% Some paragraphs about my report

%% The table in question
\begin{table}[htp]
    \renewcommand{\arraystretch}{1.3}
    \caption{the caption}
    \label{tab:ref-of-my-table}
    \centering
    \begin{tabular}{ll*{1}{S}l}
        \toprule
        {A} &   {B} & {Value} & {Unit}\\
        \midrule
        AA  &   & 0.46  & \unit{\volt} \\
        BB  &   & 0.6 & \unit{\volt} \\
        EE  &   & 115 & \unit{\uA \per  \volt \squared} \\
        GG  &   & 40  & \unit{\micro \ampere \per  \volt \squared} \\
        Slew rate   &   &   & \\
        Voltage swing IN    &   &   &    \\
        Voltage swing OUT   &   &   &    \\
        \bottomrule
    \end{tabular}
\end{table}

%% bib file still need to be imported

\end{document}

在此处输入图片描述

相关内容