我一直试图在第二行的第一个单元格下画一条线,但命令却在第一行起作用。同时它在其他行也起作用。
我的代码:
\documentclass[conference]{IEEEtran}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{tabularx,booktabs,ragged2e,bm,newtxmath} % new packages
\usepackage{pgfplots}\pgfplotsset{compat=1.16}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{xcolor}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\begin{table*}
\setlength\tabcolsep{3pt}
\caption{System variables dependencies}\label{tab2}
\begin{tabularx}{\linewidth}{@{} X *{5}{Y} @{}}
\toprule
System variables
& $o_{v}$
& $s_{p}$
& $t_{m}$
& $l_{ft}$
& $l_{ot}$
\cmidrule(l){2-2} \cmidrule(l){3-3} \cmidrule(l){4-4}
\cmidrule(l){5-5} \cmidrule(l){6-6}
\addlinespace
Subsystem associated & V & Pr & M & $\textrm{T}_\textrm{1}$ &
$\textrm{T}_ \textrm{2}$ \\
\addlinespace
Mathematical dependencies & & & $t_{m}(t)=23-0.25
\times o_{v}(t)+0.62\times s_{p}(t)$
& $l_{ft}(t)=l_{ft}(t-1) -0.001\times s_{p}(t)$
& $l_{ft}(t)=l_{ft}(t-1) -0.0005\times s_{p}(t)$ \\
\addlinespace
Operational dependencies & $o_{v}(t)=0$ if $s_{p}(t)=0$ & &
& $l_{ft}(t)=l_{ft}(t-1)$ if $s_{p}(t)=0$
& $l_{ot}(t)=l_{ot}(t-1)$ if $s_{p}(t)=0$ \\
\addlinespace
Nominal value range
& $0\rightarrow100$ (\%)
& $0\rightarrow100$ (\%)
& $23\rightarrow83$ (°C)
& $2\rightarrow100$ (\%)
& $2\rightarrow100$ (\%)\\
\bottomrule
\end{tabularx}
\end{table*}
\end{document}
答案1
\\
之前给予\cmidrule
\documentclass{book}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{tabularx,booktabs,ragged2e,bm,newtxmath} % new packages
\usepackage{pgfplots}\pgfplotsset{compat=1.14}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{xcolor}
%%%% remove this line and the two below (here just commented)
%\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
%T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\begin{table*}
\caption{System variables dependencies}\label{tab2}
\begin{tabularx}{\linewidth}{@{} X *{5}{Y} @{}}
\toprule
System variables & $o_{v}$ & $s_{p}$ & $t_{m}$ & $l_{ft}$ & $l_{ot}$\\
\cmidrule(l){2-2} \cmidrule(l){3-3} \cmidrule(l){4-4}
\cmidrule(l){5-5} \cmidrule(l){6-6}
\addlinespace
Subsystem associated & V & Pr & M & $\textrm{T}_\textrm{1}$ &
$\textrm{T}_ \textrm{2}$ \\
\addlinespace
Mathematical dependencies & & & $t_{m}(t)=23-0.25
\times o_{v}(t)+0.62\times s_{p}(t)$
& $l_{ft}(t)=l_{ft}(t-1) -0.001\times s_{p}(t)$
& $l_{ft}(t)=l_{ft}(t-1) -0.0005\times s_{p}(t)$ \\
\addlinespace
Operational dependencies & $o_{v}(t)=0$ if $s_{p}(t)=0$ & &
& $l_{ft}(t)=l_{ft}(t-1)$ if $s_{p}(t)=0$
& $l_{ot}(t)=l_{ot}(t-1)$ if $s_{p}(t)=0$ \\
\addlinespace
Nominal value range
& $0\rightarrow100$ (\%)
& $0\rightarrow100$ (\%)
& $23\rightarrow83$ (°C)
& $2\rightarrow100$ (\%)
& $2\rightarrow100$ (\%)\\
\bottomrule
\end{tabularx}
\end{table*}
\end{document}
PS:除了错误之外,我没有检查你的代码