13
$\begingroup$

You know how some webpages will have a section that looks like > 'heading'; and when you click on it, it expands into a wall of text?

Is there a way to include one of those in post?

There are times when a long explanation is helpful but not strictly necessary, and I don't want to inconvenience people who don't actually need to read it. It would be nice to have an "expand for complete explanation/proof/etc."

I apologize for not knowing what "that thing" is called (I keep wanting to say "drop-down" or "expandable list", but I don't think that's it).

$\endgroup$
  • $\begingroup$ I don't know if this feature exists, but one thing you can do - which I've done frequently in the past - is to open with the "heading-only" version of the question, then have a line ("******"), then below the line have the additional detail. $\endgroup$ – Noah Schweber Jul 31 at 16:03
  • 3
    $\begingroup$ No, there is no such functionality. $\endgroup$ – davidlowryduda Jul 31 at 16:56
  • 5
    $\begingroup$ Related post on Meta Stack Exchange: Please add the ability to fold blocks of code in questions and answers. (It is marked as status-declined.) And also: How to create a collapsable field in a post. $\endgroup$ – Martin Sleziak Jul 31 at 18:31
  • $\begingroup$ math.meta.stackexchange.com/questions/30240/… is semi related $\endgroup$ – Roddy MacPhee Jul 31 at 23:36
  • 1
    $\begingroup$ In most writing contexts (including this one), you will not have the option of collapsible sections, so even if this site supported it, you should take this as an opportunity to hone your writing via judicious use of headings, good paragraph structure, and good topic sentences. If you make it easy to find where to skip to next, then this collapsible section should not be necessary. You can provide a short overview of the whole answer, if you think that overview alone will suffice for many people. $\endgroup$ – Derek Elkins Aug 1 at 1:58
  • 2
    $\begingroup$ You may want to organize such extras in footnotes or appendices ... $\endgroup$ – Hagen von Eitzen Aug 2 at 11:42
  • $\begingroup$ See tex.stackexchange.com/q/327737/71509 $\endgroup$ – Paramanand Singh Aug 3 at 9:37
10
$\begingroup$

To reiterate what was said in a comment, that's not really possible, except in a way on mobile.

It is possible though to hide text as a spoiler. Like this (hover over it to show, click to fix it, on mobile one has to click but this is even indicated).

This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it. This text is not necessary. Thus we hide it.

The syntax is >! Text

That is sometimes used, but it is not really convenient as it takes up the full space on the site in standard view. However, on the mobile site it seems to be collapsed.

Possibly somebody could use MathJax in a clever way to about what you want. But that would be inconvenient and would have other drawbacks.

What I recommend instead is to format your posts in a good way. If it is really long, write a brief introduction, etc. There are various types of heading and ways to add emphasis. Judicious use of those will allow to present long post in a readable way.

$\endgroup$
  • 1
    $\begingroup$ I've seen an expandible spoiler used before on math stack. $\endgroup$ – Roddy MacPhee Jul 31 at 17:33
  • $\begingroup$ I just realize that on mobile spoiler collapse. Maybe it was on a mobile? $\endgroup$ – quid Jul 31 at 23:02
  • $\begingroup$ definitely, haven't had a PC working in 2 years( except a library PC) $\endgroup$ – Roddy MacPhee Jul 31 at 23:14
  • $\begingroup$ all it would take is inversing the sign on a raise command and undoing a phantom or visibility setting on click. $\endgroup$ – Roddy MacPhee Jul 31 at 23:21
  • $\begingroup$ if we could toggle easily ( couldn't find the wikibook section for LaTeX equivalent) I found out \let\hphantom\relax \let\vphantom\relax on the TeX exchange. toggle it with conditional on click and protect fragile commands and it would work. $\endgroup$ – Roddy MacPhee Aug 1 at 1:13
2
$\begingroup$

Maybe not what you are really looking for. But you can put 4 spaces before a paragraph

LongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanationLongExplanation

which adds a horizontal scroll bar to the text so that it doesn't take up too much space of the page. But it would make it annoying for those who wish to read it. So I suggest using newlines carefully to adjust how long horizontally you can scroll and how long vertially it expands.

$\endgroup$
  • 4
    $\begingroup$ Once you do that, the formatting changes to Markdown. It's not always suitable given Math.SE frequently requires MathJax. $\endgroup$ – TheSimpliFire Aug 1 at 19:50
  • $\begingroup$ Note this may cause screen readers to read the text out letter by letter, because it's intended for source code. $\endgroup$ – Kevin Aug 7 at 17:48

You must log in to answer this question.

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