带有 S 列的表中的 siunitx 和“e”符号

带有 S 列的表中的 siunitx 和“e”符号

我在表格中使用时遇到问题\sisetup{output-exponent-marker = \text{e}}。我使用 siunitx 包提供的 S 列。它确实更改为“e”符号,但不会删除\times“e”之前的符号。

这是我的 LaTex 文件的一小部分摘录,其中包含表格的小版本。我想使用“e”符号,因为这可以节省大量空间,最终将形成一个非常大的表格。

我希望有人能帮忙。提前致谢。Gerlind

\documentclass[fontsize=12pt,DIV14,BCOR15mm,oneside, headings=small,headsepline, appendixprefix,bibliography=totoc]{scrbook}

\usepackage[latin1]{inputenc}           % Zus{\"a}tzliche Sonderzeichen
\usepackage[UKenglish]{babel}       % English Language and Hyphenation

\usepackage{times}                          % Festlegung der Schrift
\usepackage[T1]{fontenc}                % Verwendete Zeichentabelle

\usepackage{rotating}

\usepackage[bf,footnotesize,width=.9\textwidth,format=hang]{caption}    

\usepackage{array}

\usepackage{siunitx}

\usepackage{multirow} % Multirow command for tables

% To increase space of some rows in tables, especially needed in header row before \hline
\newcommand\T{\rule{0pt}{2.6ex}}       % Top strut
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}} % Bottom strut

\usepackage{scrpage2}


\begin{document}

\begin{table}[htbp]
\begin{center}
\footnotesize
\sisetup{output-exponent-marker = \text{e}, table-format=+1.4e+2}
\begin{tabular}{ll|SS}
MRE Sample & $N$ & \multicolumn{1}{c}{$\mu_1 [Pa]$} & \multicolumn{1}{c}{$\alpha_1 [-]$}   \B \\  \hline
\multirow{3}{3cm}{Isotropic $10\%$ MREs} & 1 & 1.5030e+05 & 4.2384e+00 \T \\ 
& 2 & 6.7175e+05 & 8.4376e-01 \\
& 3 & 9.5378e-06 & 9.0545e-05  \B \\ \hline 
\end{tabular}
\end{center}
\caption[]{Wrong scientific notation}
\label{tab:example}
\end{table}

\end{document}

在此处输入图片描述

答案1

这可能是 中的一个错误siunitx,但很容易找到解决方法:只需设置exponent-product为空。

\documentclass{article}

\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]
\centering
\footnotesize
\sisetup{
  output-exponent-marker = \text{e},
  table-format=+1.4e+2,
  exponent-product={},
  retain-explicit-plus
}
\begin{tabular}{llSS}
\toprule
MRE Sample & $N$ & \multicolumn{1}{c}{$\mu_1 [Pa]$} & \multicolumn{1}{c}{$\alpha_1 [-]$} \\
\midrule
Isotropic $10\%$ MREs & 1 & 1.5030e+05 & 4.2384e+00 \\
                      & 2 & 6.7175e+05 & 8.4376e-01 \\
                      & 3 & 9.5378e-06 & 9.0545e-05 \\
\bottomrule
\end{tabular}
\caption{Right scientific notation}
\label{tab:example}
\end{table}

\end{document}

在这种情况下,我将 也设置retain-explicit-plus为对称。我还将表格更改为使用booktabs,当然没有垂直规则。我还删除了\multirow,因为在中间设置“各向同性...”并不比在受影响行的顶部设置更清楚。只需用 分隔不同的组即可\midrule

在此处输入图片描述

答案2

该选项output-exponent-marker似乎仅适用于\num表格中的数字。因此,您应该将数字替换1.5030e+05\num{1.5030e+05}

\documentclass[fontsize=12pt,DIV14,BCOR15mm,oneside, headings=small,headsepline, appendixprefix,bibliography=totoc]{scrbook}

\usepackage[latin1]{inputenc}           % Zus{\"a}tzliche Sonderzeichen
\usepackage[UKenglish]{babel}       % English Language and Hyphenation

\usepackage{times}                          % Festlegung der Schrift
\usepackage[T1]{fontenc}                % Verwendete Zeichentabelle

\usepackage{rotating}

\usepackage[bf,footnotesize,width=.9\textwidth,format=hang]{caption}

\usepackage{array}

\usepackage{siunitx}

\usepackage{multirow} % Multirow command for tables

% To increase space of some rows in tables, especially needed in header row before \hline
\newcommand\T{\rule{0pt}{2.6ex}}       % Top strut
\newcommand\B{\rule[-1.2ex]{0pt}{0pt}} % Bottom strut

\usepackage{scrpage2}


\begin{document}

\begin{table}[htbp]
\begin{center}
\footnotesize
\sisetup{table-format=+1.4e+2, output-exponent-marker = \text{e} }
\begin{tabular}{ll|SS}
MRE Sample & $N$ & \multicolumn{1}{c}{$\mu_1 [Pa]$} & \multicolumn{1}{c}{$\alpha_1 [-]$}   \B \\  \hline
\multirow{3}{3cm}{Isotropic $10\%$ MREs} & 1 & \num{1.5030e+05} & \num{4.2384e+00} \T \\
& 2 & \num{6.7175e+05} & \num{8.4376e-01} \\
& 3 & \num{9.5378e-06} & \num{9.0545e-05}  \B \\ \hline
\end{tabular}
\end{center}
\caption[]{Right scientific notation}
\label{tab:example}
\end{table}

\end{document} 

输出

在此处输入图片描述

相关内容