4

In array env,

  1. how to add extra space between two columns?

  2. how to enumerate acrossrows?

e.g.

enter image description here

Romstar
  • 559
  • Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – egreg Nov 18 '12 at 16:13
  • About adding the number, look at http://tex.stackexchange.com/questions/58138/how-to-enumerate-the-rows-of-a-table – egreg Nov 18 '12 at 16:16
  • About padding the columns with some space, see Column padding in tables. – Werner Nov 18 '12 at 16:20
  • @egreg: Thanks for the link. How to not to enumerate the first row? – Romstar Nov 18 '12 at 16:27
  • \setcounter mentioned in http://tex.stackexchange.com/questions/58138/how-to-enumerate-the-rows-of-a-table can't be used to skip a row. – Romstar Nov 18 '12 at 16:33

1 Answers1

2

The answer to How to enumerate the rows of a table may not satisfy you, since it numbers all the rows.

I suggest a modification, also for allowing you to refer to the row numbers via the \label-\ref mechanism.

\documentclass{article}
\usepackage{array}

\newcounter{formalproof}
\newenvironment{formalproof}
  {\setcounter{formalproof}{0}%
   \begin{tabular}{
     @{}
     >{\refstepcounter{formalproof}\theformalproof. $}l<{$}
     @{\hspace{2em}}
     l
     @{}
   }
   \multicolumn{1}{@{}l@{\hspace{2em}}}{\textbf{Step}} & \multicolumn{1}{@{}l@{}}{\textbf{Reason}}\\}
  {\end{tabular}}

\begin{document}
\noindent\begin{formalproof}
\label{ONE} \forall x(D(x)\to C(x)) & Premise \\
\label{TWO} D(\textrm{Marla})\to C(\textrm{Marla}) & Universal instantiation from (\ref{ONE}) \\
\label{THR} D(\textrm{Marla}) & Premise \\
C(\textrm{Marla}) & Modus ponens from (\ref{TWO}) and (\ref{THR})
\end{formalproof}
\end{document}

The labels you use are arbitrary, of course.

enter image description here

egreg
  • 1,121,712