[Tex/LaTex] Horizontal line in a pbox

rules

While creating a quiz, I needed to format logical arguments, which our textbook presents as a list of premises, one per line, then a horizontal rule as wide as the widest premise, and the conclusion underneath. There should not be too much space around the rule (it does not take up a line of its own.)

I dealt with this by using the pbox package (I have version 1.2.) I put the premises and conclusion in a pbox, with an \hrule before the conclusion. Since the \pbox was the width of the widest line, the \hrule was also the right width. Here is a minimal example.

\documentclass{minimal}
\usepackage{pbox}
\begin{document}
\pbox{8cm}{
Either you love logic or you hate it. \\
You don't hate logic.
\smallskip\hrule\smallskip
You love logic.}
\end{document}

This works fine, actually, except that it produces an error: You can't use `\hrule' here except with leaders. After pressing enter to ignore the error, it is output exactly as I would hope, except that having to press enter 9 times each time I compile my document is not very nice. The quiz looks like this:

Logical Arguments

This raises a 4-fold question:

  1. What is the reason for the error, which only seems to arise in a \pbox? I would love an explanation of the TeXnical underpinnings.
  2. How should one draw a horizontal line across a \pbox without error?
    I found that \hrulefill works, but needs its own line.
    Is there a more elegant way than \\[-.7em] \null\hrulefill\\[-.2em],
    which has the disadvantage of fiddly spacing (liable to break down,
    and only approximating the spacing of \smallskip\hrule\smallskip, which I liked)?
  3. Is there a way to use \leaders, as suggested by the error, to maintain the same output
    produced by \hrule but without the error?
  4. What's the proper way to achieve my desired result?
    I suppose the obvious method is with a tabular environment, but this does not seem semantically correct to me.
    A succession of statements, with a line underneath, is not a table!
    Also, the line does not fit the width quite as nicely as it does in a \pbox, though I'm sure that can be fixed with fiddling.

Best Answer

Addressing only item 4, hiding the tabular inside a macro \logicarg{<premise>}{<conclusion>} might be more appealing:

enter image description here

\documentclass{article}
\newcommand{\logicarg}[2]{% \logicarg{<premise>}{<conclusion>}
  \begin{tabular}[t]{@{}l@{}}
    #1 \\ \hline #2
  \end{tabular}%
}
\begin{document}
\begin{enumerate}
  \item \logicarg
    {If you are eating soup then I am happy. \\ You are eating soup}
    {I am happy}
  \item \logicarg
    {If it is Wednesday then you aren't taking a quiz. \\ It is not Wednesday.}
    {You are taking a quiz.}
  \item \logicarg
    {Either you love logic or you hate it. \\ You don't hate logic.}
    {You love logic.}
\end{enumerate}
\end{document}