2
$\begingroup$

I constructed a (long) self-answer, that I subsequently discarded, since I found that the question + answer was a duplicate. I intended to have the answer hidden.

I had trouble converting the following array to a hidden format:

\begin{array}{| r | r | r | r |} \hline \text{Case} & n & n+1 & 2n+1 \\ \hline 1 & 2a^2 & 3b^2 & c^2 \\ \hline 2 & 2a^2 & b^2 & 3c^2 \\ \hline 3 & a^2 & 2b^2 & 3c^2 \\ \hline 4 & 3a^2 & 2b^2 & c^2 \\ \hline 5 & 6a^2 & b^2 & c^2 \\ \hline 6 & a^2 & 6b^2 & c^2 \\ \hline \end{array}


What I settled for is this:

-------------------------------------------- ----------
Case $~~~~~~~n$ $~~~~~~~~n+1$ $~~~~~~2n+1$
-------------------------------------------- ----------
$~~~~1$ $~~~~~~2a^2$ $~~~~~~~~~~3b^2$ $~~~~~~~~~~~~~c^2$
-------------------------------------------- ----------
$~~~~2$ $~~~~~~2a^2$ $~~~~~~~~~~~b^2$ $~~~~~~~~~~~~3c^2$
-------------------------------------------- ----------
$~~~~3$ $~~~~~~~a^2$ $~~~~~~~~~~2b^2$ $~~~~~~~~~~~~3c^2$
-------------------------------------------- ----------
$~~~~4$ $~~~~~~3a^2$ $~~~~~~~~~~2b^2$ $~~~~~~~~~~~~~c^2$
-------------------------------------------- ----------
$~~~~5$ $~~~~~~6a^2$ $~~~~~~~~~~~b^2$ $~~~~~~~~~~~~~c^2$
-------------------------------------------- ----------
$~~~~6$ $~~~~~~~a^2$ $~~~~~~~~~~6b^2$ $~~~~~~~~~~~~~c^2$
-------------------------------------------- ----------


You can review the code that I used by pretending to edit the question.

Questions:

  1. At the present time, on mathSE, is this the best that I can do?
  2. If so, how much trouble would it be for a moderator to enhance the html or mathJax capabilities at mathSE to facilitate including tabular/array of data in a hidden answer?
$\endgroup$
1
8
$\begingroup$

Here is a community answer for purposes of testing.

The text from the question posted as a spoiler.

! \begin{array}{| r | r | r | r |} \hline >! \text{Case} & n & n+1 & 2n+1 \\ \hline >! 1 & 2a^2 & 3b^2 & c^2 \\ \hline >! 2 & 2a^2 & b^2 & 3c^2 \\ \hline >! 3 & a^2 & 2b^2 & 3c^2 \\ \hline >! 4 & 3a^2 & 2b^2 & c^2 \\ \hline >! 5 & 6a^2 & b^2 & c^2 \\ \hline >! 6 & a^2 & 6b^2 & c^2 \\ \hline >! \end{array}

The same text, but now in a single line as suggested in: Multiline hidden text with align environment.

\begin{array}{| r | r | r | r |} \hline \text{Case} & n & n+1 & 2n+1 \\ \hline 1 & 2a^2 & 3b^2 & c^2 \\ \hline 2 & 2a^2 & b^2 & 3c^2 \\ \hline 3 & a^2 & 2b^2 & 3c^2 \\ \hline 4 & 3a^2 & 2b^2 & c^2 \\ \hline 5 & 6a^2 & b^2 & c^2 \\ \hline 6 & a^2 & 6b^2 & c^2 \\ \hline\end{array}

One might be tempted to try a table:

Case $n$ $n+1$ $2n+1$
$1$ $2a^2$ $3b^2$ $c^2$
$2$ $2a^2$ $b^2$ $3c^2$
$3$ $ a^2$ $2b^2$ $3c^2$
$4$ $3a^2$ $2b^2$ $c^2$
$5$ $6a^2$ $b^2$ $c^2$
$6$ $a^2$ $6b^2$ $c^2$

But the tables do not work in spoilers:

| Case | $n$ | $n+1$ | $2n+1$ | |------|---|---|---| | $1$ | $2a^2$ | $3b^2$ | $c^2$ | | $2$ | $2a^2$ | $b^2$ | $3c^2$ | | $3$ | $ a^2$ | $2b^2$ | $3c^2$ | | $4$ | $3a^2$ | $2b^2$ | $c^2$ | | $5$ | $6a^2$ | $b^2$ | $c^2$ | | $6$ | $a^2$ | $6b^2$ | $c^2$ |

From this answer of achille hui:

$$\require{action} \toggle{ \text{(Click to show table)} }{ \begin{array}{c} \begin{array}{| r | r | r | r |} \hline \text{Case} & n & n+1 & 2n+1 \\ \hline 1 & 2a^2 & 3b^2 & c^2 \\ \hline 2 & 2a^2 & b^2 & 3c^2 \\ \hline 3 & a^2 & 2b^2 & 3c^2 \\ \hline 4 & 3a^2 & 2b^2 & c^2 \\ \hline 5 & 6a^2 & b^2 & c^2 \\ \hline 6 & a^2 & 6b^2 & c^2 \\ \hline\end{array}\\ \text{(Click to hide table)} \end{array} } \endtoggle$$

$\endgroup$
5
  • $\begingroup$ Nice trick. However I am used to writing arrays in multi-line. $\endgroup$ Jun 6 at 9:42
  • 1
    $\begingroup$ So you're saying that you can't spoil a table? Or that tables are already spoiled? $\endgroup$
    – Asaf Karagila Mod
    Jun 6 at 10:10
  • $\begingroup$ +1 and accepted. Sharp answer. $\endgroup$ Jun 6 at 10:27
  • $\begingroup$ I will stress that this was intended as a space where various users can test their ideas how to do this. (That's why I made the answer CW.) So if you have some other ideas, do not hesitate to edit this further. $\endgroup$ Jun 6 at 10:28
  • 2
    $\begingroup$ @user2661923 I adapted a legendary answer of achille hui $\endgroup$ Jun 6 at 11:11

You must log in to answer this question.

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