I would like to use a spoiler in this post of the the proof of the point $1$-$3$ but unfortunately I was not able: so is it possible use a spoiler?
1 Answer
This is from the link in The Amplitwist's comment. The following mix of spoilers with HTML
>! <ol>
>! <li> First point;<br/>
>! First point continuing on a newer line, </li>
>! <li> listB $E=mc^2$, and </li>
>! <li> listC. </li>
>! </ol>
results in
- First point;
First point continuing on a newer line,- listB $E=mc^2$, and
- listC.
Note <br/>
used to force a new line; <ol>...</ol>
can be replaced with <ul>...</ul>
to change the ordered list into an unordered list. For other things that break in spoiler tags, see the link.
There is a second way, using MathJax to reimplement the spoiler. Adapting from Hierarchical spoilers , How To Hide An Array on MathSE, we first add $\require{action}$
$\require{action}$ somewhere on the page. Then we can write
1. $\toggle{\text{click to show first spoiler}}{X}\endtoggle$
2. $\toggle{\text{click to show second spoiler}}{Y}\endtoggle$
3. $\toggle{\text{click to show third spoiler}}{Z}\endtoggle$
to achieve
- $\toggle{\text{click to show first spoiler}}{X}\endtoggle$
- $\toggle{\text{click to show second spoiler}}{Y}\endtoggle$
- $\toggle{\text{click to show third spoiler}}{Z}\endtoggle$
You could also reimplement the list numbers using the array
environment so that one click reveals all, but its longer to type:
$\toggle{
\begin{array}{l}
\begin{array}{rl}
1.& \\
2.& \\
3.& \\
\end{array} \\
\text{click to show spoilers}
\end{array}
}{
\begin{array}{l}
\begin{array}{rl}
1.& X \\
2.& Y \\
3.& Z \\
\end{array} \\
\text{click to hide spoilers}
\end{array}
}\endtoggle$
gives
$\toggle{ \begin{array}{l} \begin{array}{rl} 1.& \\ 2.& \\ 3.& \\ \end{array} \\ \text{click to show spoilers} \end{array} }{ \begin{array}{l} \begin{array}{rl} 1.& X \\ 2.& Y \\ 3.& Z \\ \end{array} \\ \text{click to hide spoilers} \end{array} }\endtoggle$
One issue with these is that the spoilers are a little visible while the MathJax is loading. You can also 'pretty up' a button; see Hierarchical spoilers.
-
$\begingroup$ Oh, fine! Only a last question before to approve the answer: is possible to put the spoiler after the list number? E.g. is it possible to put spoiler of "First point" after 1. in order to it is possibile to see how numbers have the list? $\endgroup$ Jun 4, 2022 at 11:13
-
$\begingroup$ @AntonioMariaDiMauro , I think the same method would not work. So I added a different method that I remembered. $\endgroup$ Jun 4, 2022 at 11:36
-
1$\begingroup$ Okay, question upvoted and approved: thanks very much for your assistance!!! $\endgroup$ Jun 4, 2022 at 12:05
-
1$\begingroup$ You can also add a grey box in MathJax: $$ \bbox[#f0f2f2,5px,border:3px solid #c9cdd0] {\large \substack{\toggle{ \begin{array}{l} \text{Reveal spoiler} \end{array} }{ \begin{array}{l} \begin{array}{rl} 1.& X \\ 2.& Y \\ 3.& Z \\ \end{array} \end{array} }\endtoggle} } $$ $\endgroup$– user905694Jun 4, 2022 at 12:07
-
$\begingroup$ $$\toggle{\text{This}}{\toggle{\text{seems}}{\toggle{\text{fun,}}{\toggle{\text{if}}{\toggle{\text{a}}{\toggle{\text{bit}}{\text{annoying!}}\endtoggle}\endtoggle}\endtoggle}\endtoggle}\endtoggle}\endtoggle$$ $\endgroup$ Jun 11, 2022 at 10:41
>{text or mathjax
, preceding the first level, and>>{text or mathjax}
preceding the points you want to use spoilers on. So lose the excessive block formatting. $\endgroup$