2

I'm a beginner of LaTeX. I'm trying to write below expression using MathJAX. expression what I want to write

I could write expression without box using array package. But I couldn't draw a box within array. Can you help me please? Thank you for your reading my question.

closed as off-topic by OSjerick, Sean Allred, Jesse, Peter Jansson, Svend Tveskæg Jan 20 '14 at 7:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – OSjerick, Sean Allred, Jesse, Peter Jansson, Svend Tveskæg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Welcome to TeX.SX! While mathjax uses LaTeX syntax, it uses Javascript and HTML's DOM model rather than TeX technology, making it mostly off topic for this site. You might try instead searching among the questions tagged with mathjax on StackOverflow, or in the official mathjax-users Google group. – Herr K. Jan 20 '14 at 2:35
  • For LaTeX, you might try logicsym at cs.pomona.edu/~kim/CSC081S13/Auxiliary which claims to cover boxed proofs but I can't tell for sure what is meant. Neither can I find any licence whatsoever. – cfr Jan 20 '14 at 2:39
  • 1
    To close voters: I think the OP just meant to set everything in math mode, what looks to him/her as this MathJax syntax he/she is used to. – Speravir Jan 20 '14 at 4:33
  • Please make your intentions more clear. You can edit your own question, also the title. Also it would help to provide some code without a box: Add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Speravir Jan 20 '14 at 4:41
7

The following achieves it quite adequately:

$$
\begin{array}{l}
  \begin{array}{|l|}
    \hline
    \hspace{20pt} \rlap{q \rightarrow r} \hspace{200pt} \hbox{assumption} \\
    \begin{array}{|l|}
      \hline
      \hspace{14pt} \rlap{\neg q \rightarrow \neg p} \hspace{200pt} \hbox{assumption} \\
      \begin{array}{|l|}
        \hline
        \hspace{8pt} \rlap{p} \hspace{200pt} \hbox{assumption} \\
        \hspace{8pt} \rlap{\neg \neg p} \hspace{200pt} \neg \neg \hbox{i 3} \\
        \hspace{8pt} \rlap{\neg \neg q} \hspace{200pt} \hbox{MT 2, 4} \\
        \hspace{8pt} \rlap{q} \hspace{200pt} \neg \neg \hbox{e 5} \\
        \hspace{8pt} \rlap{r} \hspace{200pt} {\rightarrow} \hbox{e 1, 6} \\
        \hline
      \end{array} \\
      \hspace{14pt} \rlap{p \rightarrow r} \hspace{200pt} {\rightarrow} \hbox{i 3-7} \\
      \hline
    \end{array} \\
    \hspace{20pt} \rlap{(\neg q \rightarrow \neg p) \rightarrow (p \rightarrow r)} \hspace{200pt} {\rightarrow} \hbox{i 2-8} \\
    \hline
  \end{array} \\
  \hspace{26pt} \rlap{(q \rightarrow r) \rightarrow ((\neg q \rightarrow \neg p) \rightarrow (p \rightarrow r))} \hspace{200pt} {\rightarrow} \hbox{i 1-9}
\end{array}
$$

Tested on Math.SE:

enter image description here

It assumes a 6pt length for \arraycolsep - the gap between the vertical rule and the cell content inside an array. \rlap provides right overlapping while \hbox sets content in text mode.

Not the answer you're looking for? Browse other questions tagged or ask your own question.