3
$\begingroup$

This question already has an answer here:

A brief search didn't turn out a dupe, but recently I have found that the spoiler-markup >! doesn't work well with multilined MathJax, especially displaystyle:

>! $$\begin{pmatrix}1&2\\
3&4\end{pmatrix}$$

! $$\begin{pmatrix}1&2\\ 3&4\end{pmatrix}$$

>! $$\begin{pmatrix}1&2\\
>! 3&4\end{pmatrix}$$

! $$\begin{pmatrix}1&2\\ >! 3&4\end{pmatrix}$$

How can this be fixed other than putting all the MathJax in a single line wich can be very bad for long code? Also note that the centering of $$...$$ isn't working in spoilers either during preview.

>! $$\begin{pmatrix}1&2\\3&4\end{pmatrix}$$

$$\begin{pmatrix}1&2\\3&4\end{pmatrix}$$

$\endgroup$

marked as duplicate by Martin Sleziak, JonMark Perry, yoknapatawpha, Watson, Joel Reyes Noche Apr 29 '16 at 5:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 4
    $\begingroup$ You might find some posts mentioning similar problems if you have a look at other posts tagged (spoilers). From example this two posts seem related: meta.math.stackexchange.com/questions/10906/…, meta.math.stackexchange.com/questions/9297/… (In both cases some environment, which contained `\`, was used.) $\endgroup$ – Martin Sleziak Mar 7 '15 at 13:01
  • $\begingroup$ Why do you need spoilers? $\endgroup$ – quid Mar 7 '15 at 13:06
  • 3
    $\begingroup$ @quid Mostly for pedagogic purposes: Leave the option for the interested asker to run through the described process himself and compare his results to the actual solutions in a spoiler. I rarely employ them (wich you might know), but there are times where I find those useful. $\endgroup$ – AlexR Mar 7 '15 at 13:33
  • 1
    $\begingroup$ Thanks for the reply. I did not know how much you use them. I am glad to hear you only use them rarely, as generally I consider them to be a nuissance on this site. Most of the time I think an asker that wishes to can run the process themselves even when the result was visible to them briefly. $\endgroup$ – quid Mar 7 '15 at 14:14
  • $\begingroup$ @quid Generally I fully agree with you, wich is why I use them very rarely. But if the solution is a very interesting one, knowing it might "bias" the mathematical intuition towards the solution, sometimes preventing mistakes one would have made had one not known the solution. (Much grammatic, very wow) $\endgroup$ – AlexR Mar 7 '15 at 14:17
  • $\begingroup$ Right. But then typically that solution would be short, else one could not even grasp it quickly. So for multiline-spoilers this seem exceedingly rarely an issue. But I guess by this point I insist too much on this. Sorry for the noise. I just really dislike spoilers on this site. $\endgroup$ – quid Mar 7 '15 at 14:24
  • $\begingroup$ No problem, but matrices for example (as shown above) are barely readable if put into one line even if only one line of math is rendered. $\endgroup$ – AlexR Mar 7 '15 at 14:26
  • $\begingroup$ In case you're not aware, there's an environment smallmatrix for... small matrices. You need to add the brackets yourself, but they look a bit better (I think) in inline math. $\endgroup$ – Najib Idrissi Mar 7 '15 at 15:11
  • $\begingroup$ @NajibIdrissi I'm aware, thanks. Still their code as a one-liner is barely readable for larger matrices (or more complicated cells). I'm also aware of the shorthand \pmatrix{...} wich will improve readability at least a little when in one line. $\endgroup$ – AlexR Mar 7 '15 at 15:13
  • 1
    $\begingroup$ IMHO, the spoiler on math.SE is so hard to use and I'll just forget it. $$\newcommand{\myspoiler}[2][padding: 4px;]{ \style{background-color: rgb(240,240,240);#1}{\class{spoiler}{#2}}} \verb/Your matrix is hiding here/ \rightarrow \myspoiler[padding: 8px;]{ \begin{pmatrix}1&2\\3&4\end{pmatrix} }$$ $\endgroup$ – achille hui Mar 7 '15 at 15:38
  • 1
    $\begingroup$ @achillehui While nice and working, I think that format disrupts the UI too much. $\endgroup$ – AlexR Mar 7 '15 at 15:40

Browse other questions tagged .