2

I'm trying to figure out a way to present a semi-formalised argument for a paper I'm writing. It seems the best way to do it is to use a table with three columns: the left column with the premiss numbers aligned to the right, a central column with the premisses, and the right column with the premiss labels/inference rules aligned to the right. At the moment my code outputs the following, which is pretty close to what I want:

enter image description here

There are a couple of changes I want which I can't figure out how to do. First, I would like the text in the middle column to be justified. Second, I would like the left and right columns to be the minimum necessary width.

Here's a MWE:

\documentclass[12pt]{article}

\usepackage{tabularx}
\usepackage{array}
\usepackage{baskervillef} %font
\usepackage[T1]{fontenc} %font
\usepackage{mathrsfs} % fancy maths latters
\usepackage[margin=30mm]{geometry} %changes margins

\begin{document}

\begin{table}[h!]
    \begin{center}
        \begin{tabularx}{\textwidth}{ 
                >{\raggedleft\arraybackslash}p{.05\textwidth}
                >{\raggedright\arraybackslash}p{.68\textwidth}
                >{\raggedleft\arraybackslash}p{.2\textwidth}}
            (1) & If $\mathscr{X}_{1}$ is correct, then: If $\Gamma \models_{\mathscr{X}_{1}} \varphi$ then $O(Bs\Gamma \supset Bs\varphi)$ & (Normativity)\\
            (2) & If $\mathscr{X}_{2}$ is correct, then: If $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ then $O\neg(Fs\varphi m)$ & (Normativity)\\
            (3) & $\mathscr{X}_{1}$ and $\mathscr{X}_{2}$ are correct & (Pluralism)\\
            (4) & If $\Gamma \models_{\mathscr{X}_{1}} \varphi$ then $O(Bs\Gamma \supset Bs\varphi)$ & (1,3, MP)\\
            (5) & If $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ then $O\neg(Fs\varphi m)$ & (2,3, MP)\\
            (6) & If $O(Bs\varphi)$ and \textit{m} is a reliable method by which \textit{s} can form the belief that $\varphi$, then $\neg O\neg(Fs\varphi m)$ & (\textit{Transmission})\\
            (7) & $\Gamma \models_{\mathscr{X}_{1}} \varphi$ & (Pluralism)\\
            (8) & $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ & (Pluralism)\\
            (9) & $O(Bs\Gamma)$ & (\textit{Ex hypothesi})\\
            (10) & \textit{m} is a reliable method by which \textit{s} can form the belief that $\varphi$ & (Pluralism)\\
            (11) & $O(Bs\Gamma \supset Bs\varphi)$ & (4,7, MP)\\
            (12) & $O(Bs\varphi)$ & (9,11, MP)\\
            (13) & $\neg O\neg(Fs\varphi m)$ & (6,10,12, MP)\\
            (14) & $O\neg(Fs\varphi m)$ & (5,8, MP)\\
            (15) & $\mathscr{X}_{1}$ and $\mathscr{X}_{2}$ are not correct & (3,13,14, RAA)
        \end{tabularx}
    \end{center}
\end{table}

\end{document}
2
  • A tabularx environment requires at least one X column.
    – Bernard
    Mar 2, 2020 at 8:51
  • \begin{tabularx}{\textwidth}{@{}lXr@{}}
    – Fran
    Mar 2, 2020 at 9:11

2 Answers 2

1

If you want the text to be justified, don't use the directive >{\raggedright} for the middle column. To minimize the other columns, use the standard r specifier. Here is a code, in which I took the liberty to left-align the rightmost column, as it its looks better, in my opinion:

\documentclass[12pt]{article}

\usepackage{tabularx}
\usepackage{array}
%\usepackage{baskervillef} %font
\usepackage[T1]{fontenc} %font
\usepackage{mathrsfs} % fancy maths latters
\usepackage[margin=30mm]{geometry} %changes margins

\begin{document}

\begin{table}[h!]
 \centering
 \setlength{\extrarowheight}{3pt}
        \begin{tabularx}{\textwidth}{@{}rXl@{}}
            (1) & If $\mathscr{X}_{1}$ is correct, then: If $\Gamma \models_{\mathscr{X}_{1}} \varphi$ then $O(Bs\Gamma \supset Bs\varphi)$ & (Normativity)\\
            (2) & If $\mathscr{X}_{2}$ is correct, then: If $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ then $O\neg(Fs\varphi m)$ & (Normativity)\\
            (3) & $\mathscr{X}_{1}$ and $\mathscr{X}_{2}$ are correct & (Pluralism)\\
            (4) & If $\Gamma \models_{\mathscr{X}_{1}} \varphi$ then $O(Bs\Gamma \supset Bs\varphi)$ & (1,3, MP)\\
            (5) & If $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ then $O\neg(Fs\varphi m)$ & (2,3, MP)\\
            (6) & If $O(Bs\varphi)$ and \textit{m} is a reliable method by which \textit{s} can form the belief that $\varphi$, then $\neg O\neg(Fs\varphi m)$ & (\textit{Transmission})\\
            (7) & $\Gamma \models_{\mathscr{X}_{1}} \varphi$ & (Pluralism)\\
            (8) & $\Gamma \not\models_{\mathscr{X}_{2}} \varphi$ & (Pluralism)\\
            (9) & $O(Bs\Gamma)$ & (\textit{Ex hypothesi})\\
            (10) & \textit{m} is a reliable method by which \textit{s} can form the belief that $\varphi$ & (Pluralism)\\
            (11) & $O(Bs\Gamma \supset Bs\varphi)$ & (4,7, MP)\\
            (12) & $O(Bs\varphi)$ & (9,11, MP)\\
            (13) & $\neg O\neg(Fs\varphi m)$ & (6,10,12, MP)\\
            (14) & $O\neg(Fs\varphi m)$ & (5,8, MP)\\
            (15) & $\mathscr{X}_{1}$ and $\mathscr{X}_{2}$ are not correct & (3,13,14, RAA)
        \end{tabularx}
\end{table}

\end{document} 

enter image description here

1

If you change the \begin{tabularx} as follows:

\begin{tabularx}{\textwidth}{rXr}

you get:

  1. first column right aligned (r), which width is computed by LaTeX to be the minimum required
  2. center column justified (X), with auto linebreak
  3. third column right aligned (r), which width is computed by LaTeX to be the minimum required

You can control the width of the table with the second parameter given to the environment {\textwidth}, which you can multiply by a scaling factor; for example {0.75\textwidth}.

You may see "extra space" between columns because you forced the table to be as large as \textwidth.

Also, take into consideration the fact that columns are separated by some horizontal space. If you want to remove it, simply do

\begin{tabularx}{\textwidth}{r@{}X@{}r}

But the result can be ugly. Some space between columns is nicer. In any case, you can put inside @{} the length you prefer, like, for example

\begin{tabularx}{\textwidth}{r@{\,}X@{\,}r}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .