开发者

make LaTeX draw a \hline between each line in tabular without using \hline? [closed]

开发者 https://www.devze.com 2023-01-05 11:48 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about programming within the scope defined in the help center.

Closed 6 years ago.开发者_开发技巧

Improve this question

Is there any obvious or pretty way to have LaTeX automatically put a \hline between each line in a table without having to put a \hline between each line?

I thought about creating a command like:

\newcommand{\EOL}{\\ \hline}

But then I will get non-standard looking tables like this:

3 & 2 & 1 \EOL
1 & 2 & 3 \EOL

Is there a way such that my table bodies could look like:

3 & 2 & 1 \\
1 & 2 & 3 \\

And yet still get the hlines?


\catcode`@=11
\let \savecr \@tabularcr
\def\@tabularcr{\savecr\hline}
\catcode`@=12

\begin{tabular}{ccc}
1 & 2 & 3\\ 
4 & 5 & 6\\
\end{tabular}
0

精彩评论

暂无评论...
验证码 换一张
取 消