如果我是 Latex 的初学者,但写作是冒险家,那么这个问题可能看起来很奇怪。我试过了这不过。我已经定义了新的列样式,但我不知道如何删除每个表格单元格中的缩进。在这个简单的例子中,我如何消除“术语数”和表格左侧垂直线之间的间隙?
\documentclass{article}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{array}
\begin{document}
\parindent = 0pt
\the \parindent
\large{TEXT}
\newcolumntype{R}[2]{
>{ \minipage[c][#1][c]{#2} }
l <
{\endminipage}
}
\begin{center}
\begin{tabular} {|R{1cm}{.2\textwidth} R{1cm}{.2\textwidth} R{1cm}{.2\textwidth} R{1cm}{.2\textwidth}}
Number of terms & $\sin(\dfrac{\pi}{6})$ & $\epsilon_t$ & $\epsilon_a$ \tabularnewline
1 & 0.52360 & 0.047198 & \tabularnewline
2 & 0.49967 & 0.00065164 & 0.047880 \tabularnewline
3 & 0.50000 & 0.0000042652 & 0.00065590 \tabularnewline
4 & 0.50000 & 0.000000016261954 & 0.00000428144 \tabularnewline
\end{tabular}
\end{center}
\end{document}
即使我已将其设置\parindent
为零值。
答案1
添加@{}
之间|
和R
\documentclass{article}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{array}
\begin{document}
\parindent = 0pt
\the \parindent
\large{TEXT}
\newcolumntype{R}[2]{>{\minipage[c][#1][c]{#2} }
l <
{\endminipage}
}
\begin{center}
\begin{tabular} {|@{}R{1cm}{.2\textwidth} R{1cm}{.2\textwidth} R{1cm}{.2\textwidth} R{1cm}{.2\textwidth}}
Number of terms & $\sin(\dfrac{\pi}{6})$ & $\epsilon_t$ & $\epsilon_a$ \tabularnewline
1 & 0.52360 & 0.047198 & \tabularnewline
2 & 0.49967 & 0.00065164 & 0.047880 \tabularnewline
3 & 0.50000 & 0.0000042652 & 0.00065590 \tabularnewline
4 & 0.50000 & 0.000000016261954 & 0.00000428144 \tabularnewline
\end{tabular}
\end{center}
\end{document}
您可以控制在垂直线和单元格内容之间插入多少空间:@{ }
将插入一个空格,@{\hskip<width>}
将插入一个特定的宽度,比如 5pt 或其他。
答案2
您的问题对我来说不是很清楚。从您的 MWE 中,我只看到表格设计中不必要的复杂性。所以看看以下解决方案是否可以帮助您:
\documentclass{article}
\usepackage{amsmath}
\usepackage[showframe]{geometry}% option showframe serve only to show page layout,
% in real aplication had to be removed
\usepackage{array}
\parindent = 0pt
\begin{document}
\the\parindent
\large{TEXT}
{\renewcommand\tabcolsep{7.5mm}
\begin{tabular} {|@{} l l l l @{}}
Number of terms & $\sin(\dfrac{\pi}{6})$ & $\epsilon_t$ & $\epsilon_a$ \tabularnewline
1 & 0.52360 & 0.047198 & \tabularnewline
2 & 0.49967 & 0.00065164 & 0.047880 \tabularnewline
3 & 0.50000 & 0.0000042652 & 0.00065590 \tabularnewline
4 & 0.50000 & 0.000000016261954 & 0.00000428144 \tabularnewline
\end{tabular}
}
%\end{center}
\end{document}
它给: